LSST Applications g04a91732dc+146a938ab0,g07dc498a13+80b84b0d75,g0fba68d861+0decac7526,g1409bbee79+80b84b0d75,g1a7e361dbc+80b84b0d75,g1fd858c14a+f6e422e056,g20f46db602+483a84333a,g21d47ad084+4a6cd485de,g35bb328faa+fcb1d3bbc8,g42c1b31a95+a1301e4c20,g4d39ba7253+9b833be27e,g4e0f332c67+5d362be553,g53246c7159+fcb1d3bbc8,g60b5630c4e+9b833be27e,g78460c75b0+2f9a1b4bcd,g786e29fd12+cf7ec2a62a,g7b71ed6315+fcb1d3bbc8,g8852436030+790117df0f,g89139ef638+80b84b0d75,g8d6b6b353c+9b833be27e,g9125e01d80+fcb1d3bbc8,g989de1cb63+80b84b0d75,g9f33ca652e+9c6b68d7f3,ga9baa6287d+9b833be27e,gaaedd4e678+80b84b0d75,gabe3b4be73+1e0a283bba,gb1101e3267+9f3571abad,gb58c049af0+f03b321e39,gb90eeb9370+691e4ab549,gc741bbaa4f+5f483edd21,gcf25f946ba+790117df0f,gd24842266e+c54cdbdbd2,gd315a588df+5b65d88fe4,gd6cbbdb0b4+c8606af20c,gd9a9a58781+fcb1d3bbc8,gde0f65d7ad+c99546153d,ge278dab8ac+932305ba37,ge82c20c137+76d20ab76d,w.2025.10
LSST Data Management Base Package
Loading...
Searching...
No Matches
lsst::meas::base::SincCoeffs< PixelT > Class Template Reference

A singleton to calculate and cache the coefficients for sinc photometry. More...

#include <SincCoeffs.h>

Public Types

typedef afw::image::Image< PixelT > CoeffT
 

Static Public Member Functions

static void cache (float rInner, float rOuter)
 Cache the coefficients for a particular aperture.
 
static std::shared_ptr< CoeffT const > get (afw::geom::ellipses::Axes const &outerEllipse, float const innerRadiusFactor=0.0)
 Get the coefficients for an aperture.
 
static std::shared_ptr< CoeffTcalculate (afw::geom::ellipses::Axes const &outerEllipse, double const innerFactor=0.0)
 Calculate the coefficients for an aperture.
 

Detailed Description

template<typename PixelT>
class lsst::meas::base::SincCoeffs< PixelT >

A singleton to calculate and cache the coefficients for sinc photometry.

Caching is only performed for circular apertures (because elliptical apertures are assumed to be generated dynamically, and hence not expected to recur). Caching must be explicitly requested for a particular circular aperture (using the 'cache' method).

Definition at line 45 of file SincCoeffs.h.

Member Typedef Documentation

◆ CoeffT

template<typename PixelT>
typedef afw::image::Image<PixelT> lsst::meas::base::SincCoeffs< PixelT >::CoeffT

Definition at line 47 of file SincCoeffs.h.

Member Function Documentation

◆ cache()

template<typename PixelT>
void lsst::meas::base::SincCoeffs< PixelT >::cache ( float rInner,
float rOuter )
static

Cache the coefficients for a particular aperture.

The aperture is a circular annulus.

Definition at line 499 of file SincCoeffs.cc.

499 {
500 if (r1 < 0.0 || r2 < r1) {
502 (boost::format("Invalid r1,r2 = %f,%f") % r1 % r2).str());
503 }
504 double const innerFactor = r1 / r2;
506 if (!getInstance()._lookup(axes, innerFactor)) {
508 getInstance()._cache[r2][innerFactor] = coeff;
509 }
510}
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition Exception.h:48
A singleton to calculate and cache the coefficients for sinc photometry.
Definition SincCoeffs.h:45
static std::shared_ptr< CoeffT > calculate(afw::geom::ellipses::Axes const &outerEllipse, double const innerFactor=0.0)
Calculate the coefficients for an aperture.

◆ calculate()

template<typename PixelT>
std::shared_ptr< typename SincCoeffs< PixelT >::CoeffT > lsst::meas::base::SincCoeffs< PixelT >::calculate ( afw::geom::ellipses::Axes const & outerEllipse,
double const innerFactor = 0.0 )
static

Calculate the coefficients for an aperture.

Definition at line 543 of file SincCoeffs.cc.

543 {
546 (boost::format("innerFactor = %f is not between 0 and 1") % innerFactor).str());
547 }
548
549 // Kspace-real is fastest, but only slightly faster than kspace cplx
550 // but real won't work for elliptical apertures due to symmetries assumed for real transform
551
552 double const rad1 = axes.getA() * innerFactor;
553 double const rad2 = axes.getA();
554 // if there's no angle and no ellipticity
555 if (FuzzyCompare<float>().isEqual(axes.getA(), axes.getB())) {
556 // here we call the real transform
558 } else {
559 // here we call the complex transform
560 double const ellipticity = 1.0 - axes.getB() / axes.getA();
562 }
563}

◆ get()

template<typename PixelT>
std::shared_ptr< typename SincCoeffs< PixelT >::CoeffT const > lsst::meas::base::SincCoeffs< PixelT >::get ( afw::geom::ellipses::Axes const & outerEllipse,
float const innerRadiusFactor = 0.0 )
static

Get the coefficients for an aperture.

Coefficients are retrieved from the cache, if available; otherwise they will be generated.

Definition at line 514 of file SincCoeffs.cc.

514 {
515 std::shared_ptr<CoeffT const> coeff = getInstance()._lookup(axes, innerFactor);
516 return coeff ? coeff : calculate(axes, innerFactor);
517}

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