NircamMosaic

class wss_tools.utils.mosaic.NircamMosaic(data_ext=('SCI', 1), sw_sca_size=100)[source]

Bases: object

Class to handle NIRCAM mosaic.

Based on IDL script and its accompanying document at https://confluence.stsci.edu/display/JWST/FPA+mosaic . However, V3 is upside-down in that document, so actual detector layout follows https://jwst-docs.stsci.edu/near-infrared-camera/nircam-apt-templates/nircam-imaging-apt-template .

Note

Currently does not support WCS.

Parameters
data_extint, tuple, or str

Extension, as acceptable by astropy.io.fits.getdata(), of data to be mosaicked.

sw_sca_sizeint

Output size of a single SCA in the SHORT channel in the mosaic. SCA of LONG channel will be automatically resized to twice this value.

Examples

>>> images = ['myimage1.fits', 'myimage2.fits', ...]
>>> my_mosaic = NircamMosaic()
>>> mosaiclist = my_mosaic.make_mosaic(images)

Attributes Summary

lw_zoom_factor

Zoom factor for LONG SCA.

module_gap

Output size of gap between modules and channels in the mosaic.

sca_gap

Output size of gap between SCA detectors in the mosaic.

sw_sca_size

Output size of a single SCA in the SHORT channel in the mosaic.

sw_zoom_factor

Zoom factor for SHORT SCA.

Methods Summary

get_single_mosaic_array(images)

Construct mosaic from images that belong to the same dataset.

make_mosaic(images[, outpath, outsuffix, ...])

Construct one mosaic for each dataset, for multiple datasets.

Attributes Documentation

lw_zoom_factor

Zoom factor for LONG SCA.

module_gap

Output size of gap between modules and channels in the mosaic.

sca_gap

Output size of gap between SCA detectors in the mosaic.

sw_sca_size

Output size of a single SCA in the SHORT channel in the mosaic. SCA of LONG channel will be automatically resized to about twice this value.

sw_zoom_factor

Zoom factor for SHORT SCA.

Methods Documentation

get_single_mosaic_array(images)[source]

Construct mosaic from images that belong to the same dataset.

Parameters
imageslist

List of filenames from the same dataset.

Returns
mosaicndarray

Mosaic image.

make_mosaic(images, outpath='', outsuffix='mosaic', clobber=False, debug=False)[source]

Construct one mosaic for each dataset, for multiple datasets.

Images are sorted into datasets by JWST naming convention, jw<PPPPP><OOO><VVV>_<GGSAA>_<EEEEE>_<detector>_<suffix>.fits, where the ROOTNAME is defined as jw<PPPPP><OOO><VVV>_<GGSAA>_<EEEEE>. Each mosaic is saved as ROOTNAME_<outsuffix>.fits, a single-extension FITS image.

Parameters
imageslist

List of filenames.

outpathstr

Output directory. If not given, it is the current working directory.

outsuffixstr

Output suffix.

clobberbool

If True, overwrite existing mosaic file(s).

debugbool

If True, print extra information to screen.

Returns
mosaiclistlist

List of mosaic filenames.