lsst.pipe.tasks  19.0.0-29-g47457369+2
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
lsst.pipe.tasks.processCcdWithFakes.docstring Class Reference
Inheritance diagram for lsst.pipe.tasks.processCcdWithFakes.docstring:

Public Member Functions

def runDataRef (self, dataRef)
 
def runQuantum (self, butlerQC, inputRefs, outputRefs)
 
def run (self, fakeCat, exposure, wcs=None, photoCalib=None, exposureIdInfo=None, icSourceCat=None)
 
def copyCalibrationFields (self, calibCat, sourceCat)
 

Public Attributes

 calibSourceKey
 

Static Public Attributes

 schema
 
 algMetadata
 

Detailed Description

useUpdatedCalibs = pexConfig.Field(
    doc="Use updated calibs and wcs from jointcal?",
    dtype=bool,
    default=False,
)

coaddName = pexConfig.Field(
    doc="The name of the type of coadd used",
    dtype=str,
    default="deep",
)

calibrationFieldsToCopy = pexConfig.ListField(
    dtype=str,
    default=("calib_psf_candidate", "calib_psf_used", "calib_psf_reserved"),
    doc=("Fields to copy from the icSource catalog to the output catalog "
         "for matching sources Any missing fields will trigger a "
         "RuntimeError exception.")
)

matchRadiusPix = pexConfig.Field(
    dtype=float,
    default=3,
    doc=("Match radius for matching icSourceCat objects to sourceCat objects (pixels)"),
)

insertFakes = pexConfig.ConfigurableField(target=InsertFakesTask,
                                          doc="Configuration for the fake sources")

detection = pexConfig.ConfigurableField(target=SourceDetectionTask,
                                        doc="The detection task to use.")

deblend = pexConfig.ConfigurableField(target=SourceDeblendTask, doc="The deblending task to use.")

measurement = pexConfig.ConfigurableField(target=SingleFrameMeasurementTask,
                                          doc="The measurement task to use")

applyApCorr = pexConfig.ConfigurableField(target=ApplyApCorrTask,
                                          doc="The apply aperture correction task to use.")

catalogCalculation = pexConfig.ConfigurableField(target=CatalogCalculationTask,
                                                 doc="The catalog calculation task to use.")

def setDefaults(self):
    self.detection.reEstimateBackground = False
    super().setDefaults()
    self.measurement.plugins["base_PixelFlags"].masksFpAnywhere.append("FAKE")
    self.measurement.plugins["base_PixelFlags"].masksFpCenter.append("FAKE")


class ProcessCcdWithFakesTask(PipelineTask, CmdLineTask):
_DefaultName = "processCcdWithFakes"
ConfigClass = ProcessCcdWithFakesConfig

def __init__(self, schema=None, butler=None, **kwargs):

Definition at line 191 of file processCcdWithFakes.py.

Member Function Documentation

◆ copyCalibrationFields()

def lsst.pipe.tasks.processCcdWithFakes.docstring.copyCalibrationFields (   self,
  calibCat,
  sourceCat 
)
Match sources in calibCat and sourceCat and copy the specified fields

Parameters
----------
calibCat : `lsst.afw.table.SourceCatalog`
    Catalog from which to copy fields.
sourceCat : `lsst.afw.table.SourceCatalog`
    Catalog to which to copy fields.

Returns
-------
newCat : `lsst.afw.table.SourceCatalog`
    Catalog which includes the copied fields.

The fields copied are those specified by `config.calibrationFieldsToCopy` that actually exist
in the schema of `calibCat`.

This version was based on and adapted from the one in calibrateTask.

Definition at line 334 of file processCcdWithFakes.py.

◆ run()

def lsst.pipe.tasks.processCcdWithFakes.docstring.run (   self,
  fakeCat,
  exposure,
  wcs = None,
  photoCalib = None,
  exposureIdInfo = None,
  icSourceCat = None 
)
Add fake sources to a calexp and then run detection, deblending and measurement.

Parameters
----------
fakeCat : `pandas.core.frame.DataFrame`
    The catalog of fake sources to add to the exposure
exposure : `lsst.afw.image.exposure.exposure.ExposureF`
    The exposure to add the fake sources to
wcs : `lsst.afw.geom.SkyWcs`
    WCS to use to add fake sources
photoCalib : `lsst.afw.image.photoCalib.PhotoCalib`
    Photometric calibration to be used to calibrate the fake sources
exposureIdInfo : `lsst.obs.base.ExposureIdInfo`

Returns
-------
resultStruct : `lsst.pipe.base.struct.Struct`
    contains : outputExposure : `lsst.afw.image.exposure.exposure.ExposureF`
       outputCat : `lsst.afw.table.source.source.SourceCatalog`

Notes
-----
Adds pixel coordinates for each source to the fakeCat and removes objects with bulge or disk half
light radius = 0 (if ``config.cleanCat = True``). These columns are called ``x`` and ``y`` and are in
pixels.

Adds the ``Fake`` mask plane to the exposure which is then set by `addFakeSources` to mark where fake
sources have been added. Uses the information in the ``fakeCat`` to make fake galaxies (using galsim)
and fake stars, using the PSF models from the PSF information for the calexp. These are then added to
the calexp and the calexp with fakes included returned.

The galsim galaxies are made using a double sersic profile, one for the bulge and one for the disk,
this is then convolved with the PSF at that point.

If exposureIdInfo is not provided then the SourceCatalog IDs will not be globally unique.

Definition at line 269 of file processCcdWithFakes.py.

◆ runDataRef()

def lsst.pipe.tasks.processCcdWithFakes.docstring.runDataRef (   self,
  dataRef 
)
Read in/write out the required data products and add fake sources to the calexp.

Parameters
----------
dataRef : `lsst.daf.persistence.butlerSubset.ButlerDataRef`
    Data reference defining the ccd to have fakes added to it.
    Used to access the following data products:
calexp
jointcal_wcs
jointcal_photoCalib

Notes
-----
Uses the calibration and WCS information attached to the calexp for the posistioning and calibration
of the sources unless the config option config.useUpdatedCalibs is set then it uses the
meas_mosaic/jointCal outputs. The config defualts for the column names in the catalog of fakes are
taken from the University of Washington simulations database. Operates on one ccd at a time.

Definition at line 202 of file processCcdWithFakes.py.

◆ runQuantum()

def lsst.pipe.tasks.processCcdWithFakes.docstring.runQuantum (   self,
  butlerQC,
  inputRefs,
  outputRefs 
)

Definition at line 247 of file processCcdWithFakes.py.

Member Data Documentation

◆ algMetadata

lsst.pipe.tasks.processCcdWithFakes.docstring.algMetadata
static

Definition at line 195 of file processCcdWithFakes.py.

◆ calibSourceKey

lsst.pipe.tasks.processCcdWithFakes.docstring.calibSourceKey

Definition at line 375 of file processCcdWithFakes.py.

◆ schema

lsst.pipe.tasks.processCcdWithFakes.docstring.schema
static

Definition at line 192 of file processCcdWithFakes.py.


The documentation for this class was generated from the following file: