LSST Applications g063fba187b+fee0456c91,g0f08755f38+ea96e5a5a3,g1653933729+a8ce1bb630,g168dd56ebc+a8ce1bb630,g1a2382251a+90257ff92a,g20f6ffc8e0+ea96e5a5a3,g217e2c1bcf+937a289c59,g28da252d5a+daa7da44eb,g2bbee38e9b+253935c60e,g2bc492864f+253935c60e,g3156d2b45e+6e55a43351,g32e5bea42b+31359a2a7a,g347aa1857d+253935c60e,g35bb328faa+a8ce1bb630,g3a166c0a6a+253935c60e,g3b1af351f3+a8ce1bb630,g3e281a1b8c+c5dd892a6c,g414038480c+416496e02f,g41af890bb2+afe91b1188,g599934f4f4+0db33f7991,g7af13505b9+e36de7bce6,g80478fca09+da231ba887,g82479be7b0+a4516e59e3,g858d7b2824+ea96e5a5a3,g89c8672015+f4add4ffd5,g9125e01d80+a8ce1bb630,ga5288a1d22+bc6ab8dfbd,gb58c049af0+d64f4d3760,gc28159a63d+253935c60e,gcab2d0539d+3f2b72788c,gcf0d15dbbd+4ea9c45075,gda6a2b7d83+4ea9c45075,gdaeeff99f8+1711a396fd,ge79ae78c31+253935c60e,gef2f8181fd+3031e3cf99,gf0baf85859+c1f95f4921,gfa517265be+ea96e5a5a3,gfa999e8aa5+17cd334064,w.2024.50
LSST Data Management Base Package
|
#include <simpleShape.h>
Public Types | |
typedef SimpleShapeControl | Control |
Public Member Functions | |
SimpleShape (Control const &ctrl, std::string const &name, afw::table::Schema &schema) | |
virtual void | measure (afw::table::SourceRecord &measRecord, afw::image::Exposure< float > const &exposure) const |
Called to measure a single child source in an image. | |
virtual void | fail (afw::table::SourceRecord &measRecord, lsst::meas::base::MeasurementError *error=NULL) const |
Handle an exception thrown by the current algorithm by setting flags in the given record. | |
void | measureForced (afw::table::SourceRecord &measRecord, afw::image::Exposure< float > const &exposure, afw::table::SourceRecord const &refRecord, afw::geom::SkyWcs const &refWcs) const override |
Called to measure a single child source in an image. | |
void | measureNForced (afw::table::SourceCatalog const &measCat, afw::image::Exposure< float > const &exposure, afw::table::SourceCatalog const &refRecord, afw::geom::SkyWcs const &refWcs) const override |
Called to simultaneously measure all children in a deblend family, in a single image. | |
virtual void | measureN (afw::table::SourceCatalog const &measCat, afw::image::Exposure< float > const &exposure) const |
Called to simultaneously measure all children in a deblend family, in a single image. | |
std::string | getLogName () const |
Static Public Member Functions | |
static base::FlagDefinitionList const & | getFlagDefinitions () |
template<typename T > | |
static SimpleShapeResult | computeMoments (afw::geom::ellipses::Ellipse const &weight, afw::image::MaskedImage< T > const &image, double nSigmaRegion=3.0) |
Compute the Gaussian-weighted moments of an image. | |
static Eigen::Matrix< double, 5, 6 > | convertRawMoments (Eigen::Matrix< double, 6, 1 > const &q, afw::geom::ellipses::Quadrupole &quadrupole, geom::Point2D ¢er) |
Convert linear raw moments into an ellipse and centroid, and return the derivative of the conversion. | |
static Eigen::Matrix< double, 5, 5 > | correctWeightedMoments (afw::geom::ellipses::Quadrupole const &weight, afw::geom::ellipses::Quadrupole &ellipse, geom::Point2D ¢er) |
Correct moments measured with a Gaussian weight function by assuming the data was also an elliptical Gaussian, and return the derivative of the correction. | |
Static Public Attributes | |
static unsigned int const | N_FLAGS = 1 |
static base::FlagDefinition const | FAILURE = flagDefinitions.addFailureFlag() |
Protected Attributes | |
std::string | _logName |
Definition at line 95 of file simpleShape.h.
Definition at line 103 of file simpleShape.h.
lsst::meas::extensions::simpleShape::SimpleShape::SimpleShape | ( | Control const & | ctrl, |
std::string const & | name, | ||
afw::table::Schema & | schema ) |
Definition at line 378 of file simpleShape.cc.
|
static |
Compute the Gaussian-weighted moments of an image.
[in] | weight | An ellipse object of Gaussian weights to apply to the measurement. |
[in] | image | A Masked image instance with int float or double pixels. |
[in] | nSigmaRegion | Maximum radius for pixels to include, in units of sigma |
Definition at line 161 of file simpleShape.cc.
|
static |
Convert linear raw moments into an ellipse and centroid, and return the derivative of the conversion.
For weight function \(w\) and data \(p\), the "raw" moments \(Q\) are defined as:
\begin{eqnarray*} Q_0 &=& \sum_n w(x_n, y_n) p_n \\ Q_{xx} &=& \sum_n w(x_n, y_n) x_n^2 p_n \\ Q_{yy} &=& \sum_n w(x_n, y_n) y_n^2 p_n \\ Q_{xy} &=& \sum_n w(x_n, y_n) x_n y_n p_n \\ Q_x &=& \sum_n w(x_n, y_n) x_n p_n \\ Q_y &=& \sum_n w(x_n, y_n) y_n p_n \end{eqnarray*}
whereas the converted ellipse and centroid moments are:
\begin{eqnarray*} M_{xx} &=& Q_{xx} / Q_0 - Q_x^2 \\ M_{xx} &=& Q_{yy} / Q_0 - Q_y^2 \\ M_{xx} &=& Q_{xy} / Q_0 - Q_x Q_y \\ M_x &=& Q_x / Q_0 \\ M_y &=& Q_y / Q_0 \end{eqnarray*}
Note the slightly unusual ordering; this is for consistency with afw::geom::ellipses::Ellipse.
Definition at line 203 of file simpleShape.cc.
|
static |
Correct moments measured with a Gaussian weight function by assuming the data was also an elliptical Gaussian, and return the derivative of the correction.
If we naively measure Gaussian-weighted moments, we'll measure the moments of the product of the weight function and the data. What we want is the moments of the data, as if we had measured them with no weight function (but without sacrificing the S/N benefit that comes from using a weight function). To do that, we assume the data is also an elliptical Gaussian, and "divide" the weight function from the measured moments to compute it.
If \(W\) and \(M\) are the quadruple matrices of the weight function and measurement, and \(\eta\) is the measured centroid (we work in a coordinate system where the weight function is centered at the origin), then the corrected quadrupole matrix \(C\) and centroid are \(\nu\) are:
\begin{eqnarray*} C &=& \left(M^{-1} - W^{-1}\right)^{-1} \\ \nu &=& C M^{-1} \eta \end{eqnarray*}
Definition at line 234 of file simpleShape.cc.
|
virtual |
Handle an exception thrown by the current algorithm by setting flags in the given record.
fail() is called by the measurement framework when an exception is allowed to propagate out of one the algorithm's measure() methods. It should generally set both a general failure flag for the algorithm as well as a specific flag indicating the error condition, if possible. To aid in this, if the exception was an instance of MeasurementError, it will be passed in, carrying information about what flag to set.
An algorithm can also to chose to set flags within its own measure() methods, and then just return, rather than throw an exception. However, fail() should be implemented even when all known failure modes do not throw exceptions, to ensure that unexpected exceptions thrown in lower-level code are properly handled.
Implements lsst::meas::base::BaseAlgorithm.
Definition at line 399 of file simpleShape.cc.
|
static |
Definition at line 37 of file simpleShape.cc.
|
inlineinherited |
Definition at line 66 of file Algorithm.h.
|
virtual |
Called to measure a single child source in an image.
Before this method is called, all neighbors will be replaced with noise, using the outputs of the deblender. Outputs should be saved in the given SourceRecord, which can also be used to obtain centroid (see SafeCentroidExtractor) and shape (see SafeShapeExtractor) information.
Implements lsst::meas::base::SingleFrameAlgorithm.
Definition at line 388 of file simpleShape.cc.
|
inlineoverridevirtualinherited |
Called to measure a single child source in an image.
Before this method is called, all neighbors will be replaced with noise, using the outputs of the deblender. Outputs should be saved in the given SourceRecord, which can also be used to obtain centroid (see SafeCentroidExtractor) and shape (see SafeShapeExtractor) information.
Implements lsst::meas::base::ForcedAlgorithm.
Reimplemented in lsst::meas::extensions::photometryKron::KronFluxAlgorithm.
Definition at line 172 of file Algorithm.h.
|
virtualinherited |
Called to simultaneously measure all children in a deblend family, in a single image.
Outputs should be saved in the given SourceCatalog, which can also be used to obtain centroid (see SafeCentroidExtractor) and shape (see SafeShapeExtractor) information.
The default implementation simply throws an exception, indicating that simultaneous measurement is not supported.
Definition at line 31 of file Algorithm.cc.
|
inlineoverridevirtualinherited |
Called to simultaneously measure all children in a deblend family, in a single image.
Outputs should be saved in the given SourceCatalog, which can also be used to obtain centroid (see SafeCentroidExtractor) and shape (see SafeShapeExtractor) information.
The default implementation simply throws an exception, indicating that simultaneous measurement is not supported.
Reimplemented from lsst::meas::base::ForcedAlgorithm.
Definition at line 179 of file Algorithm.h.
|
protectedinherited |
Definition at line 69 of file Algorithm.h.
|
static |
Definition at line 101 of file simpleShape.h.
|
static |
Definition at line 100 of file simpleShape.h.