NOTE: This package is now heavily outdated and rely on out-of-date packages. There is a new package available for the distortion calibration here: https://github.com/tonysohn/JWST-Distortion-Calibration
This repository contains codes and scripts that can be used for performing the Geometric Distortion Correction and the FGS-SI Alignment Calibration for JWST imaging detectors. Currently supported detectors are FGS, NIRCam, and NIRISS. Support for NIRSpec and MIRI may be included in a future version.
This package has some external dependencies and requires anaconda to be pre-installed. Assuming anaconda is installed in your system, follow the instructions below.
-
Clone the
jwst_fparepository:git clone https://github.com/tonysohn/jwst_fpa.git -
Create a dedicated environment name
fpawith the necessary dependencies:conda env create -f jwst_fpa/environment.yml -n fpa -
Activate the new environment:
conda activate fpa -
All necessary packages should have been installed, and the scripts should be ready to be run. However, importing
pysiafmay result in error in some cases. A quick and easy fix is to simply uninstall and reinstalllxmlas follows:pip uninstall lxmlpip install lxml
There are two main scripts and several supplemental codes/scripts included in this package. Below are quick descriptions for how to run the two main scripts.
jwst_distortion.py- This script determines the geometric distortion solution for the JWST imaging detectors. The only essential configuration parameters required would be the data directory and whether the PSF is a nominal one or commissioning version (for OTE programs only, i.e., right after global alignment). Once thedata_dirpoints to where the_cal.fitsfiles are, open anipythonsession and run the script:run jwst_distortionjwst_fpa.py- This is the script for the focal plane alignment workflow. This script has a separate configuration file namedjwst_fpa_config.py. All configurations including the data directory should be specified in this file. Once the configuration file is ready, open anipythonsession and run the script:run jwst_fpa