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_urlstr

The base url for the engineering RESTful service.

default_formatstr

The format the results of the data should be returned from the service. If 'dict', the result will be in Python dictionary format.

**service_kwargsdict

Service-specific keyword arguments that are not relevant to this implementation of EngdbABC.

Attributes Summary

base_url

The base URL for the engineering service.

default_format

The format the results of the data should be returned from the service.

endtime

The end time of the last query.

response

The results of the last query.

starttime

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.

set_session()

Set up 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_urlstr

The base url for the engineering RESTful service.

get_meta(mnemonic='', result_format=None)[source]

Get the mnemonics meta info.

Parameters:
mnemonicstr

The engineering mnemonic to retrieve.

result_formatstr

The format to request from the service. If None, the default_format is used.

Returns:
response_jsondict

Meta info as JSON.

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 as astropy.time.Time. See zip_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 and include_obstime is True, 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 and zip_results for modifications.

Raises:
requests.exceptions.HTTPError

Either a bad URL or non-existent mnemonic.

set_session()[source]

Set up HTTP session.