From 03a074b6c6253e0bd633768056d61c8bba621529 Mon Sep 17 00:00:00 2001 From: Kris Vanneste Date: Fri, 15 Jul 2022 16:36:14 +0200 Subject: [PATCH] Simplified distinction between P and S in _displacement_to_moment function. Write hypocentral and station velocities to log in _displacement_to_moment function. --- sourcespec/ssp_build_spectra.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sourcespec/ssp_build_spectra.py b/sourcespec/ssp_build_spectra.py index 2f022fc7..4b70a3c5 100644 --- a/sourcespec/ssp_build_spectra.py +++ b/sourcespec/ssp_build_spectra.py @@ -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)