Skip to content

Commit

Permalink
Support remote access for TDB state codes
Browse files Browse the repository at this point in the history
  • Loading branch information
taldcroft committed Sep 5, 2024
1 parent 5e546ef commit 7341f11
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions cheta/fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,13 @@ def _get_start_stop_dates(times):
all_msid_names_files[str(ft["content"])] = _split_path(msid_files["colnames"].abs)


@local_or_remote_function("Get TDB entry for MSID from Ska eng archive server...")
def get_tdb(msid):
import ska_tdb

return ska_tdb.msids[msid]


# Function to load MSID names from the files (executed remotely, if necessary)
@local_or_remote_function("Loading MSID names from Ska eng archive server...")
def load_msid_names(all_msid_names_files):
Expand Down Expand Up @@ -980,10 +987,9 @@ def state_codes(self):
self._state_codes = STATE_CODES[self.MSID]

if not hasattr(self, "_state_codes"):
import Ska.tdb

try:
states = Ska.tdb.msids[self.MSID].Tsc
tdb_msid = get_tdb(self.MSID)
states = tdb_msid.Tsc
except Exception:
self._state_codes = None
else:
Expand Down Expand Up @@ -1025,9 +1031,7 @@ def raw_vals(self):
@property
def tdb(self):
"""Access the Telemetry database entries for this MSID"""
import Ska.tdb

return Ska.tdb.msids[self.MSID]
return get_tdb(self.MSID)

def interpolate(self, dt=None, start=None, stop=None, times=None):
"""Perform nearest-neighbor interpolation of the MSID to the specified
Expand Down

0 comments on commit 7341f11

Please sign in to comment.