EngdbABC¶
- class jwst.lib.engdb_lib.EngdbABC(base_url=None, **service_kwargs)[source]¶
Bases:
ABC
Access the JWST Engineering Database
This is the minimal API for the service definition. Concrete implementations may provide other parameters and attributes.
- Parameters:
Attributes Summary
The URL of the service in use
The endtime of the search
The
requests.Response
informationThe start time of the search
Methods Summary
get_meta
([mnemonic])Get the mnemonics meta info
get_values
(mnemonic, starttime, endtime[, ...])Retrieve all results for a mnemonic in the requested time range.
Attributes Documentation
- base_url¶
The URL of the service in use
- endtime¶
The endtime of the search
- response¶
The
requests.Response
information
- starttime¶
The start time of the search
Methods Documentation
- abstract get_meta(mnemonic='', **service_kwargs)[source]¶
Get the mnemonics meta info
- Parameters:
mnemonic (str) – The engineering mnemonic to retrieve
- Returns:
meta (object) – The meta information. Type of return is dependent on the type of service
service_kwargs (dict) – Service-specific keyword arguments. Refer to the concrete implementations of EngdbABC.
- abstract 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.