check_mast_pointing_header

grizli.pipeline.auto_script.check_mast_pointing_header(file, do_update=True, overwrite=True, output_path=None, check_mast_token=True, **kwargs)[source]

Check ENGQLPTG keyword to see if exposure file needs updated WCS from STScI engineering database.

This function can fix issues with large apparent astrometric offsets as described at https://jwst-docs.stsci.edu/known-issues-with-jwst-data/nircam-known-issues/nircam-imaging-known-issues?utm_source=chatgpt.com#NIRCamImagingKnownIssues-LargeWCSoffsets(arcminutes).

Parameters
filestr

Filename of an uncal.fits or rate.fits file

do_updatebool

Perform the update if needed. If False, just does the check

overwritebool

Overwrite file if updated

output_pathstr, None

If specified, write the updated file to a different path

check_mast_tokenbool

Check that either MAST_TOKEN or MAST_API_TOKEN environment variables are set, required for access to STScI engineering database queries. See https://jwst-pipeline.readthedocs.io/en/stable/jwst/lib/engdb.html#engdb for more information on accessing the engineering database.

Returns
dmjwst.datamodel.DataModel, None

Open datamodel, updated if necessary. If the result was written to a file the datamodel is closed and this function returns dm=None.

visitdict

Metadata from dm.meta.visit

t_pars, transformsNone, None

Output from jwst.lib.set_telescope_pointing.update_wcs if the update was performed.