LSST Applications g0f08755f38+9c285cab97,g1635faa6d4+13f3999e92,g1653933729+a8ce1bb630,g1a0ca8cf93+bf6eb00ceb,g28da252d5a+0829b12dee,g29321ee8c0+5700dc9eac,g2bbee38e9b+9634bc57db,g2bc492864f+9634bc57db,g2cdde0e794+c2c89b37c4,g3156d2b45e+41e33cbcdc,g347aa1857d+9634bc57db,g35bb328faa+a8ce1bb630,g3a166c0a6a+9634bc57db,g3e281a1b8c+9f2c4e2fc3,g414038480c+077ccc18e7,g41af890bb2+fde0dd39b6,g5fbc88fb19+17cd334064,g781aacb6e4+a8ce1bb630,g80478fca09+55a9465950,g82479be7b0+d730eedb7d,g858d7b2824+9c285cab97,g9125e01d80+a8ce1bb630,g9726552aa6+10f999ec6a,ga5288a1d22+2a84bb7594,gacf8899fa4+c69c5206e8,gae0086650b+a8ce1bb630,gb58c049af0+d64f4d3760,gc28159a63d+9634bc57db,gcf0d15dbbd+4b7d09cae4,gda3e153d99+9c285cab97,gda6a2b7d83+4b7d09cae4,gdaeeff99f8+1711a396fd,ge2409df99d+5e831397f4,ge79ae78c31+9634bc57db,gf0baf85859+147a0692ba,gf3967379c6+41c94011de,gf3fb38a9a8+8f07a9901b,gfb92a5be7c+9c285cab97,w.2024.46
LSST Data Management Base Package
|
A set of pixels in an Image, including those pixels' actual values. More...
#include <HeavyFootprint.h>
Classes | |
class | Factory |
Public Member Functions | |
HeavyFootprint (Footprint const &foot, lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > const &mimage, HeavyFootprintCtrl const *ctrl=nullptr) | |
Create a HeavyFootprint from a regular Footprint and the image that provides the pixel values. | |
HeavyFootprint (Footprint const &foot, HeavyFootprintCtrl const *ctrl=nullptr) | |
Create a HeavyFootprint from a regular Footprint, allocating space to hold foot.getArea() pixels, but not initializing them. | |
HeavyFootprint ()=default | |
Default constructor for HeavyFootprint. | |
~HeavyFootprint () override=default | |
HeavyFootprint (HeavyFootprint const &other)=default | |
HeavyFootprint (HeavyFootprint &&other)=default | |
HeavyFootprint & | operator= (HeavyFootprint const &)=default |
HeavyFootprint & | operator= (HeavyFootprint &&)=default |
bool | isHeavy () const override |
Is this a HeavyFootprint (yes!) | |
void | insert (lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > &mimage) const |
Replace all the pixels in the image with the values in the HeavyFootprint. | |
void | insert (lsst::afw::image::Image< ImagePixelT > &image) const |
Replace all the pixels in the image with the values in the HeavyFootprint. | |
ndarray::Array< ImagePixelT, 1, 1 > | getImageArray () |
ndarray::Array< MaskPixelT, 1, 1 > | getMaskArray () |
ndarray::Array< VariancePixelT, 1, 1 > | getVarianceArray () |
ndarray::Array< ImagePixelT const, 1, 1 > | getImageArray () const |
ndarray::Array< MaskPixelT const, 1, 1 > | getMaskArray () const |
ndarray::Array< VariancePixelT const, 1, 1 > | getVarianceArray () const |
MaskPixelT | getMaskBitsSet () const |
double | dot (HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT > const &other) const |
Dot product between HeavyFootprints. | |
std::shared_ptr< geom::SpanSet > | getSpans () const |
Return a shared pointer to the SpanSet. | |
void | setSpans (std::shared_ptr< geom::SpanSet > otherSpanSet) |
Sets the shared pointer to the SpanSet in the Footprint. | |
PeakCatalog & | getPeaks () |
Return the Peaks contained in this Footprint. | |
const PeakCatalog & | getPeaks () const |
std::shared_ptr< PeakRecord > | addPeak (float fx, float fy, float value) |
Convenience function to add a peak. | |
void | sortPeaks (afw::table::Key< float > const &key=afw::table::Key< float >()) |
Sort Peaks from most positive value to most negative. | |
void | setPeakSchema (afw::table::Schema const &peakSchema) |
Set the Schema used by the PeakCatalog (will throw if PeakCatalog is not empty). | |
void | setPeakCatalog (PeakCatalog const &otherPeaks) |
Set the peakCatalog to a copy of the supplied catalog. | |
std::size_t | getArea () const |
Return the number of pixels in this Footprint. | |
lsst::geom::Point2D | getCentroid () const |
Return the Footprint's centroid. | |
geom::ellipses::Quadrupole | getShape () const |
Return the Footprint's shape (interpreted as an ellipse) | |
void | shift (int dx, int dy) |
Shift a Footprint by (dx, dy) | |
void | shift (lsst::geom::ExtentI const &d) |
Shift a Footprint by a given extent. | |
lsst::geom::Box2I | getBBox () const |
Return the Footprint's bounding box. | |
lsst::geom::Box2I | getRegion () const |
Return the corners of the MaskedImage the footprints live in. | |
void | setRegion (lsst::geom::Box2I const ®ion) |
Set the corners of the MaskedImage wherein the footprints dwell. | |
void | clipTo (lsst::geom::Box2I const &bbox) |
Clip the Footprint such that all values lie inside the supplied Bounding Box. | |
bool | contains (lsst::geom::Point2I const &pix) const |
Tests if a pixel postion falls inside the Footprint. | |
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 |
Transform the footprint from one WCS to another. | |
std::shared_ptr< Footprint > | transform (lsst::geom::LinearTransform const &t, lsst::geom::Box2I const ®ion, bool doClip=true) const |
Return a new Footprint whose pixels are the product of applying the specified transformation. | |
std::shared_ptr< Footprint > | transform (lsst::geom::AffineTransform const &t, lsst::geom::Box2I const ®ion, bool doClip=true) const |
Return a new Footprint whose pixels are the product of applying the specified transformation. | |
std::shared_ptr< Footprint > | transform (geom::TransformPoint2ToPoint2 const &t, lsst::geom::Box2I const ®ion, bool doClip=true) const |
Return a new Footprint whose pixels are the product of applying the specified transformation. | |
bool | isPersistable () const noexcept override |
Report if this object is persistable. | |
void | dilate (int r, geom::Stencil s=geom::Stencil::CIRCLE) |
Dilate the Footprint with a defined kernel. | |
void | dilate (geom::SpanSet const &other) |
Dilate the Footprint with a defined kernel. | |
void | erode (int r, geom::Stencil s=geom::Stencil::CIRCLE) |
Erode the Footprint with a defined kernel. | |
void | erode (geom::SpanSet const &other) |
Erode the Footprint with a defined kernel. | |
void | removeOrphanPeaks () |
Remove peaks from the PeakCatalog that fall outside the area of the Footprint. | |
void | updatePeakSignificance (double sigma) |
Compute and update the significance of each peak, given a single value for sigma. | |
void | updatePeakSignificance (image::Image< float > const &variance, int polarity) |
Compute and update the significance of each peak, using the variance image. | |
bool | isContiguous () const |
Reports if the Footprint is simply connected or has multiple components. | |
std::vector< std::shared_ptr< Footprint > > | split () const |
Split a multi-component Footprint into a vector of contiguous Footprints. | |
bool | operator== (Footprint const &other) const |
equality operator | |
void | writeFits (std::string const &fileName, std::string const &mode="w") const |
Write the object to a regular FITS file. | |
void | writeFits (fits::MemFileManager &manager, std::string const &mode="w") const |
Write the object to a FITS image in memory. | |
void | writeFits (fits::Fits &fitsfile) const |
Write the object to an already-open FITS object. | |
Static Public Member Functions | |
static std::shared_ptr< T > | readFits (fits::Fits &fitsfile) |
Read an object from an already open FITS object. | |
static std::shared_ptr< T > | readFits (std::string const &fileName, int hdu=fits::DEFAULT_HDU) |
Read an object from a regular FITS file. | |
static std::shared_ptr< T > | readFits (fits::MemFileManager &manager, int hdu=fits::DEFAULT_HDU) |
Read an object from a FITS file in memory. | |
static std::shared_ptr< T > | dynamicCast (std::shared_ptr< Persistable > const &ptr) |
Dynamically cast a shared_ptr. | |
static std::shared_ptr< lsst::afw::detection::Footprint > | readFits (fits::Fits &fitsfile) |
Read an object from an already open FITS object. | |
static std::shared_ptr< lsst::afw::detection::Footprint > | readFits (std::string const &fileName, int hdu=fits::DEFAULT_HDU) |
Read an object from a regular FITS file. | |
static std::shared_ptr< lsst::afw::detection::Footprint > | readFits (fits::MemFileManager &manager, int hdu=fits::DEFAULT_HDU) |
Read an object from a FITS file in memory. | |
static std::shared_ptr< lsst::afw::detection::Footprint > | dynamicCast (std::shared_ptr< Persistable > const &ptr) |
Dynamically cast a shared_ptr. | |
Protected Types | |
using | OutputArchiveHandle = io::OutputArchiveHandle |
Protected Member Functions | |
std::string | getPersistenceName () const override |
Return the name correspoinging ot the persistence type. | |
void | write (OutputArchiveHandle &handle) const override |
Write an instance of a Footprint to an output Archive. | |
std::string | getPythonModule () const override |
Return the python module the object will live in. | |
Static Protected Member Functions | |
static std::unique_ptr< Footprint > | readSpanSet (afw::table::BaseCatalog const &, afw::table::io::InputArchive const &) |
Static method used to unpersist the SpanSet member of the Footprint class. | |
static void | readPeaks (afw::table::BaseCatalog const &, Footprint &) |
Static method used to unpersist the PeakCatalog member of the Footprint class. | |
A set of pixels in an Image, including those pixels' actual values.
Definition at line 47 of file HeavyFootprint.h.
|
protectedinherited |
Definition at line 108 of file Persistable.h.
|
explicit |
Create a HeavyFootprint from a regular Footprint and the image that provides the pixel values.
foot | The Footprint defining the pixels to set |
mimage | The pixel values |
ctrl | Control how we manipulate HeavyFootprints |
Definition at line 71 of file HeavyFootprint.cc.
|
explicit |
Create a HeavyFootprint from a regular Footprint, allocating space to hold foot.getArea() pixels, but not initializing them.
This is used when unpersisting a HeavyFootprint.
foot | The Footprint defining the pixels to set |
ctrl | Control how we manipulate HeavyFootprints |
Definition at line 107 of file HeavyFootprint.cc.
|
default |
Default constructor for HeavyFootprint.
Most common use for this will be in combination with the assignment operator
|
overridedefault |
|
default |
|
default |
|
inherited |
Convenience function to add a peak.
fx | Float containing the x position of a peak |
fy | Float containing the y position of a peak |
value | The intensity value of the peak |
Definition at line 47 of file Footprint.cc.
|
inherited |
Clip the Footprint such that all values lie inside the supplied Bounding Box.
bbox | Integer box object that defines the boundaries the footprint should be clipped to. |
Definition at line 74 of file Footprint.cc.
|
inherited |
Tests if a pixel postion falls inside the Footprint.
pix | Integer point object defining the position of a pixel to test |
Definition at line 79 of file Footprint.cc.
|
inherited |
Dilate the Footprint with a defined kernel.
This function enlarges the SpanSet which defines the area of the Footprint by an amount governed by the input kernel
other | SpanSet to use as the kernel in dilation |
Definition at line 124 of file Footprint.cc.
|
inherited |
Dilate the Footprint with a defined kernel.
This function enlarges the SpanSet which defines the area of the Footprint by an amount governed by in input kernel
r | The radius of the stencil object used to create a dilation kernel |
s | The stencil object used to create the dilation kernel |
Definition at line 122 of file Footprint.cc.
double lsst::afw::detection::HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT >::dot | ( | HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT > const & | other | ) | const |
Dot product between HeavyFootprints.
The mask and variance planes are ignored.
Definition at line 151 of file HeavyFootprint.cc.
|
staticinherited |
Dynamically cast a shared_ptr.
Dynamically cast a shared pointer and raise on failure.
You must provide an explicit template instantiation in the .cc file for each class that inherits from PersistableFacade. Designed to work around RTTI issues on macOS with hidden symbols;
lsst::pex::exceptions::LogicError | if the cast fails |
param[in] ptr The pointer to be cast.
lsst::pex::exceptions::TypeError | If the dynamic cast fails. |
Definition at line 18 of file Persistable.cc.
|
staticinherited |
Dynamically cast a shared_ptr.
Dynamically cast a shared pointer and raise on failure.
You must provide an explicit template instantiation in the .cc file for each class that inherits from PersistableFacade. Designed to work around RTTI issues on macOS with hidden symbols;
lsst::pex::exceptions::LogicError | if the cast fails |
param[in] ptr The pointer to be cast.
lsst::pex::exceptions::TypeError | If the dynamic cast fails. |
Definition at line 218 of file Persistable.cc.
|
inherited |
Erode the Footprint with a defined kernel.
This function reduces the size of the SpanSet which defines the area of the Footprint by an amount governed by the input kernel
other | SpanSet to use as the kernel in erosion |
Definition at line 131 of file Footprint.cc.
|
inherited |
Erode the Footprint with a defined kernel.
This function reduces the size of the SpanSet which defines the area of the Footprint by an amount governed by the input kernel
r | The radius of the stencil object used to create a erosion kernel |
s | The stencil object used to create the erosion kernel |
Definition at line 126 of file Footprint.cc.
|
inlineinherited |
Return the number of pixels in this Footprint.
This function returns the real number of pixels, not the area of the bbox.
Definition at line 173 of file Footprint.h.
|
inlineinherited |
Return the Footprint's bounding box.
Definition at line 208 of file Footprint.h.
|
inlineinherited |
Return the Footprint's centroid.
The centroid is calculated as the mean of the pixel centers
Definition at line 180 of file Footprint.h.
|
inline |
Definition at line 107 of file HeavyFootprint.h.
|
inline |
Definition at line 111 of file HeavyFootprint.h.
|
inline |
Definition at line 108 of file HeavyFootprint.h.
|
inline |
Definition at line 112 of file HeavyFootprint.h.
|
inline |
Definition at line 116 of file HeavyFootprint.h.
|
inlineinherited |
Return the Peaks contained in this Footprint.
The peaks should be ordered by decreasing pixel intensity at the peak position (so the most negative peak appears last). Users that add new Peaks manually are responsible for maintaining this sorting.
Definition at line 129 of file Footprint.h.
|
inlineinherited |
Definition at line 130 of file Footprint.h.
|
overrideprotectedvirtual |
Return the name correspoinging ot the persistence type.
Reimplemented from lsst::afw::detection::Footprint.
Definition at line 259 of file HeavyFootprint.cc.
|
inlineoverrideprotectedvirtualinherited |
Return the python module the object will live in.
Reimplemented from lsst::afw::table::io::Persistable.
Definition at line 385 of file Footprint.h.
|
inlineinherited |
Return the corners of the MaskedImage the footprints live in.
Definition at line 213 of file Footprint.h.
|
inlineinherited |
Return the Footprint's shape (interpreted as an ellipse)
The shape is determined by measuring the moments of the pixel centers about its centroid (cf. getCentroid)
Definition at line 188 of file Footprint.h.
|
inlineinherited |
Return a shared pointer to the SpanSet.
Definition at line 115 of file Footprint.h.
|
inline |
Definition at line 109 of file HeavyFootprint.h.
|
inline |
Definition at line 113 of file HeavyFootprint.h.
void lsst::afw::detection::HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT >::insert | ( | lsst::afw::image::Image< ImagePixelT > & | image | ) | const |
Replace all the pixels in the image with the values in the HeavyFootprint.
[out] | image | Image to set |
Definition at line 123 of file HeavyFootprint.cc.
void lsst::afw::detection::HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT >::insert | ( | lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > & | mimage | ) | const |
Replace all the pixels in the image with the values in the HeavyFootprint.
Definition at line 115 of file HeavyFootprint.cc.
|
inlineinherited |
Reports if the Footprint is simply connected or has multiple components.
Definition at line 358 of file Footprint.h.
|
inlineoverridevirtual |
Is this a HeavyFootprint (yes!)
Reimplemented from lsst::afw::detection::Footprint.
Definition at line 93 of file HeavyFootprint.h.
|
inlineoverridevirtualnoexceptinherited |
Report if this object is persistable.
Reimplemented from lsst::afw::table::io::Persistable.
Definition at line 283 of file Footprint.h.
|
default |
|
default |
|
inherited |
equality operator
other | The Footprint for which equality will be computed |
Definition at line 176 of file Footprint.cc.
|
inlinestaticinherited |
Read an object from an already open FITS object.
[in] | fitsfile | FITS object to read from, already positioned at the desired HDU. |
Definition at line 183 of file Persistable.h.
|
inlinestaticinherited |
Read an object from an already open FITS object.
[in] | fitsfile | FITS object to read from, already positioned at the desired HDU. |
Definition at line 183 of file Persistable.h.
|
inlinestaticinherited |
Read an object from a FITS file in memory.
[in] | manager | Manager for the memory to read from. |
[in] | hdu | HDU to read, where 0 is the primary. The special value of afw::fits::DEFAULT_HDU skips the primary HDU if it is empty. |
Definition at line 205 of file Persistable.h.
|
inlinestaticinherited |
Read an object from a FITS file in memory.
[in] | manager | Manager for the memory to read from. |
[in] | hdu | HDU to read, where 0 is the primary. The special value of afw::fits::DEFAULT_HDU skips the primary HDU if it is empty. |
Definition at line 205 of file Persistable.h.
|
inlinestaticinherited |
Read an object from a regular FITS file.
[in] | fileName | Name of the file to read. |
[in] | hdu | HDU to read, where 0 is the primary. The special value of afw::fits::DEFAULT_HDU skips the primary HDU if it is empty. |
Definition at line 194 of file Persistable.h.
|
inlinestaticinherited |
Read an object from a regular FITS file.
[in] | fileName | Name of the file to read. |
[in] | hdu | HDU to read, where 0 is the primary. The special value of afw::fits::DEFAULT_HDU skips the primary HDU if it is empty. |
Definition at line 194 of file Persistable.h.
|
staticprotectedinherited |
Static method used to unpersist the PeakCatalog member of the Footprint class.
Definition at line 310 of file Footprint.cc.
|
staticprotectedinherited |
Static method used to unpersist the SpanSet member of the Footprint class.
Definition at line 286 of file Footprint.cc.
|
inherited |
Remove peaks from the PeakCatalog that fall outside the area of the Footprint.
Definition at line 136 of file Footprint.cc.
|
inherited |
Set the peakCatalog to a copy of the supplied catalog.
PeakCatalog will be copied into the Footprint, but a PeakCatalog is a shallow copy, so records will not be duplicated. This function will throw an error if the PeakCatalog of *this is not empty.
otherPeaks | The PeakCatalog to copy |
Definition at line 435 of file Footprint.cc.
|
inherited |
Set the Schema used by the PeakCatalog (will throw if PeakCatalog is not empty).
peakSchema | The schema to use in the PeakCatalog |
pex::exceptions::LogicError | Thrown if if the PeakCatalog is not empty |
Definition at line 431 of file Footprint.cc.
|
inlineinherited |
Set the corners of the MaskedImage wherein the footprints dwell.
region | A box describing the corners of the Image the Footprint derives from |
Definition at line 220 of file Footprint.h.
|
inherited |
Sets the shared pointer to the SpanSet in the Footprint.
otherSpanSet | Shared pointer to a SpanSet |
Definition at line 45 of file Footprint.cc.
|
inherited |
Shift a Footprint by (dx, dy)
dx | How much to move Footprint in column direction |
dy | How much to move in row direction |
Definition at line 64 of file Footprint.cc.
|
inlineinherited |
Shift a Footprint by a given extent.
d | ExtentI object which gives the dimensions the Footprint should be shifted |
Definition at line 203 of file Footprint.h.
|
inherited |
Sort Peaks from most positive value to most negative.
If the key passed is invalid (the default) PeakTable::getPeakValueKey() will be used.
key | A key corresponding to the field in the Schema the PeakCatalog is to be sorted by. |
Definition at line 57 of file Footprint.cc.
|
inherited |
Split a multi-component Footprint into a vector of contiguous Footprints.
Split a multi-component Footprint such that each Footprint in the output vector is contiguous and contains only peaks that can be found within the bounds of the Footprint
Definition at line 159 of file Footprint.cc.
|
inherited |
Return a new Footprint whose pixels are the product of applying the specified transformation.
t | A 2-D transform which will be used to map the pixels |
region | Used to set the "region" box of the returned footprint; note that this is NOT the same as the footprint's bounding box. |
doClip | If true, clip the new footprint to the region bbox before returning it. |
Definition at line 98 of file Footprint.cc.
|
inherited |
Return a new Footprint whose pixels are the product of applying the specified transformation.
t | An affine transform object which will be used to map the pixels |
region | Used to set the "region" box of the returned footprint; note that this is NOT the same as the footprint's bounding box. |
doClip | If true, clip the new footprint to the region bbox before returning it. |
Definition at line 93 of file Footprint.cc.
|
inherited |
Return a new Footprint whose pixels are the product of applying the specified transformation.
t | A linear transform object which will be used to map the pixels |
region | Used to set the "region" box of the returned footprint; note that this is NOT the same as the footprint's bounding box. |
doClip | If true, clip the new footprint to the region bbox before returning it. |
Definition at line 88 of file Footprint.cc.
|
inherited |
Transform the footprint from one WCS to another.
source | Wcs that defines the coordinate system of the input footprint. |
target | Wcs that defines that desired coordinate system of the returned footprint. |
region | Used to set the "region" box of the returned footprint; note that this is NOT the same as the footprint's bounding box. |
doClip | If true, clip the new footprint to the region bbox before returning it. |
Definition at line 81 of file Footprint.cc.
|
inherited |
Compute and update the significance of each peak, given a single value for sigma.
The Footprint peak schema must already have a significance
field in it.
sigma | The standard deviation for peak detection, positive or negative as appropriate. |
pex::exceptions::NotFoundError | Thrown if the the peaks do not have a significance field. |
Definition at line 145 of file Footprint.cc.
|
inherited |
Compute and update the significance of each peak, using the variance image.
The Footprint peak schema must already have a significance
field in it.
variance | The variance plane of the image that this footprint is in. |
polarity | +1 if this is detected as a positive footprint, -1 if negative. |
pex::exceptions::NotFoundError | Thrown if the the peaks do not have a significance field. |
Definition at line 152 of file Footprint.cc.
|
overrideprotectedvirtual |
Write an instance of a Footprint to an output Archive.
Reimplemented from lsst::afw::detection::Footprint.
Definition at line 264 of file HeavyFootprint.cc.
|
inherited |
Write the object to an already-open FITS object.
[in] | fitsfile | Open FITS object to write to. |
Definition at line 18 of file Persistable.cc.
|
inherited |
Write the object to a FITS image in memory.
[in] | manager | Name of the file to write to. |
[in] | mode | If "w", any existing file with the given name will be overwritten. If "a", new HDUs will be appended to an existing file. |
Definition at line 29 of file Persistable.cc.
|
inherited |
Write the object to a regular FITS file.
[in] | fileName | Name of the file to write to. |
[in] | mode | If "w", any existing file with the given name will be overwritten. If "a", new HDUs will be appended to an existing file. |
Definition at line 24 of file Persistable.cc.