lsst.meas.base gdd7ff8183c+802e40e51a
Loading...
Searching...
No Matches
Classes | Variables
lsst.meas.base.forcedPhotCcd Namespace Reference

Classes

class  for
 
class  ForcedPhotCcd
 
class  ForcedPhotCcdConnections
 
class  may
 

Variables

 footprintSource
 
 doApplySkyCorr
 
 doApplyExternalSkyWcs
 
 doApplyExternalPhotoCalib
 
 doApplyFinalizedPsf
 

Variable Documentation

◆ doApplyExternalPhotoCalib

lsst.meas.base.forcedPhotCcd.doApplyExternalPhotoCalib

Definition at line 360 of file forcedPhotCcd.py.

◆ doApplyExternalSkyWcs

lsst.meas.base.forcedPhotCcd.doApplyExternalSkyWcs

Definition at line 356 of file forcedPhotCcd.py.

◆ doApplyFinalizedPsf

lsst.meas.base.forcedPhotCcd.doApplyFinalizedPsf

Definition at line 364 of file forcedPhotCcd.py.

◆ doApplySkyCorr

lsst.meas.base.forcedPhotCcd.doApplySkyCorr
ConfigClass = ForcedPhotCcdConfig
_DefaultName = "forcedPhotCcd"
dataPrefix = ""

def __init__(self, butler=None, refSchema=None, initInputs=None, **kwds):
    super().__init__(**kwds)

    if butler is not None:
        warnings.warn("The 'butler' parameter is no longer used and can be safely removed.",
                      category=FutureWarning, stacklevel=2)
        butler = None

    if initInputs is not None:
        refSchema = initInputs['inputSchema'].schema

    if refSchema is None:
        raise ValueError("No reference schema provided.")

    self.makeSubtask("measurement", refSchema=refSchema)
    # It is necessary to get the schema internal to the forced measurement task until such a time
    # that the schema is not owned by the measurement task, but is passed in by an external caller
    if self.config.doApCorr:
        self.makeSubtask("applyApCorr", schema=self.measurement.schema)
    self.makeSubtask('catalogCalculation', schema=self.measurement.schema)
    self.outputSchema = lsst.afw.table.SourceCatalog(self.measurement.schema)

def runQuantum(self, butlerQC, inputRefs, outputRefs):
    inputs = butlerQC.get(inputRefs)

    tract = butlerQC.quantum.dataId['tract']
    skyMap = inputs.pop('skyMap')
    inputs['refWcs'] = skyMap[tract].getWcs()

    # Connections only exist if they are configured to be used.
    skyCorr = inputs.pop('skyCorr', None)
    if self.config.useGlobalExternalSkyWcs:
        externalSkyWcsCatalog = inputs.pop('externalSkyWcsGlobalCatalog', None)
    else:
        externalSkyWcsCatalog = inputs.pop('externalSkyWcsTractCatalog', None)
    if self.config.useGlobalExternalPhotoCalib:
        externalPhotoCalibCatalog = inputs.pop('externalPhotoCalibGlobalCatalog', None)
    else:
        externalPhotoCalibCatalog = inputs.pop('externalPhotoCalibTractCatalog', None)
    finalizedPsfApCorrCatalog = inputs.pop('finalizedPsfApCorrCatalog', None)

    inputs['exposure'] = self.prepareCalibratedExposure(
        inputs['exposure'],
        skyCorr=skyCorr,
        externalSkyWcsCatalog=externalSkyWcsCatalog,
        externalPhotoCalibCatalog=externalPhotoCalibCatalog,
        finalizedPsfApCorrCatalog=finalizedPsfApCorrCatalog
    )

    inputs['refCat'] = self.mergeAndFilterReferences(inputs['exposure'], inputs['refCat'],
                                                     inputs['refWcs'])

    inputs['measCat'], inputs['exposureId'] = self.generateMeasCat(inputRefs.exposure.dataId,
                                                                   inputs['exposure'],
                                                                   inputs['refCat'], inputs['refWcs'],
                                                                   "visit_detector")
    self.attachFootprints(inputs['measCat'], inputs['refCat'], inputs['exposure'], inputs['refWcs'])
    outputs = self.run(**inputs)
    butlerQC.put(outputs, outputRefs)

def prepareCalibratedExposure(self, exposure, skyCorr=None, externalSkyWcsCatalog=None,
                              externalPhotoCalibCatalog=None, finalizedPsfApCorrCatalog=None):

Definition at line 353 of file forcedPhotCcd.py.

◆ footprintSource

lsst.meas.base.forcedPhotCcd.footprintSource

Definition at line 248 of file forcedPhotCcd.py.