lsst.meas.extensions.simpleShape
20.0.0+e70e326ab6
|
#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 |
virtual void | fail (afw::table::SourceRecord &measRecord, lsst::meas::base::MeasurementError *error=NULL) const |
virtual void | measureForced (afw::table::SourceRecord &measRecord, afw::image::Exposure< float > const &exposure, afw::table::SourceRecord const &refRecord, afw::geom::SkyWcs const &refWcs) const |
virtual void | measureNForced (afw::table::SourceCatalog const &measCat, afw::image::Exposure< float > const &exposure, afw::table::SourceCatalog const &refRecord, afw::geom::SkyWcs const &refWcs) const |
virtual void | measureN (afw::table::SourceCatalog const &measCat, afw::image::Exposure< float > const &exposure) const |
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. More... | |
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. More... | |
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. More... | |
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 |
Implements lsst::meas::base::SimpleAlgorithm.
Definition at line 399 of file simpleShape.cc.
|
static |
Definition at line 37 of file simpleShape.cc.
|
virtual |
Implements lsst::meas::base::SimpleAlgorithm.
Definition at line 388 of file simpleShape.cc.
|
static |
Definition at line 101 of file simpleShape.h.
|
static |
Definition at line 100 of file simpleShape.h.