lsst.meas.base  22.0.1-15-g63cc0c1+2a7037787d
lsst.meas.base.forcedPhotCcd.ForcedPhotCcd Class Reference
Inheritance diagram for lsst.meas.base.forcedPhotCcd.ForcedPhotCcd:

Detailed Description

return self.measurement.attachTransformedFootprints(sources, refCat, exposure, refWcs)

def getExposure(self, dataRef):
exposure = dataRef.get(self.dataPrefix + "calexp", immediate=True)

if self.config.doApplyExternalPhotoCalib:
    source = f"{self.config.externalPhotoCalibName}_photoCalib"
    self.log.info("Applying external photoCalib from %s", source)
    photoCalib = dataRef.get(source)
    exposure.setPhotoCalib(photoCalib)  # No need for calibrateImage; having the photoCalib suffices

if self.config.doApplyExternalSkyWcs:
    source = f"{self.config.externalSkyWcsName}_wcs"
    self.log.info("Applying external skyWcs from %s", source)
    skyWcs = dataRef.get(source)
    exposure.setWcs(skyWcs)

if self.config.doApplySkyCorr:
    self.log.info("Apply sky correction")
    skyCorr = dataRef.get("skyCorr")
    exposure.maskedImage -= skyCorr.getImage()

return exposure

def writeOutput(self, dataRef, sources):
dataRef.put(sources, self.dataPrefix + "forced_src", flags=lsst.afw.table.SOURCE_IO_NO_FOOTPRINTS)

def getSchemaCatalogs(self):
catalog = lsst.afw.table.SourceCatalog(self.measurement.schema)
catalog.getTable().setMetadata(self.measurement.algMetadata)
datasetType = self.dataPrefix + "forced_src"
return {datasetType: catalog}

def _getConfigName(self):
# Documented in superclass.
return self.dataPrefix + "forcedPhotCcd_config"

def _getMetadataName(self):
# Documented in superclass
return self.dataPrefix + "forcedPhotCcd_metadata"

@classmethod
def _makeArgumentParser(cls):
parser = pipeBase.ArgumentParser(name=cls._DefaultName)
parser.add_id_argument("--id", "forced_src", help="data ID with raw CCD keys [+ tract optionally], "
                       "e.g. --id visit=12345 ccd=1,2 [tract=0]",
                       ContainerClass=PerTractCcdDataIdContainer)
return parser


class ForcedPhotCcdFromDataFrameConnections(PipelineTaskConnections,
                                    dimensions=("instrument", "visit", "detector", "skymap", "tract"),
                                    defaultTemplates={"inputCoaddName": "goodSeeing",
                                                      "inputName": "calexp"}):
refCat = cT.Input(
doc="Catalog of positions at which to force photometry.",
name="{inputCoaddName}Diff_fullDiaObjTable",
storageClass="DataFrame",
dimensions=["skymap", "tract", "patch"],
multiple=True,
deferLoad=True,
)
exposure = cT.Input(
doc="Input exposure to perform photometry on.",
name="{inputName}",
storageClass="ExposureF",
dimensions=["instrument", "visit", "detector"],
)
measCat = cT.Output(
doc="Output forced photometry catalog.",
name="forced_src_diaObject",
storageClass="SourceCatalog",
dimensions=["instrument", "visit", "detector", "skymap", "tract"],
)
outputSchema = cT.InitOutput(
doc="Schema for the output forced measurement catalogs.",
name="forced_src_diaObject_schema",
storageClass="SourceCatalog",
)


class ForcedPhotCcdFromDataFrameConfig(ForcedPhotCcdConfig,
                               pipelineConnections=ForcedPhotCcdFromDataFrameConnections):
def setDefaults(self):
self.measurement.doReplaceWithNoise = False
self.measurement.plugins = ["base_TransformedCentroidFromCoord", "base_PsfFlux"]
self.measurement.copyColumns = {'id': 'diaObjectId', 'coord_ra': 'coord_ra', 'coord_dec': 'coord_dec'}
self.measurement.slots.centroid = "base_TransformedCentroidFromCoord"
self.measurement.slots.psfFlux = "base_PsfFlux"
self.measurement.slots.shape = None
self.catalogCalculation.plugins.names = []


class ForcedPhotCcdFromDataFrameTask(ForcedPhotCcdTask):

Definition at line 737 of file forcedPhotCcd.py.


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