LSSTApplications  19.0.0-14-gb0260a2+72efe9b372,20.0.0+7927753e06,20.0.0+8829bf0056,20.0.0+995114c5d2,20.0.0+b6f4b2abd1,20.0.0+bddc4f4cbe,20.0.0-1-g253301a+8829bf0056,20.0.0-1-g2b7511a+0d71a2d77f,20.0.0-1-g5b95a8c+7461dd0434,20.0.0-12-g321c96ea+23efe4bbff,20.0.0-16-gfab17e72e+fdf35455f6,20.0.0-2-g0070d88+ba3ffc8f0b,20.0.0-2-g4dae9ad+ee58a624b3,20.0.0-2-g61b8584+5d3db074ba,20.0.0-2-gb780d76+d529cf1a41,20.0.0-2-ged6426c+226a441f5f,20.0.0-2-gf072044+8829bf0056,20.0.0-2-gf1f7952+ee58a624b3,20.0.0-20-geae50cf+e37fec0aee,20.0.0-25-g3dcad98+544a109665,20.0.0-25-g5eafb0f+ee58a624b3,20.0.0-27-g64178ef+f1f297b00a,20.0.0-3-g4cc78c6+e0676b0dc8,20.0.0-3-g8f21e14+4fd2c12c9a,20.0.0-3-gbd60e8c+187b78b4b8,20.0.0-3-gbecbe05+48431fa087,20.0.0-38-ge4adf513+a12e1f8e37,20.0.0-4-g97dc21a+544a109665,20.0.0-4-gb4befbc+087873070b,20.0.0-4-gf910f65+5d3db074ba,20.0.0-5-gdfe0fee+199202a608,20.0.0-5-gfbfe500+d529cf1a41,20.0.0-6-g64f541c+d529cf1a41,20.0.0-6-g9a5b7a1+a1cd37312e,20.0.0-68-ga3f3dda+5fca18c6a4,20.0.0-9-g4aef684+e18322736b,w.2020.45
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 333 of file KronPhotometry.cc.

338 {
339  assert(psf);
340  double const radius = psf->computeShape(center).getDeterminantRadius();
341  // For a Gaussian N(0, sigma^2), the Kron radius is sqrt(pi/2)*sigma
342  return ::sqrt(geom::PI/2)*::hypot(radius, std::max(0.0, smoothingSigma));
343 }

◆ 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 306 of file KronPhotometry.cc.

311 {
312  afw::geom::ellipses::Axes const& axes = aperture.getCore();
313  if (axes.getB() > maxSincRadius) {
314  FootprintFlux<ImageT> fluxFunctor;
315  auto spans = afw::geom::SpanSet::fromShape(aperture);
316  spans->applyFunctor(
317  fluxFunctor, *(image.getImage()), *(image.getVariance()));
318  return std::make_pair(fluxFunctor.getSum(), ::sqrt(fluxFunctor.getSumVar()));
319  }
320  try {
321  base::ApertureFluxResult fluxResult = base::ApertureFluxAlgorithm::computeSincFlux<float>(image, aperture);
322  return std::make_pair(fluxResult.instFlux, fluxResult.instFluxErr);
323  } catch(pex::exceptions::LengthError &e) {
324  LSST_EXCEPT_ADD(e, (boost::format("Measuring Kron flux for object at (%.3f, %.3f);"
325  " aperture radius %g,%g theta %g")
326  % aperture.getCenter().getX() % aperture.getCenter().getY()
327  % axes.getA() % axes.getB() % geom::radToDeg(axes.getTheta())).str());
328  throw e;
329  }
330 }

◆ 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.

lsst::afw::image
Backwards-compatibility support for depersisting the old Calib (FluxMag0/FluxMag0Err) objects.
Definition: imageAlgorithm.dox:1
lsst::geom::radToDeg
constexpr double radToDeg(double x) noexcept
Definition: Angle.h:52
lsst::geom::PI
constexpr double PI
The ratio of a circle's circumference to diameter.
Definition: Angle.h:39
LSST_EXCEPT_ADD
#define LSST_EXCEPT_ADD(e, m)
Add the current location and a message to an existing exception before rethrowing it.
Definition: Exception.h:54
psf
Key< int > psf
Definition: Exposure.cc:65
lsst.pex.config.history.format
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
Definition: history.py:174
lsst.pipe.tasks.processCcdWithFakes.radius
radius
Definition: processCcdWithFakes.py:345
std::sqrt
T sqrt(T... args)
std::make_pair
T make_pair(T... args)
std::max
T max(T... args)