lsst.meas.base gdd7ff8183c+2e6d5f40bc
Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | List of all members
lsst.meas.base.forcedPhotCcd.may Class Reference
Inheritance diagram for lsst.meas.base.forcedPhotCcd.may:
lsst::afw::detection::Footprint

Public Member Functions

virtual bool isHeavy () const
 
std::shared_ptr< geom::SpanSet > getSpans () const
 
void setSpans (std::shared_ptr< geom::SpanSet > otherSpanSet)
 
PeakCataloggetPeaks ()
 
const PeakCataloggetPeaks () 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 &region)
 
void clipTo (lsst::geom::Box2I const &bbox)
 
bool contains (lsst::geom::Point2I const &pix) const
 
std::shared_ptr< Footprinttransform (std::shared_ptr< geom::SkyWcs > source, std::shared_ptr< geom::SkyWcs > target, lsst::geom::Box2I const &region, bool doClip=true) const
 
std::shared_ptr< Footprinttransform (lsst::geom::LinearTransform const &t, lsst::geom::Box2I const &region, bool doClip=true) const
 
std::shared_ptr< Footprinttransform (lsst::geom::AffineTransform const &t, lsst::geom::Box2I const &region, bool doClip=true) const
 
std::shared_ptr< Footprinttransform (geom::TransformPoint2ToPoint2 const &t, lsst::geom::Box2I const &region, 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
 

Static Public Member Functions

static std::shared_ptr< lsst::afw::detection::FootprintreadFits (fits::Fits &fitsfile)
 
static std::shared_ptr< lsst::afw::detection::FootprintreadFits (std::string const &fileName, int hdu=fits::DEFAULT_HDU)
 
static std::shared_ptr< lsst::afw::detection::FootprintreadFits (fits::MemFileManager &manager, int hdu=fits::DEFAULT_HDU)
 
static std::shared_ptr< lsst::afw::detection::FootprintdynamicCast (std::shared_ptr< Persistable > const &ptr)
 

Protected Types

typedef io::OutputArchiveHandle OutputArchiveHandle
 

Protected Member Functions

std::string getPersistenceName () const override
 
std::string getPythonModule () const override
 
void write (OutputArchiveHandle &handle) const override
 
virtual void write (OutputArchiveHandle &handle) const
 

Static Protected Member Functions

static std::unique_ptr< FootprintreadSpanSet (afw::table::BaseCatalog const &, afw::table::io::InputArchive const &)
 
static void readPeaks (afw::table::BaseCatalog const &, Footprint &)
 

Detailed Description

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):
# Step 1: Determine bounds of the exposure photometry will
# be performed on.
expWcs = exposure.getWcs()
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.
mergedRefCat = None
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):
r

Definition at line 554 of file forcedPhotCcd.py.


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