Skip to content

Commit

Permalink
gwsumm.data: warn about noop resample, then skip
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanmmacleod committed Mar 5, 2019
1 parent 19c7536 commit e3c65b6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion gwsumm/data/timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,13 @@ def resample_timeseries_dict(tsd, nproc=1, **sampling_dict):
# define resample function (must take single argument)
def _resample(args):
ts, fs = args
if fs:
if fs and units.Quantity(fs, "Hz") == ts.sample_rate:
warnings.warn(
"requested resample rate for {0} matches native rate ({1}), "
"please update configuration".format(ts.name, ts.sample_rate),
UserWarning,
)
elif fs:
return ts.resample(fs, ftype='fir', window='hamming')
return ts

Expand Down

0 comments on commit e3c65b6

Please sign in to comment.