SourceCatalogStep¶
- class romancal.source_catalog.SourceCatalogStep(name=None, parent=None, config_file=None, _validate_kwds=True, **kws)[source]¶
Bases:
RomanStep
Create a catalog of sources including photometry and basic shape measurements.
- Parameters:
input (str,
ImageModel
, orMosaicModel
) – Path to an ASDF file, or anImageModel
orMosaicModel
.
Create a
Step
instance.- Parameters:
name (str, optional) – The name of the Step instance. Used in logging messages and in cache filenames. If not provided, one will be generated based on the class name.
parent (Step instance, optional) – The parent step of this step. Used to determine a fully-qualified name for this step, and to determine the mode in which to run this step.
config_file (str or pathlib.Path, optional) – The path to the config file that this step was initialized with. Use to determine relative path names of other config files.
**kws (dict) – Additional parameters to set. These will be set as member variables on the new Step instance.
Attributes Summary
Methods Summary
process
(step_input)This is where real work happens.
save_all_results
(model, segment_img, cat_model)Return and save the results of the source catalog step.
Attributes Documentation
- class_alias = 'source_catalog'¶
- reference_file_types: ClassVar = []¶
- spec¶
bkg_boxsize = integer(default=1000) # background mesh box size in pixels kernel_fwhm = float(default=2.0) # Gaussian kernel FWHM in pixels snr_threshold = float(default=3.0) # per-pixel SNR threshold above the bkg npixels = integer(default=25) # min number of pixels in source deblend = boolean(default=False) # deblend sources? suffix = string(default='cat') # Default suffix for output files fit_psf = boolean(default=True) # fit source PSFs for accurate astrometry? forced_segmentation = string(default='') # force the use of this segmentation map
Methods Documentation
- process(step_input)[source]¶
This is where real work happens. Every Step subclass has to override this method. The default behaviour is to raise a NotImplementedError exception.
- save_all_results(model, segment_img, cat_model)[source]¶
Return and save the results of the source catalog step.
The segmentation image is always saved.
If
save_results
is True, then either the input model with updated metadata or the source catalog model is saved/returned depending on the value ofreturn_updated_model
. Ifreturn_updated_model
is True, then the input model is saved/returned with updated metadata. If False, then the source catalog model is saved/returned.The source catalog is saved as a parquet file.
- Parameters:
model (
ImageModel
orMosaicModel
) – The input model to the source catalog step.segment_img (
photutils.segmentation.SegmentationImage
) – The segmentation image created by the source catalog step.cat_model (
datamodels.ImageSourceCatalogModel
,datamodels.MosaicSourceCatalogModel
,datamodels.ForcedImageSourceCatalogModel
, ordatamodels.ForcedMosaicSourceCatalogModel
) – The source catalog model created by the source catalog step.
- Returns:
result – The source catalog model or the input model with updated metadata.
- Return type:
ImageModel
,MosaicModel
, orSourceCatalog