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:
- base_urlstr
The base url for the engineering RESTful service.
- **service_kwargsdict
Service-specific keyword arguments. Refer to the concrete implementations of EngdbABC.
Attributes Summary
The URL of the service in use.
The endtime of the search.
The
requests.Response
information.The 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
- abstractmethod get_meta(mnemonic='', **service_kwargs)[source]
Get the mnemonics meta info.
- Parameters:
- mnemonicstr
The engineering mnemonic to retrieve.
- Returns:
- metaobject
The meta information. Type of return is dependent on the type of service.
- service_kwargsdict
Service-specific keyword arguments. Refer to the concrete implementations of EngdbABC.
- abstractmethod 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:
- mnemonicstr
The engineering mnemonic to retrieve.
- starttimestr or
astropy.time.Time
The, inclusive, start time to retrieve from.
- endtimestr or
astropy.time.Time
The, inclusive, end time to retrieve from.
- time_formatstr
The format of the input time used if the input times are strings. If None, a guess is made.
- include_obstimebool
If
True
, the return values will include observation time asastropy.time.Time
. Seezip_results
for further details.- include_bracket_valuesbool
The DB service, by default, returns the bracketing values outside of the requested time. If
True
, include these values.- zip_resultsbool
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[value, …] or [(obstime, value), …] or ([obstime,…], [value, …])
Returns the list of values. See
include_obstime
andzip_results
for modifications.
- Raises:
- requests.exceptions.HTTPError
Either a bad URL or non-existent mnemonic.