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

input channels/update limit for derived.adjusted

parent fdf2d967
No related branches found
No related tags found
3 merge requests!166Merge branch master into production,!158Merge branch 'master' into 'production',!149Efield entrypoint
...@@ -2,6 +2,7 @@ from typing import List, Optional ...@@ -2,6 +2,7 @@ from typing import List, Optional
import numpy import numpy
from ..adjusted import AdjustedMatrix
from ..algorithm import ( from ..algorithm import (
AdjustedAlgorithm, AdjustedAlgorithm,
AverageAlgorithm, AverageAlgorithm,
...@@ -9,18 +10,20 @@ from ..algorithm import ( ...@@ -9,18 +10,20 @@ from ..algorithm import (
) )
from ..Controller import Controller, get_realtime_interval from ..Controller import Controller, get_realtime_interval
from ..TimeseriesFactory import TimeseriesFactory from ..TimeseriesFactory import TimeseriesFactory
from .factory import get_edge_factory from .factory import get_edge_factory, get_miniseed_factory
def adjusted( def adjusted(
observatory: str, observatory: str,
input_factory: Optional[TimeseriesFactory] = None, input_factory: Optional[TimeseriesFactory] = None,
input_channels: List[str] = ["H", "E", "Z", "F"],
interval: str = "second", interval: str = "second",
output_factory: Optional[TimeseriesFactory] = None, output_factory: Optional[TimeseriesFactory] = None,
matrix: Optional[numpy.ndarray] = None, output_channels: List[str] = ["X", "Y", "Z", "F"],
pier_correction: Optional[float] = None, matrix: AdjustedMatrix = None,
statefile: Optional[str] = None, statefile: Optional[str] = None,
realtime_interval: int = 600, realtime_interval: int = 600,
update_limit: int = 10,
): ):
"""Run Adjusted algorithm. """Run Adjusted algorithm.
...@@ -28,25 +31,26 @@ def adjusted( ...@@ -28,25 +31,26 @@ def adjusted(
---------- ----------
observatory: observatory to calculate observatory: observatory to calculate
input_factory: where to read, should be configured with data_type input_factory: where to read, should be configured with data_type
input_channels: adjusted algorithm input channels
interval: data interval interval: data interval
output_factory: where to write, should be configured with data_type output_factory: where to write, should be configured with data_type
output_channels: adjusted algorithm output channels
matrix: adjusted matrix matrix: adjusted matrix
pier_correction: adjusted pier correction
statefile: adjusted statefile statefile: adjusted statefile
realtime_interval: window in seconds realtime_interval: window in seconds
update_limit: maximum number of windows to backfill
Uses update_limit=10.
""" """
if not statefile and (not matrix or not pier_correction): if not statefile and not matrix:
raise ValueError("Either statefile or matrix and pier_correction are required.") raise ValueError("Either statefile or matrix are required.")
starttime, endtime = get_realtime_interval(realtime_interval) starttime, endtime = get_realtime_interval(realtime_interval)
controller = Controller( controller = Controller(
algorithm=AdjustedAlgorithm( algorithm=AdjustedAlgorithm(
matrix=matrix, matrix=matrix,
pier_correction=pier_correction,
statefile=statefile, statefile=statefile,
data_type="adjusted", data_type="adjusted",
location="A0", location="A0",
inchannels=input_channels,
outchannels=output_channels,
), ),
inputFactory=input_factory or get_edge_factory(data_type="variation"), inputFactory=input_factory or get_edge_factory(data_type="variation"),
inputInterval=interval, inputInterval=interval,
...@@ -58,10 +62,10 @@ def adjusted( ...@@ -58,10 +62,10 @@ def adjusted(
output_observatory=(observatory,), output_observatory=(observatory,),
starttime=starttime, starttime=starttime,
endtime=endtime, endtime=endtime,
input_channels=("H", "E", "Z", "F"), input_channels=input_channels,
output_channels=("X", "Y", "Z", "F"), output_channels=output_channels,
realtime=realtime_interval, realtime=realtime_interval,
update_limit=10, update_limit=update_limit,
) )
......
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