Please see the current reference for interacting with the JWST Engineering Database: https://outerspace.stsci.edu/display/MASTDOCS/Engineering+Data
Python interface to the JWST DMS Engineering Database
From PyPi:
pip install jwedb
For complete functionality and in particular to retrieve mnemonic values, a valid MAST token has to be provided. Please visit https://auth.mast.stsci.edu/info to generate a token.
One way to store it locally is using .netrc file in the local home directory. If the MAST token is stored in the following format within .netrc, the code below will work:
machine mast login <username> password <token>
Code:
import netrc from astropy.time import Time from jwedb.edb_interface import query_single_mnemonic # get MAST token from the .netrc file in the home directory host = 'mast' secrets = netrc.netrc() mast_token = secrets.authenticators(host)[2] mnemonic_identifier = 'SA_ZFGOUTFOV' start_time = Time(2018.0, format='decimalyear') end_time = Time(2018.1, format='decimalyear') data, meta, info = query_single_mnemonic(mnemonic_identifier, start_time, end_time, token=mast_token) data.pprint()
If you find this package useful, please consider citing the Zenodo record using the DOI badge above.
This project is Copyright (c) Space Telescope Science Institute and licensed under the terms of the Aura license. This package is based upon the Astropy package template which is licensed under the BSD 3-clause licence. See the licenses folder for more information.