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_fpa
repository:git clone https://github.com/tonysohn/jwst_fpa.git
-
Create a dedicated environment name
fpa
with 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
pysiaf
may result in error in some cases. A quick and easy fix is to simply uninstall and reinstalllxml
as follows:pip uninstall lxml
pip 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_dir
points to where the_cal.fits
files are, open anipython
session and run the script:run jwst_distortion
jwst_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 anipython
session and run the script:run jwst_fpa