Point-Source Subtraction

cwitools.analysis.psf_subtract(inputfits, rmin=1.5, rmax=5.0, reg=None, pos=None, recenter=True, auto=None, wl_window=200, local_window=0, scalemask=1.0, zmask=(0, 0), zunit='A')

Models and subtracts point-sources in a 3D data cube.

Parameters:
  • inputfits (astrop FITS object) – Input data cube/FITS.
  • rmin (float) – Inner radius, used for fitting PSF.
  • rmax (float) – Outer radius, used to subtract PSF.
  • reg (str) – Path to a DS9 region file containing sources to subtract.
  • pos (float tuple) – (x,y) position of the source to subtract.
  • auto (float) – SNR above which to automatically detect/subtract sources. Note: One of the parameters reg, pos, or auto must be provided.
  • wl_window (int) – Size of white-light window (in Angstrom) to use. This is the window used to form a white-light image centered on each wavelength layer. Default: 200A.
  • local_window (int) – Size of local window (in Angstrom) to use. This is the window used around each wavelength layer to form the local narrowband image. Default: 0 (i.e. single layer only)
  • scalemask (float) – Scaling factor for output PSF mask (Default: 1)
  • zmask (int tuple) – Wavelength region to exclude from white-light images.
  • zunit (str) – Unit of argument zmask. Can be Angstrom (‘A’) or pixels (‘px’). Default: ‘A’.
Returns:

PSF-subtracted data cube numpy.ndarray: PSF model cube numpy.ndarray: 2D mask of sources

Return type:

numpy.ndarray

Raises:

FileNotFoundError – If region file is not found.