diff --git a/test/edge_test/MockMiniSeedClient.py b/test/edge_test/MockMiniSeedClient.py new file mode 100644 index 0000000000000000000000000000000000000000..88c6a4b612b5382e4eafb070501f83779c1a4dc1 --- /dev/null +++ b/test/edge_test/MockMiniSeedClient.py @@ -0,0 +1,39 @@ +import numpy +from obspy import Stream, UTCDateTime +from obspy.clients.neic.client import Client + +from geomagio import TimeseriesUtility +from geomagio.edge import SNCL + + +class MockMiniSeedClient(Client): + """replaces default obspy miniseed client's get_waveforms method to return trace of ones""" + + def get_waveforms( + self, + network: str, + station: str, + location: str, + channel: str, + starttime: UTCDateTime, + endtime: UTCDateTime, + ): + sncl = SNCL( + station=station, + network=network, + channel=channel, + location=location, + ) + trace = TimeseriesUtility.create_empty_trace( + starttime=starttime, + endtime=endtime, + observatory=station, + channel=channel, + type=sncl.data_type, + interval=sncl.interval, + network=network, + station=station, + location=location, + ) + trace.data = numpy.ones(trace.stats.npts) + return Stream([trace])