LSST Applications  21.0.0-172-gfb10e10a+18fedfabac,22.0.0+297cba6710,22.0.0+80564b0ff1,22.0.0+8d77f4f51a,22.0.0+a28f4c53b1,22.0.0+dcf3732eb2,22.0.1-1-g7d6de66+2a20fdde0d,22.0.1-1-g8e32f31+297cba6710,22.0.1-1-geca5380+7fa3b7d9b6,22.0.1-12-g44dc1dc+2a20fdde0d,22.0.1-15-g6a90155+515f58c32b,22.0.1-16-g9282f48+790f5f2caa,22.0.1-2-g92698f7+dcf3732eb2,22.0.1-2-ga9b0f51+7fa3b7d9b6,22.0.1-2-gd1925c9+bf4f0e694f,22.0.1-24-g1ad7a390+a9625a72a8,22.0.1-25-g5bf6245+3ad8ecd50b,22.0.1-25-gb120d7b+8b5510f75f,22.0.1-27-g97737f7+2a20fdde0d,22.0.1-32-gf62ce7b1+aa4237961e,22.0.1-4-g0b3f228+2a20fdde0d,22.0.1-4-g243d05b+871c1b8305,22.0.1-4-g3a563be+32dcf1063f,22.0.1-4-g44f2e3d+9e4ab0f4fa,22.0.1-42-gca6935d93+ba5e5ca3eb,22.0.1-5-g15c806e+85460ae5f3,22.0.1-5-g58711c4+611d128589,22.0.1-5-g75bb458+99c117b92f,22.0.1-6-g1c63a23+7fa3b7d9b6,22.0.1-6-g50866e6+84ff5a128b,22.0.1-6-g8d3140d+720564cf76,22.0.1-6-gd805d02+cc5644f571,22.0.1-8-ge5750ce+85460ae5f3,master-g6e05de7fdc+babf819c66,master-g99da0e417a+8d77f4f51a,w.2021.48
LSST Data Management Base Package
Classes | Public Types | Static Public Member Functions | List of all members
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. More...
 
static std::shared_ptr< CoeffT const > get (afw::geom::ellipses::Axes const &outerEllipse, float const innerRadiusFactor=0.0)
 Get the coefficients for an aperture. More...
 
static std::shared_ptr< CoeffTcalculate (afw::geom::ellipses::Axes const &outerEllipse, double const innerFactor=0.0)
 Calculate the coefficients for an aperture. More...
 

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 491 of file SincCoeffs.cc.

491  {
492  if (r1 < 0.0 || r2 < r1) {
493  throw LSST_EXCEPT(pex::exceptions::InvalidParameterError,
494  (boost::format("Invalid r1,r2 = %f,%f") % r1 % r2).str());
495  }
496  double const innerFactor = r1 / r2;
497  afw::geom::ellipses::Axes axes(r2, r2, 0.0);
498  if (!getInstance()._lookup(axes, innerFactor)) {
500  getInstance()._cache[r2][innerFactor] = coeff;
501  }
502 }
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition: Exception.h:48
static std::shared_ptr< CoeffT > calculate(afw::geom::ellipses::Axes const &outerEllipse, double const innerFactor=0.0)
Calculate the coefficients for an aperture.
Definition: SincCoeffs.cc:535
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
Definition: history.py:174
table::Key< table::Array< double > > coeff
Definition: PsfexPsf.cc:362

◆ 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 535 of file SincCoeffs.cc.

535  {
536  if (innerFactor < 0.0 || innerFactor > 1.0) {
537  throw LSST_EXCEPT(pex::exceptions::InvalidParameterError,
538  (boost::format("innerFactor = %f is not between 0 and 1") % innerFactor).str());
539  }
540 
541  // Kspace-real is fastest, but only slightly faster than kspace cplx
542  // but real won't work for elliptical apertures due to symmetries assumed for real transform
543 
544  double const rad1 = axes.getA() * innerFactor;
545  double const rad2 = axes.getA();
546  // if there's no angle and no ellipticity
547  if (FuzzyCompare<float>().isEqual(axes.getA(), axes.getB())) {
548  // here we call the real transform
549  return calcImageKSpaceReal<PixelT>(rad1, rad2);
550  } else {
551  // here we call the complex transform
552  double const ellipticity = 1.0 - axes.getB() / axes.getA();
553  return calcImageKSpaceCplx<PixelT>(rad1, rad2, axes.getTheta(), ellipticity);
554  }
555 }

◆ 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 506 of file SincCoeffs.cc.

506  {
507  std::shared_ptr<CoeffT const> coeff = getInstance()._lookup(axes, innerFactor);
508  return coeff ? coeff : calculate(axes, innerFactor);
509 }

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