Skip to content

Commit

Permalink
Minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
geojunky committed Oct 7, 2022
1 parent 7333cf0 commit 8184e22
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion seismic/receiver_fn/rf_stacking.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,10 @@ def compute_hk_stack(cha_data, Vp=DEFAULT_Vp, h_range=None, k_range=None,
if(semblance_weighted):
# see Eaton et al. 2006 (doi.org/10.1016/j.tecto.2006.01.023)
S = np.power(np.sum(tphase_amps, axis=0), 2.) / np.sum(np.power(tphase_amps, 2.), axis=0)
S /= np.max(S)
S /= float(tphase_amps.shape[0])

assert np.max(S) <= 1., 'Semblance-weighting error detected ' \
'while processing station: {}'.format(cha_data[0].stats.station)

hk_stack = np.sum(tphase_amps, axis=0)
hk_stack = np.sum(hk_stack * np.dot(np.moveaxis(S, 0, -1), weights), axis=0)
Expand Down

0 comments on commit 8184e22

Please sign in to comment.