Skip to content

Commit

Permalink
Simplified distinction between P and S in _displacement_to_moment fun…
Browse files Browse the repository at this point in the history
…ction.

Write hypocentral and station velocities to log in _displacement_to_moment function.
  • Loading branch information
krisvanneste authored and claudiodsf committed Jul 18, 2022
1 parent 7b5841a commit 03a074b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions sourcespec/ssp_build_spectra.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,16 @@ def _displacement_to_moment(stats, config):
From Aki&Richards,1980
"""
if config.wave_type[0] == 'S':
phase = config.wave_type[0]
if phase == 'S':
v_hypo = config.hypo.vs
elif config.wave_type[0] == 'P':
elif phase == 'P':
v_hypo = config.hypo.vp
v_station = get_vel(
stats.coords.longitude, stats.coords.latitude, -stats.coords.elevation,
config.wave_type[0], config)
phase, config)
logger.info('V%c_hypo: %.2f km/s, V%c_station: %.2f km/s'
% (phase, v_hypo, phase, v_station))
v_hypo *= 1000.
v_station *= 1000.
v3 = v_hypo**(5./2) * v_station**(1./2)
Expand Down

0 comments on commit 03a074b

Please sign in to comment.