Skip to content
Snippets Groups Projects
Commit 71b113da authored by Jeremy M Fee's avatar Jeremy M Fee
Browse files

Switch dbdt suffix from _DDT to _DT, round at 6 decimals

parent dfcac50b
No related branches found
No related tags found
No related merge requests found
...@@ -34,11 +34,11 @@ class DbDtAlgorithm(Algorithm): ...@@ -34,11 +34,11 @@ class DbDtAlgorithm(Algorithm):
""" """
out = Stream() out = Stream()
for trace in stream: for trace in stream:
dbdt = np.diff(trace.data) dbdt = np.around(np.diff(trace.data), decimals=6)
stats = Stats(trace.stats) stats = Stats(trace.stats)
stats.channel = "{}_DDT".format(stats.channel) stats.channel = "{}_DT".format(stats.channel)
trace_out = create_empty_trace( trace_out = create_empty_trace(
starttime=stats.starttime + self.period, starttime=stats.starttime + stats.delta,
endtime=stats.endtime, endtime=stats.endtime,
observatory=stats.station, observatory=stats.station,
type=stats.location, type=stats.location,
......
...@@ -349,7 +349,7 @@ class MiniSeedFactory(TimeseriesFactory): ...@@ -349,7 +349,7 @@ class MiniSeedFactory(TimeseriesFactory):
return channel return channel
if suffix is not None: if suffix is not None:
if suffix == "Dist" or suffix == "SQ" or suffix == "SV" or suffix == "DDT": if suffix == "Dist" or suffix == "SQ" or suffix == "SV" or suffix == "DT":
# these suffixes modify location code, but use element channel # these suffixes modify location code, but use element channel
channel = element channel = element
else: else:
...@@ -421,7 +421,7 @@ class MiniSeedFactory(TimeseriesFactory): ...@@ -421,7 +421,7 @@ class MiniSeedFactory(TimeseriesFactory):
location_suffix = "Q" location_suffix = "Q"
elif suffix == "SV": elif suffix == "SV":
location_suffix = "V" location_suffix = "V"
elif suffix == "DDT": elif suffix == "DT":
location_suffix = "R" location_suffix = "R"
elif suffix not in ("Bin", "Volt"): elif suffix not in ("Bin", "Volt"):
raise TimeseriesFactoryException( raise TimeseriesFactoryException(
......
...@@ -10,7 +10,7 @@ def test_process(): ...@@ -10,7 +10,7 @@ def test_process():
original script original script
""" """
# initialize DbDt object # initialize DbDt object
dbdt = DbDtAlgorithm(inchannels=["H"], outchannels=["H_DDT"], period=60) dbdt = DbDtAlgorithm(inchannels=["H"], outchannels=["H_DT"], period=60)
# load boulder May 20 files from /etc/ directory # load boulder May 20 files from /etc/ directory
hez_iaga2002_file = open("etc/dbdt/BOU202005vmin.min") hez_iaga2002_file = open("etc/dbdt/BOU202005vmin.min")
...@@ -25,7 +25,7 @@ def test_process(): ...@@ -25,7 +25,7 @@ def test_process():
result = dbdt.process(hez) result = dbdt.process(hez)
# unpack channels from result # unpack channels from result
rh = result.select(channel="H_DDT")[0] rh = result.select(channel="H_DT")[0]
# unpack channels from BOU202005dbdt.min # unpack channels from BOU202005dbdt.min
h = hez_dbdt.select(channel="H")[0] h = hez_dbdt.select(channel="H")[0]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment