EngdbMast
- class romancal.lib.engdb.engdb_mast.EngdbMast(eng_base_url=None, data_uri=None, meta_uri=None, token=None, rsdp_auth=False, check_aliveness=True, **service_kwargs)[source]
Bases:
EngdbABCAccess the Roman Engineering Database through MAST.
- Parameters:
eng_base_url (str) – The base url for the engineering RESTful service. If not defined, the environmental variable ENG_BASE_URL is queried. Otherwise the default MAST website is used.
data_uri (str or None) – The URI component required to retrieve the engineering data. This is concatenated to the
eng_base_url. If not defined, the environment variable ENG_DATA_URI is queried. Otherwise, the default data URI is used.meta_uri (str or None) – The URI component required to retrieve the engineering metadata. This is concatenated to the
eng_base_url. If not defined, the environment variable ENG_META_URI is queried. Otherwise, the default metadata URI is used.token (str or None) – The MAST access token. If not defined, the environmental variable MAST_API_TOKEN is queried. For ground operational processing, MAST_AUTH_TOKEN is also queried. For more information, see https://auth.mast.stsci.edu/
rsdp_auth (bool) – True to use RSDP authentication.
check_aliveness (boolean) – Check if the service is actually reachable.
**service_kwargs (dict) – Service-specific keyword arguments that are not relevant to this implementation of EngdbABC.
- Raises:
RuntimeError – Any and all failures with connecting with the MAST server.
Attributes Summary
DATA endpoint URI
The end time of the last query.
The base URL for the engineering service.
METADATA endpoint URI
The results of the last query.
Number of retries to attempt to contact the service
Use RSDP authentication
The start time of the last query.
Network timeout when communicating with the service
MAST Token
Methods Summary
get_meta([search])Get the mnemonics meta info.
get_values(mnemonic, starttime, endtime[, ...])Retrieve all results for a mnemonic in the requested time range.
isalive()Check that the database is reachable
Attributes Documentation
- data_uri = None
DATA endpoint URI
- endtime = None
The end time of the last query.
- eng_base_url = None
The base URL for the engineering service.
- meta_uri = None
METADATA endpoint URI
- response = None
The results of the last query.
- retries = 1
Number of retries to attempt to contact the service
- rsdp_auth = False
Use RSDP authentication
- starttime = None
The start time of the last query.
- timeout = 30
Network timeout when communicating with the service
- token = None
MAST Token
Methods Documentation
- get_meta(search=None)[source]
Get the mnemonics meta info.
- Parameters:
search (str or None) – A partial, or full, mnemonic specification. If None, meta for all available mnemonics are returned
- Returns:
meta – The meta information. The primary keys are “Count” and “TlmMnemonics”. The count is the number of mnemonics returned and TlmMnemonics is a list of dicts containing information for each mnemonic.
- Return type:
dict
- get_values(mnemonic, starttime, endtime, time_format=None, include_obstime=False, include_bracket_values=False, zip_results=True)[source]
Retrieve all results for a mnemonic in the requested time range.
- Parameters:
mnemonic (str) – The engineering mnemonic to retrieve
starttime (str or
astropy.time.Time) – The, inclusive, start time to retrieve from.endtime (str or
astropy.time.Time) – The, inclusive, end time to retrieve from.time_format (str) – The format of the input time used if the input times are strings. If None, a guess is made.
include_obstime (bool) – If
True, the return values will include observation time asastropy.time.Time. Seezip_resultsfor further details.include_bracket_values (bool) – The DB service, by default, returns the bracketing values outside of the requested time. If
True, include these values.zip_results (bool) – If
Trueandinclude_obstimeisTrue, the return values will be a list of 2-tuples. If false, the return will be a single 2-tuple, where each element is a list.
- Returns:
values – Returns the list of values. See
include_obstimeandzipfor modifications.- Return type:
[value, …] or [(obstime, value), …] or ([obstime,…], [value, …])