|
def | runQuantum (self, butlerQC, inputRefs, outputRefs) |
|
def | df2RefCat (self, dfList, exposureBBox, exposureWcs) |
|
def | df2SourceCat (self, df) |
|
virtual bool | isHeavy () const |
|
std::shared_ptr< geom::SpanSet > | getSpans () const |
|
void | setSpans (std::shared_ptr< geom::SpanSet > otherSpanSet) |
|
PeakCatalog & | getPeaks () |
|
const PeakCatalog & | getPeaks () const |
|
std::shared_ptr< PeakRecord > | addPeak (float fx, float fy, float value) |
|
void | sortPeaks (afw::table::Key< float > const &key=afw::table::Key< float >()) |
|
void | setPeakSchema (afw::table::Schema const &peakSchema) |
|
void | setPeakCatalog (PeakCatalog const &otherPeaks) |
|
std::size_t | getArea () const |
|
lsst::geom::Point2D | getCentroid () const |
|
geom::ellipses::Quadrupole | getShape () const |
|
void | shift (int dx, int dy) |
|
void | shift (lsst::geom::ExtentI const &d) |
|
lsst::geom::Box2I | getBBox () const |
|
lsst::geom::Box2I | getRegion () const |
|
void | setRegion (lsst::geom::Box2I const ®ion) |
|
void | clipTo (lsst::geom::Box2I const &bbox) |
|
bool | contains (lsst::geom::Point2I const &pix) const |
|
std::shared_ptr< Footprint > | transform (std::shared_ptr< geom::SkyWcs > source, std::shared_ptr< geom::SkyWcs > target, lsst::geom::Box2I const ®ion, bool doClip=true) const |
|
std::shared_ptr< Footprint > | transform (lsst::geom::LinearTransform const &t, lsst::geom::Box2I const ®ion, bool doClip=true) const |
|
std::shared_ptr< Footprint > | transform (lsst::geom::AffineTransform const &t, lsst::geom::Box2I const ®ion, bool doClip=true) const |
|
std::shared_ptr< Footprint > | transform (geom::TransformPoint2ToPoint2 const &t, lsst::geom::Box2I const ®ion, bool doClip=true) const |
|
bool | isPersistable () const noexcept override |
|
void | dilate (int r, geom::Stencil s=geom::Stencil::CIRCLE) |
|
void | dilate (geom::SpanSet const &other) |
|
void | erode (int r, geom::Stencil s=geom::Stencil::CIRCLE) |
|
void | erode (geom::SpanSet const &other) |
|
void | removeOrphanPeaks () |
|
void | updatePeakSignificance (double sigma) |
|
void | updatePeakSignificance (image::Image< float > const &variance, int polarity) |
|
bool | isContiguous () const |
|
std::vector< std::shared_ptr< Footprint > > | split () const |
|
bool | operator== (Footprint const &other) const |
|
void | writeFits (std::string const &fileName, std::string const &mode="w") const |
|
void | writeFits (fits::MemFileManager &manager, std::string const &mode="w") const |
|
void | writeFits (fits::Fits &fitsfile) const |
|
detectorId = exposure.getInfo().getDetector().getId()
if externalPhotoCalibCatalog is not None:
row = externalPhotoCalibCatalog.find(detectorId)
if row is None:
self.log.warning("Detector id %s not found in externalPhotoCalibCatalog; "
"Using original photoCalib.", detectorId)
else:
photoCalib = row.getPhotoCalib()
if photoCalib is None:
self.log.warning("Detector id %s has None for photoCalib in externalPhotoCalibCatalog; "
"Using original photoCalib.", detectorId)
else:
exposure.setPhotoCalib(photoCalib)
if externalSkyWcsCatalog is not None:
row = externalSkyWcsCatalog.find(detectorId)
if row is None:
self.log.warning("Detector id %s not found in externalSkyWcsCatalog; "
"Using original skyWcs.", detectorId)
else:
skyWcs = row.getWcs()
if skyWcs is None:
self.log.warning("Detector id %s has None for skyWcs in externalSkyWcsCatalog; "
"Using original skyWcs.", detectorId)
else:
exposure.setWcs(skyWcs)
if finalizedPsfApCorrCatalog is not None:
row = finalizedPsfApCorrCatalog.find(detectorId)
if row is None:
self.log.warning("Detector id %s not found in finalizedPsfApCorrCatalog; "
"Using original psf.", detectorId)
else:
psf = row.getPsf()
apCorrMap = row.getApCorrMap()
if psf is None or apCorrMap is None:
self.log.warning("Detector id %s has None for psf/apCorrMap in "
"finalizedPsfApCorrCatalog; Using original psf.", detectorId)
else:
exposure.setPsf(psf)
exposure.setApCorrMap(apCorrMap)
if skyCorr is not None:
exposure.maskedImage -= skyCorr.getImage()
return exposure
def mergeAndFilterReferences(self, exposure, refCats, refWcs):
mergedRefCat = None
# Step 1: Determine bounds of the exposure photometry will
# be performed on.
expWcs = exposure.getWcs()
if expWcs is None:
self.log.info("Exposure has no WCS. Returning None for mergedRefCat.")
else:
expRegion = exposure.getBBox(lsst.afw.image.PARENT)
expBBox = lsst.geom.Box2D(expRegion)
expBoxCorners = expBBox.getCorners()
expSkyCorners = [expWcs.pixelToSky(corner).getVector() for
corner in expBoxCorners]
expPolygon = lsst.sphgeom.ConvexPolygon(expSkyCorners)
# Step 2: Filter out reference catalog sources that are
# not contained within the exposure boundaries, or whose
# parents are not within the exposure boundaries. Note
# that within a single input refCat, the parents always
# appear before the children.
for refCat in refCats:
refCat = refCat.get()
if mergedRefCat is None:
mergedRefCat = lsst.afw.table.SourceCatalog(refCat.table)
containedIds = {0} # zero as a parent ID means "this is a parent"
for record in refCat:
if (expPolygon.contains(record.getCoord().getVector()) and record.getParent()
in containedIds):
record.setFootprint(record.getFootprint())
mergedRefCat.append(record)
containedIds.add(record.getId())
if mergedRefCat is None:
raise RuntimeError("No reference objects for forced photometry.")
mergedRefCat.sort(lsst.afw.table.SourceTable.getParentKey())
return mergedRefCat
def generateMeasCat(self, exposureDataId, exposure, refCat, refWcs, idPackerName):
exposureIdInfo = ExposureIdInfo.fromDataId(exposureDataId, idPackerName)
idFactory = exposureIdInfo.makeSourceIdFactory()
measCat = self.measurement.generateMeasCat(exposure, refCat, refWcs,
idFactory=idFactory)
return measCat, exposureIdInfo.expId
def run(self, measCat, exposure, refCat, refWcs, exposureId=None):
self.measurement.run(measCat, exposure, refCat, refWcs, exposureId=exposureId)
if self.config.doApCorr:
self.applyApCorr.run(
catalog=measCat,
apCorrMap=exposure.getInfo().getApCorrMap()
)
self.catalogCalculation.run(measCat)
return pipeBase.Struct(measCat=measCat)
def attachFootprints(self, sources, refCat, exposure, refWcs):
Definition at line 563 of file forcedPhotCcd.py.