Photometric data reduction
Example
In this example we will reduce the data of a single eclipse obtained with JWST/MIRI imaging (F1500W) from a public program.
After git clone the repository,
Go to /example/gj3929b. The uncal folder contains a shell script to download the necessary data files.
cd example/gj3929b/uncal
sh MAST_download.sh
The download will take a minute. After it is done, you will see five _uncal.fits inside /uncal.
Now let’s go back to /example/gj3929b.
cd ..
And create a new directory called reduced to store the reduced data.
mkdir reduced
cd reduced
Before running the pipeline, make sure ../sparta/constants.py has all the necessary constants defined.
And now let’s start reducing the data. Step one is to run the calibration pipeline:
python ../../../calibrate.py ../uncal/jw*fits
This will create rateints*.fits in the output directory.
The SCI extension contains either DN per slope or electron number per slope depending on whether the gain scale step is applied.
When the script is running, steps performed are printed to your terminal, and diagnostic plots are also generated for the emicorr step.
Now let’s make a new directory to save plots:
mkdir img
python ../../../ap_extract.py -f ./rateints*
to do classic aperture photometry to extract the light curve.
Before running ap_extract.py, make sure to update the following parameters:
apsize_listAperture radius for photometric extraction.annulus_r_in_listInner radius of the sky background annulus.annulus_r_out_listOuter radius of the sky background annulus.
If your data were obtained in full-array mode, you may want to crop the image to remove other illuminated regions. This can be done by setting:
X_WINDOWX-axis cropping window for the region of interest.Y_WINDOWY-axis cropping window for the region of interest.
This step generates light curves and saves them to a machine-readable CSV file:
CSV filename:
ap_extract_ap{ap_size}_in{annulus_r_in}_out{annulus_r_out}.csvLight-curve plot: The light curve is also plotted and saved to:
./img/ap{ap_size}_in{annulus_r_in}_out{annulus_r_out}_lightcurve.png
For the subsequent light curve fitting, please go to Photometry