LSSTApplications  18.0.0+56,19.0.0+1,19.0.0+18,19.0.0+19,19.0.0+21,19.0.0+26,19.0.0+5,19.0.0-1-g20d9b18+12,19.0.0-1-g425ff20,19.0.0-1-g5549ca4,19.0.0-1-g580fafe+12,19.0.0-1-g6fe20d0+4,19.0.0-1-g8c57eb9+12,19.0.0-1-ga72da6b,19.0.0-1-gbfe0924+3,19.0.0-1-gdc0e4a7+17,19.0.0-1-ge272bc4+12,19.0.0-1-ge3aa853+3,19.0.0-16-g3a790c8c,19.0.0-18-g955d782+1,19.0.0-2-g0d9f9cd+19,19.0.0-2-g260436e+3,19.0.0-2-g9b11441+6,19.0.0-2-gd955cfd+25,19.0.0-3-g6513920+3,19.0.0-3-gc4f6e04+2,19.0.0-4-g41ffa1d+5,19.0.0-4-g725f80e+21,19.0.0-5-g0745e3f+3,19.0.0-6-g5a632bb5+1,19.0.0-6-gb6b8b0a+3,19.0.0-7-g686a884,19.0.0-7-gea0a0fe+8,19.0.0-9-gd2f60f3c3,w.2020.03
LSSTDataManagementBasePackage
Namespaces | Classes | Functions | Variables
lsst::meas::extensions::photometryKron Namespace Reference

Namespaces

 version
 

Classes

class  BadKronException
 
class  KronAperture
 
class  KronFluxAlgorithm
 A measurement algorithm that estimates flux using Kron photometry. More...
 
class  KronFluxControl
 C++ control object for Kron flux. More...
 

Functions

 PYBIND11_MODULE (photometryKron, mod)
 
template<typename ImageT >
std::pair< double, double > photometer (ImageT const &image, afw::geom::ellipses::Ellipse const &aperture, double const maxSincRadius)
 
double calculatePsfKronRadius (boost::shared_ptr< afw::detection::Psf const > const &psf, geom::Point2D const &center, double smoothingSigma=0.0)
 
template boost::shared_ptr< KronApertureKronAperture::determineRadius< afw::image::MaskedImage< float > > (afw::image::MaskedImage< float > const &, afw::geom::ellipses::Axes, geom::Point2D const &, KronFluxControl const &)
 
template std::pair< double, double > KronAperture::measureFlux< afw::image::MaskedImage< float > > (afw::image::MaskedImage< float > const &, double const, double const) const
 

Variables

 KronFluxPlugin
 
 KronFluxForcedPlugin
 
 name
 
 Control
 
 executionOrder
 
 shouldApCorr
 
 needsMetadata
 

Function Documentation

◆ calculatePsfKronRadius()

double lsst::meas::extensions::photometryKron::calculatePsfKronRadius ( boost::shared_ptr< afw::detection::Psf const > const &  psf,
geom::Point2D const &  center,
double  smoothingSigma = 0.0 
)

Definition at line 332 of file KronPhotometry.cc.

337 {
338  assert(psf);
339  double const radius = psf->computeShape(center).getDeterminantRadius();
340  // For a Gaussian N(0, sigma^2), the Kron radius is sqrt(pi/2)*sigma
341  return ::sqrt(geom::PI/2)*::hypot(radius, std::max(0.0, smoothingSigma));
342 }
T max(T... args)
double constexpr PI
The ratio of a circle&#39;s circumference to diameter.
Definition: Angle.h:39

◆ KronAperture::determineRadius< afw::image::MaskedImage< float > >()

◆ KronAperture::measureFlux< afw::image::MaskedImage< float > >()

template std::pair<double, double> lsst::meas::extensions::photometryKron::KronAperture::measureFlux< afw::image::MaskedImage< float > > ( afw::image::MaskedImage< float > const &  ,
double  const,
double  const 
) const

◆ photometer()

template<typename ImageT >
std::pair<double, double> lsst::meas::extensions::photometryKron::photometer ( ImageT const &  image,
afw::geom::ellipses::Ellipse const &  aperture,
double const  maxSincRadius 
)

Definition at line 305 of file KronPhotometry.cc.

310 {
311  afw::geom::ellipses::Axes const& axes = aperture.getCore();
312  if (axes.getB() > maxSincRadius) {
313  FootprintFlux<ImageT> fluxFunctor;
314  auto spans = afw::geom::SpanSet::fromShape(aperture);
315  spans->applyFunctor(
316  fluxFunctor, *(image.getImage()), *(image.getVariance()));
317  return std::make_pair(fluxFunctor.getSum(), ::sqrt(fluxFunctor.getSumVar()));
318  }
319  try {
320  base::ApertureFluxResult fluxResult = base::ApertureFluxAlgorithm::computeSincFlux<float>(image, aperture);
321  return std::make_pair(fluxResult.instFlux, fluxResult.instFluxErr);
322  } catch(pex::exceptions::LengthError &e) {
323  LSST_EXCEPT_ADD(e, (boost::format("Measuring Kron flux for object at (%.3f, %.3f);"
324  " aperture radius %g,%g theta %g")
325  % aperture.getCenter().getX() % aperture.getCenter().getY()
326  % axes.getA() % axes.getB() % geom::radToDeg(axes.getTheta())).str());
327  throw e;
328  }
329 }
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
Definition: history.py:174
afw::table::Key< afw::table::Array< ImagePixelT > > image
T make_pair(T... args)
Backwards-compatibility support for depersisting the old Calib (FluxMag0/FluxMag0Err) objects...
#define LSST_EXCEPT_ADD(e, m)
Add the current location and a message to an existing exception before rethrowing it...
Definition: Exception.h:54

◆ PYBIND11_MODULE()

lsst::meas::extensions::photometryKron::PYBIND11_MODULE ( photometryKron  ,
mod   
)

Definition at line 132 of file photometryKron.cc.

132  {
133  py::module::import("lsst.afw.geom");
134  py::module::import("lsst.afw.image");
135  py::module::import("lsst.afw.table");
136  py::module::import("lsst.daf.base");
137 
138  declareKronFluxControl(mod);
139  declareKronFluxAlgorithm(mod);
140  declareKronAperture(mod);
141 }

Variable Documentation

◆ Control

lsst.meas.extensions.photometryKron.Control

Definition at line 31 of file __init__.py.

◆ executionOrder

lsst.meas.extensions.photometryKron.executionOrder

Definition at line 32 of file __init__.py.

◆ KronFluxForcedPlugin

lsst.meas.extensions.photometryKron.KronFluxForcedPlugin

Definition at line 28 of file __init__.py.

◆ KronFluxPlugin

lsst.meas.extensions.photometryKron.KronFluxPlugin

Definition at line 28 of file __init__.py.

◆ name

lsst.meas.extensions.photometryKron.name

Definition at line 30 of file __init__.py.

◆ needsMetadata

lsst.meas.extensions.photometryKron.needsMetadata

Definition at line 34 of file __init__.py.

◆ shouldApCorr

lsst.meas.extensions.photometryKron.shouldApCorr

Definition at line 33 of file __init__.py.