Skip to content
Snippets Groups Projects
Commit 5a86220f authored by Cain, Payton David's avatar Cain, Payton David
Browse files

Add elements in steps for product stream information

parent fdbfdc0e
No related branches found
No related tags found
2 merge requests!146Release CMO metadata to production,!40Update controller for new filter products
......@@ -14,31 +14,51 @@ from .. import TimeseriesUtility
STEPS = [
{ # 10 Hz to one second filter
"name": "10Hz",
"data_interval": "second",
"data_interval_type": "Average 1-Second",
"input_sample_period": 0.1,
"output_sample_period": 1.0,
"window": sps.firwin(123, 0.25, window="blackman", fs=10.0),
"type": "firfilter",
"filter_comments": [
"Vector 1-second values are computed from 0.1-second values using the INTERMAGNET blackman filter centered on the second. Scalar 1-second values are computed from 0.1-second values using the INTERMAGNET blackman filter centered on the second. "
],
},
{ # one second to one minute filter
"name": "Intermagnet One Minute",
"data_interval": "minute",
"data_interval_type": "filtered 1-minute (00:15-01:45)",
"input_sample_period": 1.0,
"output_sample_period": 60.0,
"window": sps.get_window(window=("gaussian", 15.8734), Nx=91),
"type": "firfilter",
"filter_comments": [
"Vector 1-minute values are computed from 1-second values using the INTERMAGNET gaussian filter centered on the minute. Scalar 1-minute values are computed from 1-second values using the INTERMAGNET gaussian filter centered on the minute. "
],
},
{ # one minute to one hour filter
"name": "One Hour",
"data_interval": "hour",
"data_interval_type": "filtered 1-hour",
"input_sample_period": 60.0,
"output_sample_period": 3600.0,
"window": sps.windows.boxcar(60),
"type": "average",
"filter_comments": [
"Vector 1-hour values are computed from 1-minute values using a boxcar filter centered on the nearest half-hour. Scalar 1-hour values are computed from 1-minute values using a boxcar filter centered on the nearest half-hour. "
],
},
{ # one minute to one hour filter
"name": "One Day",
"data_interval": "day",
"data_interval_type": "filtered 1-Day",
"input_sample_period": 60.0,
"output_sample_period": 86400,
"window": sps.windows.boxcar(1440),
"type": "average",
"filter_comments": [
"Vector 1-day values are computed from 1-minute values using a boxcar filter centered on the nearest half-day. Scalar 1-day values are computed from 1-minute values using a boxcar filter centered on the nearest half-day. "
],
},
]
......@@ -129,6 +149,13 @@ class FilterAlgorithm(Algorithm):
self.steps = [
{
"name": "name" in data and data["name"] or "custom",
"data_interval": TimeseriesUtility.get_interval_from_delta(
self.output_sample_period
),
"data_interval_type": "filtered custom interval",
"filter_comments": [
"Data produced by filter utilizing custom coefficients and intervals."
],
"input_sample_period": self.input_sample_period,
"output_sample_period": self.output_sample_period,
"window": data["window"],
......@@ -268,6 +295,9 @@ class FilterAlgorithm(Algorithm):
filtered = self.firfilter(data, window, decimation)
stats = Stats(trace.stats)
stats.delta = output_sample_period
stats.data_interval = step["data_interval"]
stats.data_interval_type = step["data_interval_type"]
stats.filter_comments = step["filter_comments"]
stats.starttime = starttime
stats.npts = len(filtered)
trace_out = self.create_trace(stats.channel, stats, filtered)
......
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