lsst.meas.algorithms g1581cd22ba+880e5d07f7
Loading...
Searching...
No Matches
lsst::meas::algorithms::SpanSetMoments Struct Reference

A struct that computes the unweighted moments of the pixels in an lsst.afw.geom.SpanSet. More...

#include <SpanSetMoments.h>

Public Member Functions

bool any_flags_set () const
 Test whether any failure flag is set.
 
ndarray::Array< float, 1, 1 > get_x_array () const
 Return a flattened array of the x coordinates in spans.
 
ndarray::Array< float, 1, 1 > get_y_array () const
 Return a flattened array of the y coordinates in spans.
 

Static Public Member Functions

static std::shared_ptr< SpanSetMomentscompute (afw::geom::SpanSet const &spans, afw::image::MaskedImage< float > const &masked_image, afw::image::MaskPixel bad_bitmask, double bad_pixel_max_fraction, double bad_pixel_exclusion_radius)
 Compute the unweighted moments of an image within a SpanSet.
 
static shapelet::ShapeletFunction fit_shapelets (afw::image::MaskedImage< float > const &masked_image, std::vector< std::shared_ptr< SpanSetMoments > > const &moments, int order, double scale)
 Fit a common shapelet expansion to multiple sources whose moments have already been computed.
 

Public Attributes

double flux
 Total flux within the SpanSet.
 
double variance
 Total variance within the SpanSet.
 
geom::Point2D center
 Center derived from the unweighted first moment of the image.
 
afw::geom::ellipses::Quadrupole shape
 Shape derived from the unweighted second moment of the image.
 
std::shared_ptr< afw::geom::SpanSetspans
 The pixels actually used to compute the moments.
 
bool too_many_bad_pixels = false
 Flag set if there were too many bad pixels to compute the moments.
 
bool center_out_of_bounds = false
 Flag set if the center did not lie within the SpanSet.
 
bool bad_pixel_in_center = false
 Flag set if there was a bad pixel too close to the center.
 
bool singular_second_moments = false
 Flag set if the second moments did not resolve to an ellipse.
 

Detailed Description

A struct that computes the unweighted moments of the pixels in an lsst.afw.geom.SpanSet.

This class provides low-level pixel-processing code for ComputeRoughPsfShapeletsTask.

Definition at line 45 of file SpanSetMoments.h.

Member Function Documentation

◆ any_flags_set()

bool lsst::meas::algorithms::SpanSetMoments::any_flags_set ( ) const
inline

Test whether any failure flag is set.

Definition at line 75 of file SpanSetMoments.h.

◆ compute()

std::shared_ptr< SpanSetMoments > lsst::meas::algorithms::SpanSetMoments::compute ( afw::geom::SpanSet const & spans,
afw::image::MaskedImage< float > const & masked_image,
afw::image::MaskPixel bad_bitmask,
double bad_pixel_max_fraction,
double bad_pixel_exclusion_radius )
static

Compute the unweighted moments of an image within a SpanSet.

Parameters
[in]spansPixel region to use.
[in]masked_imageImage to measure.
[in]bad_bitmaskMask of bad pixels to remove from spans before computing the moments.
[in]bad_pixel_mask_fractionMaximum fraction of the pixels in spans that can be bad before giving up.
[in]bad_pixel_exlusion_radiusRadius around the estimated center where the present of a bad pixels will cause the algorithm to give up.

Definition at line 51 of file SpanSetMoments.cc.

◆ fit_shapelets()

shapelet::ShapeletFunction lsst::meas::algorithms::SpanSetMoments::fit_shapelets ( afw::image::MaskedImage< float > const & masked_image,
std::vector< std::shared_ptr< SpanSetMoments > > const & moments,
int order,
double scale )
static

Fit a common shapelet expansion to multiple sources whose moments have already been computed.

The expected use case is a sample of stars with similar but not identical moments, which might plausibly have an approximately common shapelet representation while benefitting from allowing the ellipse used for the expansion to vary (i.e. to partially capture spatial variation in the PSF).

Parameters
[in]masked_imageImage to measure.
[in]momentsMoments already measured on stars.
[in]orderOrder of the shapelet expansion.
[in]scaleFactor to scale the moments ellipses by to yield the ellipse for the shapelet fit.

Definition at line 126 of file SpanSetMoments.cc.

◆ get_x_array()

ndarray::Array< float, 1, 1 > lsst::meas::algorithms::SpanSetMoments::get_x_array ( ) const

Return a flattened array of the x coordinates in spans.

Definition at line 37 of file SpanSetMoments.cc.

◆ get_y_array()

ndarray::Array< float, 1, 1 > lsst::meas::algorithms::SpanSetMoments::get_y_array ( ) const

Return a flattened array of the y coordinates in spans.

Definition at line 44 of file SpanSetMoments.cc.

Member Data Documentation

◆ bad_pixel_in_center

bool lsst::meas::algorithms::SpanSetMoments::bad_pixel_in_center = false

Flag set if there was a bad pixel too close to the center.

Definition at line 69 of file SpanSetMoments.h.

◆ center

geom::Point2D lsst::meas::algorithms::SpanSetMoments::center

Center derived from the unweighted first moment of the image.

Definition at line 54 of file SpanSetMoments.h.

◆ center_out_of_bounds

bool lsst::meas::algorithms::SpanSetMoments::center_out_of_bounds = false

Flag set if the center did not lie within the SpanSet.

Definition at line 66 of file SpanSetMoments.h.

◆ flux

double lsst::meas::algorithms::SpanSetMoments::flux

Total flux within the SpanSet.

Definition at line 48 of file SpanSetMoments.h.

◆ shape

afw::geom::ellipses::Quadrupole lsst::meas::algorithms::SpanSetMoments::shape

Shape derived from the unweighted second moment of the image.

Definition at line 57 of file SpanSetMoments.h.

◆ singular_second_moments

bool lsst::meas::algorithms::SpanSetMoments::singular_second_moments = false

Flag set if the second moments did not resolve to an ellipse.

Definition at line 72 of file SpanSetMoments.h.

◆ spans

std::shared_ptr<afw::geom::SpanSet> lsst::meas::algorithms::SpanSetMoments::spans

The pixels actually used to compute the moments.

Definition at line 60 of file SpanSetMoments.h.

◆ too_many_bad_pixels

bool lsst::meas::algorithms::SpanSetMoments::too_many_bad_pixels = false

Flag set if there were too many bad pixels to compute the moments.

Definition at line 63 of file SpanSetMoments.h.

◆ variance

double lsst::meas::algorithms::SpanSetMoments::variance

Total variance within the SpanSet.

Definition at line 51 of file SpanSetMoments.h.


The documentation for this struct was generated from the following files: