Skip to content

Commit

Permalink
fixed bugs in hann taper error with new scipy
Browse files Browse the repository at this point in the history
  • Loading branch information
xtyangpsp committed Apr 24, 2024
1 parent 1f3af98 commit 9fa0ca7
Show file tree
Hide file tree
Showing 4 changed files with 124 additions and 124 deletions.
11 changes: 11 additions & 0 deletions changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@ UTILS:
1. Replace obspy.core.util.base._get_function_from_entry_point for
taper hann window with scipy.signal.windows.hann for compatibility with new scipy.

DOWNLOADERS:
1. Added more verbose prints in getdata().
2. Use utils.taper() for tapering the raw data, instead of obspy's taper function,
which has version errors in scipy hann window.

NOISE:
1. Fixed minor bugs in int and float, which are now excluded from numpy.

NOTEBOOKS:
1. Updated the seisgo_download_xcorr_demo with the latest version of seisgo.

=============================================================
Updates in v0.8.1
TYPES:
Expand Down
226 changes: 105 additions & 121 deletions notebooks/seisgo_download_xcorr_demo.ipynb

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion seisgo/downloaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,15 @@ def getdata(net,sta,starttime,endtime,chan,source='IRIS',samp_freq=None,
except Exception as e:
print(e)
r = []
if verbose:print('cleaning with demean, detrend, and taper')
for r in tr:
if verbose:print(' --> demean')
r.detrend('demean')
if verbose:print(' --> detrend')
r.detrend('linear')
r.taper(0.005)
if verbose:print(' --> taper')
r.data = utils.taper(r.data, fraction=0.005)
# r.taper(0.005)

if len(tr.get_gaps())>0:
if verbose:print('merging segments with gaps')
Expand Down
4 changes: 2 additions & 2 deletions seisgo/noise.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,8 @@ def correlate(fftdata1,fftdata2,maxlag,method='xcorr',substack=False,
nstack = int(np.round(Ttotal/substack_len))
ampmax = np.zeros(nstack,dtype=np.float32)
s_corr = np.zeros(shape=(nstack,Nfft),dtype=np.float32)
n_corr = np.zeros(nstack,dtype=np.int)
t_corr = np.zeros(nstack,dtype=np.float)
n_corr = np.zeros(nstack,dtype=int)
t_corr = np.zeros(nstack,dtype=float)
crap = np.zeros(Nfft,dtype=np.complex64)

for istack in range(nstack):
Expand Down

0 comments on commit 9fa0ca7

Please sign in to comment.