Skip to content
Snippets Groups Projects
Commit 8b041d10 authored by Geels, Brendan Ryan's avatar Geels, Brendan Ryan :tophat:
Browse files

Revert "Rename get_instrument function to be less confusing."

This reverts commit f10f33f3.
parent 2b968a62
No related branches found
No related tags found
1 merge request!308Revert MR 306 except poetry lock change
......@@ -19,7 +19,7 @@ Elements generated by observatories running the Obsrio data acquisition system.
- U, V, W
uses instrument metadata from `geomagio.metadata.instrument.InstrumentCalibrations.get_instrument_calibrations` to convert volt+bin to engineering units.
uses instrument metadata from `geomagio.Metadata.get_instrument` to convert volt+bin to engineering units.
uses `geomagio.algorithm.FilterAlgorithm` to filter from 10Hz to 1Hz.
......
......@@ -20,7 +20,7 @@ from obspy.core import Stats, Stream, Trace, UTCDateTime
from .. import ChannelConverter, TimeseriesUtility
from ..geomag_types import DataInterval, DataType
from ..metadata.instrument.InstrumentCalibrations import get_instrument_calibrations
from ..metadata.instrument.InstrumentCalibrations import get_instrument
from ..TimeseriesFactory import TimeseriesFactory
from ..TimeseriesFactoryException import TimeseriesFactoryException
from ..ObservatoryMetadata import ObservatoryMetadata
......@@ -448,7 +448,7 @@ class MiniSeedFactory(TimeseriesFactory):
to contain just a single Trace.
"""
out = Stream()
metadata = get_instrument_calibrations(observatory, starttime, endtime)
metadata = get_instrument(observatory, starttime, endtime)
# loop in case request spans different configurations
for entry in metadata:
entry_endtime = entry["end_time"]
......
......@@ -296,7 +296,7 @@ class InstrumentCalibrations:
return channels
def get_instrument_calibrations(
def get_instrument(
observatory, start_time=None, end_time=None, calibrations=None, metadata_url=None
):
"""Get instrument metadata
......
from obspy import UTCDateTime
from geomagio.metadata.instrument.InstrumentCalibrations import (
get_instrument_calibrations,
)
from geomagio.metadata.instrument.InstrumentCalibrations import get_instrument
from numpy.testing import assert_equal
......@@ -28,7 +26,7 @@ TEST_METADATA = [METADATA1, METADATA2, METADATA3]
def test_get_instrument_after():
"""Request an interval after the last entry, that has start_time None"""
matches = get_instrument_calibrations(
matches = get_instrument(
"TST",
UTCDateTime("2021-02-02T00:00:00Z"),
UTCDateTime("2022-01-02T00:00:00Z"),
......@@ -39,7 +37,7 @@ def test_get_instrument_after():
def test_get_instrument_before():
"""Request an interval before the first entry, that has start_time None"""
matches = get_instrument_calibrations(
matches = get_instrument(
"TST",
UTCDateTime("2019-02-02T00:00:00Z"),
UTCDateTime("2020-01-02T00:00:00Z"),
......@@ -50,7 +48,7 @@ def test_get_instrument_before():
def test_get_instrument_inside():
"""Request an interval that is wholly contained by one entry"""
matches = get_instrument_calibrations(
matches = get_instrument(
"TST",
UTCDateTime("2020-02-02T01:00:00Z"),
UTCDateTime("2020-02-02T02:00:00Z"),
......@@ -61,7 +59,7 @@ def test_get_instrument_inside():
def test_get_instrument_span():
"""Request a time interval that spans multiple entries"""
matches = get_instrument_calibrations(
matches = get_instrument(
"TST",
UTCDateTime("2020-01-02T00:00:00Z"),
UTCDateTime("2020-02-02T01:00:00Z"),
......@@ -72,7 +70,7 @@ def test_get_instrument_span():
def test_get_instrument_unknown():
"""Request an unknown observatory"""
matches = get_instrument_calibrations(
matches = get_instrument(
"OTHER",
UTCDateTime("2020-01-02T00:00:00Z"),
UTCDateTime("2020-02-02T01:00:00Z"),
......
......@@ -10,9 +10,7 @@ import pytest
from geomagio import TimeseriesUtility
from geomagio.edge import MiniSeedFactory, MiniSeedInputClient
from geomagio.metadata.instrument.InstrumentCalibrations import (
get_instrument_calibrations,
)
from geomagio.metadata.instrument.InstrumentCalibrations import get_instrument
from .mseed_test_clients import MockMiniSeedClient, MisalignedMiniSeedClient
......@@ -46,7 +44,7 @@ def misaligned_miniseed_factory() -> MiniSeedFactory:
@pytest.fixture()
def bou_u_metadata():
metadata = get_instrument_calibrations(observatory="BOU")
metadata = get_instrument(observatory="BOU")
instrument = metadata[0]["instrument"]
channels = instrument["channels"]
yield channels["U"]
......
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