LSSTApplications
20.0.0
LSSTDataManagementBasePackage
|
Go to the documentation of this file.
34 template <
typename PixelT>
44 mi != detBadMaskPlanes.
end(); ++mi){
48 LOGL_DEBUG(
"TRACE3.ip.diffim.KernelCandidateDetection",
49 "Cannot update bad bit mask with %s", (*mi).c_str());
50 LOGL_DEBUG(
"TRACE4.ip.diffim.KernelCandidateDetection",
54 LOGL_DEBUG(
"TRACE2.ip.diffim.KernelCandidateDetection",
55 "Using bad bit mask %d", _badBitMask);
78 template <
typename PixelT>
85 int fpNpixMin = _ps->getAsInt(
"fpNpixMin");
86 int fpGrowPix = _ps->getAsInt(
"fpGrowPix");
88 bool detOnTemplate = _ps->getAsBool(
"detOnTemplate");
89 double detThreshold = _ps->getAsDouble(
"detThreshold");
90 std::string detThresholdType = _ps->getAsString(
"detThresholdType");
102 if (detOnTemplate ==
true) {
104 *(templateMaskedImage),
111 LOGL_DEBUG(
"TRACE2.ip.diffim.KernelCandidateDetection.apply",
112 "Found %d total footprints in template above %.3f %s",
113 footprintListInPtr->size(), detThreshold, detThresholdType.
c_str());
117 *(scienceMaskedImage),
123 LOGL_DEBUG(
"TRACE2.ip.diffim.KernelCandidateDetection.apply",
124 "Found %d total footprints in science image above %.3f %s",
125 footprintListInPtr->size(), detThreshold, detThresholdType.
c_str());
130 i != footprintListInPtr->end(); ++i) {
132 growCandidate((*i), fpGrowPix, templateMaskedImage, scienceMaskedImage);
135 if (_footprints.size() == 0) {
137 "Unable to find any footprints for Psf matching");
140 LOGL_DEBUG(
"TRACE1.ip.diffim.KernelCandidateDetection.apply",
141 "Found %d clean footprints above threshold %.3f",
142 _footprints.size(), detThreshold);
146 template <
typename PixelT>
153 int fpNpixMax = _ps->getAsInt(
"fpNpixMax");
170 LOGL_DEBUG(
"TRACE3.ip.diffim.KernelCandidateDetection.apply",
171 "Footprint has too many pix: %d (max =%d)",
181 return growCandidate(fpCore, fpGrowPix, templateMaskedImage, scienceMaskedImage);
184 LOGL_DEBUG(
"TRACE5.ip.diffim.KernelCandidateDetection.apply",
185 "Original footprint in parent : %d,%d -> %d,%d -> %d,%d",
210 fp->
getSpans()->dilated(fpGrowPix, afwGeom::Stencil::MANHATTAN)
216 LOGL_DEBUG(
"TRACE5.ip.diffim.KernelCandidateDetection.apply",
217 "Grown footprint in parent : %d,%d -> %d,%d -> %d,%d",
227 LOGL_DEBUG(
"TRACE3.ip.diffim.KernelCandidateDetection.apply",
228 "Footprint grown off image");
233 bool subimageHasFailed =
false;
240 if (fsb.
getBits() & _badBitMask) {
241 LOGL_DEBUG(
"TRACE3.ip.diffim.KernelCandidateDetection.apply",
242 "Footprint has masked pix (vals=%d) in image to convolve",
244 subimageHasFailed =
true;
248 if (fsb.
getBits() & _badBitMask) {
249 LOGL_DEBUG(
"TRACE3.ip.diffim.KernelCandidateDetection.apply",
250 "Footprint has masked pix (vals=%d) in image not to convolve",
252 subimageHasFailed =
true;
256 LOGL_DEBUG(
"TRACE3.ip.diffim.KernelCandidateDetection.apply",
257 "Exception caught extracting Footprint");
258 LOGL_DEBUG(
"TRACE4.ip.diffim.KernelCandidateDetection.apply",
260 subimageHasFailed =
true;
262 if (subimageHasFailed) {
266 _footprints.push_back(fpGrow);
Backwards-compatibility support for depersisting the old Calib (FluxMag0/FluxMag0Err) objects.
Search through images for Footprints with no masked pixels.
Image Subtraction helper functions.
void apply(MaskedImagePtr const &templateMaskedImage, MaskedImagePtr const &scienceMaskedImage)
Runs Detection on a single image for significant peaks, and checks returned Footprints for Masked pix...
Detect candidates for kernels within 2 images.
lsst::geom::Box2I getBBox(ImageOrigin const origin=PARENT) const
void apply(MaskT const &mask)
static MaskPixelT getPlaneBitMask(const std::vector< std::string > &names)
Return the bitmask corresponding to a vector of plane names OR'd together.
lsst::afw::detection::Footprint Footprint
bool contains(Point2I const &point) const noexcept
Return true if the box contains the point.
A Threshold is used to pass a threshold value to detection algorithms.
Threshold createThreshold(const double value, const std::string type="value", const bool polarity=true)
Factory method for creating Threshold objects.
MaskT::Pixel getBits() const
A base class for image defects.
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
int getMaxY() const noexcept
#define LOGL_DEBUG(logger, message...)
int getMaxX() const noexcept
Class for storing generic metadata.
KernelCandidateDetection(lsst::daf::base::PropertySet const &ps)
An integer coordinate rectangle.
int getMinX() const noexcept
Class to accumulate Mask bits.
Provides consistent interface for LSST exceptions.
bool growCandidate(std::shared_ptr< lsst::afw::detection::Footprint > fp, int fpGrowPix, MaskedImagePtr const &templateMaskedImage, MaskedImagePtr const &scienceMaskedImage)
MaskPtr getMask() const
Return a (shared_ptr to) the MaskedImage's mask.
virtual char const * what(void) const noexcept
Return a character string summarizing this exception.
LSST DM logging module built on log4cxx.
int getMinY() const noexcept