diff --git a/geomagio/edge/EdgeFactory.py b/geomagio/edge/EdgeFactory.py index 525999834e0e0dd383e6a9d33fe310cd83454db7..d07f3fa5e194ea9792360bca048773171792ddd8 100644 --- a/geomagio/edge/EdgeFactory.py +++ b/geomagio/edge/EdgeFactory.py @@ -333,6 +333,10 @@ class EdgeFactory(TimeseriesFactory): element=channel, location=self.locationCode, ) + # geomag-algorithms *should* treat starttime/endtime as inclusive everywhere; + # according to its author, EdgeCWB is inclusive of starttime, but exclusive of + # endtime, to satisfy seismic standards/requirements, to precision delta/2; + half_delta = TimeseriesUtility.get_delta_from_interval(interval) / 2 try: data = self.client.get_waveforms( sncl.network, @@ -340,7 +344,7 @@ class EdgeFactory(TimeseriesFactory): sncl.location, sncl.channel, starttime, - endtime, + endtime + half_delta, ) except TypeError: # get_waveforms() fails if no data is returned from Edge diff --git a/geomagio/edge/MiniSeedFactory.py b/geomagio/edge/MiniSeedFactory.py index c9c3122c1adab7af744ee34b93525c7bbde75005..daf02420c82e3fd0f21b14d41d4f9b6c1e5428ed 100644 --- a/geomagio/edge/MiniSeedFactory.py +++ b/geomagio/edge/MiniSeedFactory.py @@ -358,8 +358,17 @@ class MiniSeedFactory(TimeseriesFactory): element=channel, location=self.locationCode, ) + # geomag-algorithms *should* treat starttime/endtime as inclusive everywhere; + # according to its author, EdgeCWB is inclusive of starttime, but exclusive of + # endtime, to satisfy seismic standards/requirements, to precision delta/2; + half_delta = TimeseriesUtility.get_delta_from_interval(interval) / 2 data = self.client.get_waveforms( - sncl.network, sncl.station, sncl.location, sncl.channel, starttime, endtime + sncl.network, + sncl.station, + sncl.location, + sncl.channel, + starttime, + endtime + half_delta, ) for trace in data: trace.data = trace.data.astype(data[0].data.dtype)