LSSTApplications  18.1.0
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, afw::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, afw::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,
afw::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(afw::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() % afw::geom::radToDeg(axes.getTheta())).str());
327  throw e;
328  }
329 }
constexpr double radToDeg(double x) noexcept
Definition: Angle.h:52
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
Definition: history.py:168
T make_pair(T... args)
afw::table::Key< afw::table::Array< ImagePixelT > > image
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.