create_masks_from_segmap¶
- mpdaf.sdetect.create_masks_from_segmap(segmap, catalog, ref_image, n_jobs=1, skip_existing=True, masksky_name='mask-sky.fits', maskobj_name='mask-source-%05d.fits', idname='ID', raname='RA', decname='DEC', margin=0, mask_size=(20, 20), convolve_fwhm=0, psf_threshold=0.5, verbose=0)[source]¶
Create binary masks from a segmentation map.
For each source from the catalog, extract the segmap region, align with ref_image and regrid to the resolution of ref_image.
- Parameters:
- segmap
str
ormpdaf.obj.Image
The segmentation map.
- catalog
str
ormpdaf.sdetect.Catalog
orastropy.table.Table
The catalog with sources id and position.
- ref_image
str
ormpdaf.obj.Image
The reference image, with which the segmap is aligned.
- n_jobs
int
Number of parallel processes (for joblib).
- skip_existingbool
If True, skip sources for which the mask file exists.
- masksky_name
str
orcallable()
The filename for the sky mask.
- maskobj_name
str
orcallable()
The filename for the source masks, with a format string that will be substituted with the ID, e.g.
%05d
.- idname, raname, decname
str
Name of the ‘id’, ‘ra’ and ‘dec’ columns.
- margin
float
Margin used for the segmap alignment (pixels).
- mask_size
tuple
Size of the source masks (arcsec).
- convolve_fwhm
float
FWHM for the PSF convolution (arcsec).
- psf_threshold
float
Threshold applied to the PSF to get a binary image.
- verbose: int
Verbosity level for joblib.Parallel.
- segmap