This repository contains notebooks for extracting sources from JWST NIRcam imaging data, performing aperture photometry and isophotal photometry and the source code for the cGAN. Each notebook gives a walk through and detailed explanation of how to use the code provided.
The data is public domain JWST data as part of the CEERS survey, the Cosmic Evolution Early Release Survey (CEERS) data realease 0.5 can be found on the CEERS website here.
Data can be downloaded from the above link.
After downloading the CEERS DR0.5, the images for each filter are opened for inspection. The images are cropped into two regions from Module A of the NIRcam imaging field. This is covered in:
Crop_PSF_Match.ipynb
This is followed by matching the PSF of the images to that of the F444W filter by convolving with pre-calculated kernels that can be downloaded from here.
To prepare the data for the cGAN, source detection and extraction is used on the PSF-matched images. To do this, follow:
Source_Detection_Extraction.ipynb
This will generate files for each waveband with a '.fits' extension containing individual galaxy images. The sources are extracted as 90x90 pixel cutouts ready to load into a Dataset folder for the cGAN.
To use the cGAN, follow:
cGANs_Astro.ipynb
The data fed to the cGAN is loaded from each individual waveband file. An example of file structure is shown below.

The cGAN predicts the long wavelength channel of the objects such that we can extract photometry and reliably construct an SED. Below shows examples of results produced by the network, each with residual images showing the difference between the prediction of the cGAN and the ground truth.
