-
Notifications
You must be signed in to change notification settings - Fork 13
Description
Claudio,
As mentioned during the WCEE, I looked into the calculation of travel times and takeoff angles when using a layered velocity model for use in sourcespec.
Some years ago, I wrote a python class for doing that, based on a Fortran module in hypo71. You can find it here
Except for the plot functions, this class does not depend on other custom modules, only numpy and scipy.
It can be initialized as follows:
vmodel = CrustalVelocityModel(layer_top_depths, VP, VS, name='sourcespec velocity model')
I added a new calc_tt_and_angles
method which calculates both travel times and takeoff angles (similar to the _wave_arrival_*
functions in sourcespec), as well as incidence angles in the most efficient way, which works as follows:
result = vmodel.calc_tt_and_angles(Zf, Zs, Repi, wave, wave_type)
(travel_time, takeoff_angle, incidence_angle, wave_type) = result
with Zf
= focal depth in km, Zs
= station depth (in km), Repi
= epicentral distance in km, wave
= "P" or "S", wave_type
= "REF", "DIR", "REFL" or None (= fastest arrival).
It should not be too difficult for you to test this.
However, this method depends on quite a number of other methods. I don't think it would be practical to combine all of them in a single function (it would be similar to the original Fortran code, which is quite ugly...). Maybe we can copy this class in sourcespec and strip all unnecessary methods (e.g., plot methods, methods related to reflected waves, ...)?
Or is there a way to do the same calculations with layered velocity models in obspy??