From e3c65b64d901a14f53da10f4db716f4853c17c90 Mon Sep 17 00:00:00 2001 From: Duncan Macleod Date: Tue, 5 Mar 2019 09:27:14 -0600 Subject: [PATCH] gwsumm.data: warn about noop resample, then skip --- gwsumm/data/timeseries.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gwsumm/data/timeseries.py b/gwsumm/data/timeseries.py index b4580fa1..505c05d6 100644 --- a/gwsumm/data/timeseries.py +++ b/gwsumm/data/timeseries.py @@ -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