EngdbDirect¶
- class jwst.lib.engdb_direct.EngdbDirect(base_url=None, default_format='dict', **service_kwargs)[source]¶
Bases:
EngdbABC
Access the JWST Engineering Database through direct connection
- Parameters:
base_url (str) – The base url for the engineering RESTful service
default_format (str) – The format the results of the data should be returned from the service. If ‘dict’, the result will be in Python dict format.
service_kwargs (dict) – Service-specific keyword arguments that are not relevant to this implementation of EngdbABC.
Attributes Summary
The base URL for the engineering service.
The format the results of the data should be returned from the service.
The end time of the last query.
The results of the last query.
The start time of the last query.
Methods Summary
configure
([base_url])Configure from parameters and environment
get_meta
([mnemonic, result_format])Get the mnemonics meta info
get_values
(mnemonic, starttime, endtime[, ...])Retrieve all results for a mnemonic in the requested time range.
Setup HTTP session
Attributes Documentation
- base_url = None¶
The base URL for the engineering service.
- default_format¶
The format the results of the data should be returned from the service.
- endtime = None¶
The end time of the last query.
- response = None¶
The results of the last query.
- starttime = None¶
The start time of the last query.
Methods Documentation
- configure(base_url=None)[source]¶
Configure from parameters and environment
- Parameters:
base_url (str) – The base url for the engineering RESTful service
- get_meta(mnemonic='', result_format=None)[source]¶
Get the mnemonics meta info
- Parameters:
mnemonic (str) – The engineering mnemonic to retrieve
result_format (str) – The format to request from the service. If None, the
default_format
is used.
- 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_results
for 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
True
andinclude_obstime
isTrue
, 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_obstime
andzip_results
for modifications.- Return type:
[value, …] or [(obstime, value), …] or ([obstime,…], [value, …])
- Raises:
requests.exceptions.HTTPError – Either a bad URL or non-existant mnemonic.