Extraction Module (cwitools.extraction)¶
The extraction module contains functions focused on isolating a 3D signal (e.g. a nebular emission region) within a data cube. The first part of the extraction process typically involves modeling and subtracting continuum sources, removing slowly-varying background signals, and masking foreground sources or other regions as needed. When the cube only contains the desired signal, a segmentation process can be used to identify the 3D contours of the emitting region and extract it for further analysis.
Tools for extracting extended emission from a cube.
Functions
apply_mask (data, mask[, fill]) |
Apply a binary or label mask to data. |
bg_sub (inputfits[, method, poly_k, …]) |
Subtracts extended continuum emission / scattered light from a cube |
cutout (fits_in, pos, box_size[, redshift, …]) |
Extract a spatial box around a central position from 2D or 3D data. |
detect_lines (obj_fits[, lines, redshift, vwidth]) |
Associate detected 3D objects with known emission lines. |
obj2binary (obj_mask, obj_id) |
Get a binary mask of specific objects in a labelled object mask. |
psf_sub (inputfits, pos[, r_fit, r_sub, …]) |
Models and subtracts a single point-source in a 3D data cube. |
psf_sub_all (inputfits[, r_fit, r_sub, reg, …]) |
Models and subtracts multiple point-sources in a 3D data cube. |
reg2mask (fits_in, reg) |
Convert a DS9 region file into a 2D binary mask of sources. |
segment (fits_in, var[, snrmin, includes, …]) |
Segment cube into 3D regions above a threshold. |
smooth_cube_spatial (data, scale[, ktype, var]) |
Smooth 3D data spatially by a specified 2D kernel. |
smooth_cube_wavelength (data, scale[, ktype, var]) |
Smooth 3D data spatially by a specified 2D kernel. |
smooth_nd (data, scale[, axes, ktype, var]) |
Smooth along all/any axes of a data cube with a box or gaussian kernel. |