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, or MosaicModel) – Path to an ASDF file, or an ImageModel or MosaicModel.

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

class_alias

reference_file_types

spec

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 of return_updated_model. If return_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 or MosaicModel) – 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, or datamodels.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, or SourceCatalog