ism3d.xyhelper.maskmoment.momfuncs.dilmsk¶
-
ism3d.xyhelper.maskmoment.momfuncs.
dilmsk
(snrcube, header=None, snr_hi=4, snr_lo=2, minbeam=1, snr_hi_minch=1, snr_lo_minch=1, min_tot_ch=2, nguard=[0, 0], debug=False)[source]¶ Dilate a mask from one specified threshold to another.
- Parameters
snrcube (SpectralCube or ~numpy.ndarray) – The image cube normalized by the estimated RMS noise. If a numpy array is provided the header must also be provided.
header (astropy.io.fits.Header) – The cube FITS header, required if a numpy array is given.
snr_hi (float, optional) – The high significance threshold from which to begin the mask dilation. Default: 4
snr_lo (float, optional) – The low significance threshold at which to end the mask dilation. Default: 2
minbeam (float, optional) – Minimum velocity-integrated area of a mask region in units of the beam size. Default: 1
snr_hi_minch (int, optional) – High significance mask is required to span at least this many channels at all pixels. Default: 1
snr_lo_minch (int, optional) – Low significance mask is required to span at least this many channels at all pixels. Default: 1
min_tot_ch (int, optional) – Dilated mask regions are required to span at least this many channels. Default: 2
nguard (tuple of two ints, optional) – Expand the final mask by this nguard[0] pixels in sky directions and nguard[1] channels in velocity. Currently these values must be equal if both are non-zero. If nguard[0] = 0 then no expansion is done in sky coordinates. If nguard[1] = 0 then no expansion is done in velocity. Default: [0,0]
debug (boolean, optional) – Output a bunch of FITS files to diagnose what’s going on. Default: False
- Returns
dil_mask – A binary mask array (0s and 1s) which can be applied to a cube
- Return type
~numpy.ndarray