Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Support remote access for TDB state codes #263

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading