Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rapid travel time plotting in taup #3092

Merged
merged 3 commits into from Jun 15, 2022
Merged

Rapid travel time plotting in taup #3092

merged 3 commits into from Jun 15, 2022

Conversation

johnrudge
Copy link
Member

@johnrudge johnrudge commented Jun 14, 2022

What does this PR do?

This pull request modifies plot_travel_times in obspy.taup to allow for rapid plotting. It does this by plotting the precalculated times in the TauModel rather than recalculating arrivals at specific epicentral distances.

The old behaviour is:

from obspy.taup import plot_travel_times
plot_travel_times(source_depth=10, phase_list=["P", "S", "PP"], npoints=50) 

old

The new behaviour is:

plot_travel_times(source_depth=10, phase_list=["P", "S", "PP"], npoints=None) 

new

where I have made npoints=None the new default, rather than npoints=50.

Why was it initiated? Any relevant Issues?

I don't think this is related to any existing issues. Recomputing all the travel times at a series of fixed epicentral distances was painfully slow, especially with a lot of phases. I've updated the relevant figures that use this function in the docs. The old behaviour is still available by setting the npoints argument to an integer value.

PR Checklist

  • Correct base branch selected? master for new features, maintenance_... for bug fixes
  • This PR is not directly related to an existing issue (which has no PR yet).
  • If the PR is making changes to documentation, docs pages can be built automatically.
    Just add the "build_docs" tag to this PR.
    Docs will be served at docs.obspy.org/pr/{branch_name} (do not use master branch).
    Please post a link to the relevant piece of documentation.
  • If all tests including network modules (e.g. clients.fdsn) should be tested for the PR,
    just add the "test_network" tag to this PR.
  • All tests still pass.
  • Any new features or fixed regressions are covered via new tests.
  • Any new or changed features are fully documented.
  • Significant changes have been added to CHANGELOG.txt .
  • First time contributors have added your name to CONTRIBUTORS.txt .
  • If the changes affect any plotting functions you have checked that the plots
    from all the CI builds look correct. Add the "upload_plots" tag so that plotting
    outputs are attached as artifacts.
  • Add the "ready for review" tag when you are ready for the PR to be reviewed.

@johnrudge johnrudge added .taup build_docs Docs will be automatically built and deployed in github actions on pushes to the PR labels Jun 14, 2022
@johnrudge johnrudge requested a review from megies June 14, 2022 11:58
@megies megies merged commit f410058 into master Jun 15, 2022
@megies megies deleted the improve_plot_travel_times branch June 15, 2022 13:05
@megies
Copy link
Member

megies commented Jun 15, 2022

🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build_docs Docs will be automatically built and deployed in github actions on pushes to the PR .taup
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants