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

Merge branch 'remove-derived-methods' into 'master'

removed unused methods from derived module

See merge request !125
parents 7ee8e2b1 15655dd7
No related branches found
No related tags found
2 merge requests!146Release CMO metadata to production,!125removed unused methods from derived module
Pipeline #67422 passed
......@@ -4,20 +4,18 @@ Note that these implementations are subject to change,
and should be considered less stable than other packages in the library.
"""
from .factory import get_edge_factory, get_miniseed_factory
from .observatory import adjusted, average, deltaf, rotate, sqdist_minute
from .derived import adjusted, average, sqdist_minute
from .obsrio import obsrio_minute, obsrio_second, obsrio_temperatures, obsrio_tenhertz
__all__ = [
"adjusted",
"average",
"deltaf",
"get_edge_factory",
"get_miniseed_factory",
"obsrio_minute",
"obsrio_second",
"obsrio_temperatures",
"obsrio_tenhertz",
"rotate",
"sqdist_minute",
]
......@@ -5,9 +5,7 @@ import numpy
from ..algorithm import (
AdjustedAlgorithm,
AverageAlgorithm,
DeltaFAlgorithm,
SqDistAlgorithm,
XYZAlgorithm,
)
from ..Controller import Controller, get_realtime_interval
from ..TimeseriesFactory import TimeseriesFactory
......@@ -111,88 +109,6 @@ def average(
)
def deltaf(
observatory: str,
input_factory: Optional[TimeseriesFactory] = None,
interval: str = "second",
output_factory: Optional[TimeseriesFactory] = None,
deltaf_from="obs",
realtime_interval: int = 600,
):
"""Run Delta-F algorithm.
Parameters
----------
observatory: observatory to calculate
input_factory: where to read, should be configured with data_type and interval
output_factory: where to write, should be configured with data_type and interval
deltaf_from: one of {"obs", "mag", "geo"}
realtime_interval: window in seconds
Uses update_limit=10.
"""
starttime, endtime = get_realtime_interval(realtime_interval)
controller = Controller(
algorithm=DeltaFAlgorithm(informat=deltaf_from),
inputFactory=input_factory or get_edge_factory(),
inputInterval=interval,
outputFactory=output_factory or get_edge_factory(),
outputInterval=interval,
)
controller.run_as_update(
observatory=(observatory,),
output_observatory=(observatory,),
starttime=starttime,
endtime=endtime,
output_channels=("G",),
realtime=realtime_interval,
update_limit=10,
)
def rotate(
observatory: str,
input_factory: Optional[TimeseriesFactory] = None,
interval: str = "second",
output_channels=("X", "Y"),
output_factory: Optional[TimeseriesFactory] = None,
realtime_interval: int = 600,
xyz_from="obs",
xyz_to="geo",
):
"""Run XYZ rotation algorithm.
Parameters
----------
observatory: observatory to calculate
input_factory: where to read, should be configured with data_type and interval
output_channels: which channels to write
output_factory: where to write, should be configured with data_type and interval
realtime_interval: window in seconds
xyz_from: one of {"obs", "mag", "geo"}
xyz_to: one of {"obs", "obsd", "mag", "geo"}
Uses update_limit=10.
"""
starttime, endtime = get_realtime_interval(realtime_interval)
controller = Controller(
algorithm=XYZAlgorithm(informat=xyz_from, outformat=xyz_to),
inputFactory=input_factory or get_edge_factory(),
inputInterval=interval,
outputFactory=output_factory or get_edge_factory(),
outputInterval=interval,
)
controller.run_as_update(
observatory=(observatory,),
output_observatory=(observatory,),
starttime=starttime,
endtime=endtime,
output_channels=output_channels,
realtime=realtime_interval,
update_limit=10,
)
def sqdist_minute(
observatory: str,
statefile: str,
......
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