Skip to content
Snippets Groups Projects
Commit 3257e52f authored by Jeremy M Fee's avatar Jeremy M Fee Committed by Claycomb, Abram Earl
Browse files

Add todos to SQDist algorithm for implementation

parent 34166f91
No related branches found
No related tags found
No related merge requests found
...@@ -199,12 +199,20 @@ class SqDistAlgorithm(Algorithm): ...@@ -199,12 +199,20 @@ class SqDistAlgorithm(Algorithm):
if trace.stats.station != self.last_observatory \ if trace.stats.station != self.last_observatory \
or trace.stats.channel != self.last_channel \ or trace.stats.channel != self.last_channel \
or trace.stats.starttime != self.next_starttime: or trace.stats.starttime != self.next_starttime:
# TODO: raise exception to prevent state from being cleared?
# state not correct, clear to be safe # state not correct, clear to be safe
self.yhat0 = None self.yhat0 = None
self.s0 = None self.s0 = None
self.l0 = None self.l0 = None
self.b0 = None self.b0 = None
self.sigma0 = None self.sigma0 = None
# TODO: prepare data for processing
# - controller/get_starttime should ensure state is honored
# - based on a TBD argument (default 30 minutes)
# project SQ/SV up to (default 30 minutes) behind realtime
# by padding end with nan values for additive call.
# trim trailing NaNs if self.trim is set # trim trailing NaNs if self.trim is set
if self.trim: if self.trim:
trace.stats['npts'] = np.argwhere(~np.isnan(trace.data))[-1][0] + 1 trace.stats['npts'] = np.argwhere(~np.isnan(trace.data))[-1][0] + 1
...@@ -234,6 +242,8 @@ class SqDistAlgorithm(Algorithm): ...@@ -234,6 +242,8 @@ class SqDistAlgorithm(Algorithm):
self.sigma0 = sigma0 self.sigma0 = sigma0
self.last_observatory = trace.stats.station self.last_observatory = trace.stats.station
self.last_channel = trace.stats.channel self.last_channel = trace.stats.channel
# TODO: double check next_starttime. Does this work as expected when
# projecting into the future, as long as the inputs are set correctly?
self.next_starttime = trace.stats.endtime + trace.stats.delta self.next_starttime = trace.stats.endtime + trace.stats.delta
self.save_state() self.save_state()
# create updated traces # create updated traces
......
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