cwitools.imaging.get_cutout

cwitools.imaging.get_cutout(fits_in, ra, dec, box_size, z=0, fill=0)

Extract a box (in pkpc) around a central position from a 2D or 3D FITS.

Args:

fits_in (astropy.io.fits.HDUList): The input FITS file. ra (float): Right-ascension of box center, in decimal degrees. dec (float): Declination of box center, in decimal degrees. z (float): Cosmological redshift of the source. box_size (float): The size of the box, in proper kiloparsec. fill (string): The fill value for box regions outside the image bounds.

Default: 0.
Returns:
astropy.io.fits.HDUList: The FITS with cutout data and header.

Examples:

To extract a 2D region of size 250x250 pkpc^2 around the QSO from a pseudo-Narrowband image:

>>> from cwitools import imaging
>>> from cwitools import parameters
>>> from astropy.io import fits
>>> qso_nb_fits = fits.open("QSO_123.fits")
>>> target_params = parameters.load_params("QSO_123.param")
>>> qso_cutout = imaging.get_cutout(qso_nb_fits, target_params, 250)

This method assumes a 1:1 aspect ratio for the spatial axes of the input.