Skip to content

Commit

Permalink
adding update_pure_parallel_wcs
Browse files Browse the repository at this point in the history
  • Loading branch information
goudfroo committed Sep 3, 2024
1 parent 8c46ac2 commit ae89489
Show file tree
Hide file tree
Showing 3 changed files with 510 additions and 0 deletions.

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions notebooks/cross_instrument/update_pure_parallel_wcs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Pure_Parallels

A Python script that can be used to correct the WCS of pure parallel exposures.

## Available Scripts

### `update_parallel_wcs.py`

Update CRVAL1 and CRVAL2 header keywords (which indicate the sky coordinates (RA and Dec) of the reference pixel) of Pure Parallel data.

Run as follows:
```
python update_parallel_wcs.py fitsfile <verbosity>
```
where `fitsfile` is the input FITS file. The typical file that is input to this script is a file that was run through Stage 1 of the JWST calibration pipeline, i.e., a `_rate.fits` or `_rateints.fits` file. After the script has been run on the input file(s), one can then (re-)run Stage 2 of the JWST calibration pipeline (`calwebb_image2` and/or `calwebb_spec2`) on those files, which will now result in correct WCSes in the data headers (and corrected locations of spectral extractions in case of pure parallel WFSS data).

By default, `update_parallel_wcs.py` displays the input and output values of the CRVAL1/2 keywords when the script is run. One can avoid this by setting the optional parameter <verbosity> to anything other than `True`.

The script keeps track of its executions using a log file called "pure_parallel_wcs_logfile" in the current directory.


## Dependencies

The script mentioned above has external dependencies. It requires the packages astropy, mastquery, numpy, and pysiaf to be installed. The script assumes that an environment with the packages mentioned above has been installed on your machine and that you have loaded into that environment.

## Notebooks

### `NIRISS_correct_pure_parallel_WCS.ipynb`

This notebook illustrates the impact of the use of the `update_parallel_wcs.py` script.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
numpy>=1.25.2
astropy>=5.3.4
jwst>=1.15.1
matplotlib>=3.8.0
pysiaf>=0.22.0
mastquery>=1.7.1
astroquery>=0.4.6

0 comments on commit ae89489

Please sign in to comment.