jwst.lib.set_telescope_pointing.add_wcs(filename, allow_any_file=False, force_level1bmodel=False, default_pa_v3=0.0, siaf_path=None, engdb_url=None, fgsid=None, tolerance=60, allow_default=False, reduce_func=None, dry_run=False, save_transforms=None, **transform_kwargs)[source]

Add WCS information to a JWST DataModel.

Telescope orientation is attempted to be obtained from the engineering database. Failing that, a default pointing is used based on proposal target.

The file is updated in-place.

  • filename (str) – The path to a data file.

  • allow_any_file (bool) – Attempt to add the WCS information to any type of file. The default, False, only allows modifications of files that contain known datamodels of Level1bmodel, ImageModel, or CubeModel.

  • force_level1bmodel (bool) – If not allow_any_file, and the input file model is unknown, open the input file as a Level1bModel regardless.

  • default_pa_v3 (float) – The V3 position angle to use if the pointing information is not found.

  • siaf_path (str or file-like object or None) – The path to the SIAF database. See SiafDb for more information.

  • engdb_url (str or None) – URL of the engineering telemetry database REST interface.

  • fgsid (int or None) – When in COARSE mode, the FGS to use as the guider reference. If None, use what is provided in telemetry.

  • tolerance (int) – If no telemetry can be found during the observation, the time, in seconds, beyond the observation time to search for telemetry.

  • allow_default (bool) – If telemetry cannot be determine, use existing information in the observation’s header.

  • reduce_func (func or None) – Reduction function to use on values.

  • dry_run (bool) – Do not write out the modified file.

  • save_transforms (Path-like or None) – File to save the calculated transforms to.

  • transform_kwargs (dict) – Keyword arguments used by matrix calculation routines.


This function adds absolute pointing information to the JWST datamodels provided. By default, only Stage 1 and Stage 2a exposures are allowed to be updated. These have the suffixes of “uncal”, “rate”, and “rateints” representing datamodels Level1bModel, ImageModel, and CubeModel. Any higher level product, from Stage 2b and beyond, that has had the assign_wcs step applied, have improved WCS information. Running this task on such files will potentially corrupt the WCS.

It starts by populating the headers with values from the SIAF database. It adds the following keywords to all files:

V2_REF (arcseconds) V3_REF (arcseconds) VPARITY (+1 or -1) V3I_YANG (decimal degrees)

The keywords computed and added to all files are:


In addition the following keywords are computed and added to IMAGING_MODES only:

CRVAL1 CRVAL2 PC1_1 PC1_2 PC2_1 PC2_2

It does not currently place the new keywords in any particular location in the header other than what is required by the standard.