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
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
lsst::ip::diffim::PsfDipoleFlux Class Reference

Implementation of Psf dipole flux. More...

#include <DipoleAlgorithms.h>

Inheritance diagram for lsst::ip::diffim::PsfDipoleFlux:
lsst::ip::diffim::DipoleFluxAlgorithm lsst::meas::base::SimpleAlgorithm lsst::meas::base::SingleFrameAlgorithm lsst::meas::base::ForcedAlgorithm lsst::meas::base::BaseAlgorithm lsst::meas::base::BaseAlgorithm

Public Types

typedef PsfDipoleFluxControl Control
 
typedef meas::base::FluxResultKey ResultKey
 

Public Member Functions

 PsfDipoleFlux (PsfDipoleFluxControl const &ctrl, std::string const &name, afw::table::Schema &schema)
 
std::pair< double, int > chi2 (afw::table::SourceRecord &source, afw::image::Exposure< float > const &exposure, double negCenterX, double negCenterY, double negFlux, double posCenterX, double poCenterY, double posFlux) const
 
void measure (afw::table::SourceRecord &measRecord, afw::image::Exposure< float > const &exposure) const
 Called to measure a single child source in an image. More...
 
void fail (afw::table::SourceRecord &measRecord, meas::base::MeasurementError *error=NULL) const
 Handle an exception thrown by the current algorithm by setting flags in the given record. More...
 
ResultKey const & getPositiveKeys () const
 Return the standard flux keys registered by this algorithm. More...
 
ResultKey const & getNegativeKeys () const
 
virtual void measureForced (afw::table::SourceRecord &measRecord, afw::image::Exposure< float > const &exposure, afw::table::SourceRecord const &refRecord, afw::geom::SkyWcs const &refWcs) const
 Called to measure a single child source in an image. More...
 
virtual void measureNForced (afw::table::SourceCatalog const &measCat, afw::image::Exposure< float > const &exposure, afw::table::SourceCatalog const &refRecord, afw::geom::SkyWcs const &refWcs) const
 Called to simultaneously measure all children in a deblend family, in a single image. More...
 
virtual void measureN (afw::table::SourceCatalog const &measCat, afw::image::Exposure< float > const &exposure) const
 Called to simultaneously measure all children in a deblend family, in a single image. More...
 
std::string getLogName () const
 

Static Public Member Functions

static meas::base::FlagDefinitionList const & getFlagDefinitions ()
 

Static Public Attributes

static meas::base::FlagDefinition const FAILURE = dipoleFluxFlagDefinitions.addFailureFlag("general failure flag, set if anything went wrong")
 
static meas::base::FlagDefinition const POS_FLAG = dipoleFluxFlagDefinitions.add("pos_flag", "failure flag for positive, set if anything went wrong")
 
static meas::base::FlagDefinition const NEG_FLAG = dipoleFluxFlagDefinitions.add("neg_flag", "failure flag for negative, set if anything went wrong")
 

Protected Attributes

meas::base::FluxResultKey _fluxResultKey
 
meas::base::FlagHandler _flagHandler
 
ResultKey _positiveKeys
 
ResultKey _negativeKeys
 
std::string _logName
 

Detailed Description

Implementation of Psf dipole flux.

Definition at line 289 of file DipoleAlgorithms.h.

Member Typedef Documentation

◆ Control

Definition at line 292 of file DipoleAlgorithms.h.

◆ ResultKey

Definition at line 131 of file DipoleAlgorithms.h.

Constructor & Destructor Documentation

◆ PsfDipoleFlux()

lsst::ip::diffim::PsfDipoleFlux::PsfDipoleFlux ( PsfDipoleFluxControl const &  ctrl,
std::string const &  name,
afw::table::Schema schema 
)
inline

Definition at line 294 of file DipoleAlgorithms.h.

294  :
295  DipoleFluxAlgorithm(ctrl, name, schema, "jointly fitted psf flux counts"),
296  _ctrl(ctrl),
297  _chi2dofKey(schema.addField<float>(name+"_chi2dof",
298  "chi2 per degree of freedom of fit"))
299  {
300  meas::base::CentroidResultKey::addFields(schema, name+"_pos_centroid", "psf fitted center of positive lobe", meas::base::SIGMA_ONLY);
301  meas::base::CentroidResultKey::addFields(schema, name+"_neg_centroid", "psf fitted center of negative lobe", meas::base::SIGMA_ONLY);
302  meas::base::CentroidResultKey::addFields(schema, name+"_centroid", "average of negative and positive lobe positions", meas::base::SIGMA_ONLY);
303  _posCentroid = meas::base::CentroidResultKey(schema[name+"_pos_centroid"]);
304  _negCentroid = meas::base::CentroidResultKey(schema[name+"_neg_centroid"]);
305  _avgCentroid = meas::base::CentroidResultKey(schema[name+"_centroid"]);
306  }

Member Function Documentation

◆ chi2()

std::pair< double, int > lsst::ip::diffim::PsfDipoleFlux::chi2 ( afw::table::SourceRecord source,
afw::image::Exposure< float > const &  exposure,
double  negCenterX,
double  negCenterY,
double  negFlux,
double  posCenterX,
double  poCenterY,
double  posFlux 
) const

Definition at line 352 of file DipoleAlgorithms.cc.

357  {
358 
359  geom::Point2D negCenter(negCenterX, negCenterY);
360  geom::Point2D posCenter(posCenterX, posCenterY);
361 
362  CONST_PTR(afw::detection::Footprint) footprint = source.getFootprint();
363 
364  /*
365  * Fit for the superposition of Psfs at the two centroids.
366  */
367  CONST_PTR(afwDet::Psf) psf = exposure.getPsf();
368  PTR(afwImage::Image<afwMath::Kernel::Pixel>) negPsf = psf->computeImage(negCenter);
369  PTR(afwImage::Image<afwMath::Kernel::Pixel>) posPsf = psf->computeImage(posCenter);
370 
371  afwImage::Image<double> negModel(footprint->getBBox());
372  afwImage::Image<double> posModel(footprint->getBBox());
373  afwImage::Image<float> data(*(exposure.getMaskedImage().getImage()),footprint->getBBox());
374  afwImage::Image<afwImage::VariancePixel> var(*(exposure.getMaskedImage().getVariance()),
375  footprint->getBBox());
376 
377  geom::Box2I negPsfBBox = negPsf->getBBox();
378  geom::Box2I posPsfBBox = posPsf->getBBox();
379  geom::Box2I negModelBBox = negModel.getBBox();
380  geom::Box2I posModelBBox = posModel.getBBox();
381 
382  // Portion of the negative Psf that overlaps the model
383  int negXmin = std::max(negPsfBBox.getMinX(), negModelBBox.getMinX());
384  int negYmin = std::max(negPsfBBox.getMinY(), negModelBBox.getMinY());
385  int negXmax = std::min(negPsfBBox.getMaxX(), negModelBBox.getMaxX());
386  int negYmax = std::min(negPsfBBox.getMaxY(), negModelBBox.getMaxY());
387  geom::Box2I negBBox = geom::Box2I(geom::Point2I(negXmin, negYmin),
388  geom::Point2I(negXmax, negYmax));
389  afwImage::Image<afwMath::Kernel::Pixel> negSubim(*negPsf, negBBox);
390  afwImage::Image<double> negModelSubim(negModel, negBBox);
391  negModelSubim += negSubim;
392 
393  // Portion of the positive Psf that overlaps the model
394  int posXmin = std::max(posPsfBBox.getMinX(), posModelBBox.getMinX());
395  int posYmin = std::max(posPsfBBox.getMinY(), posModelBBox.getMinY());
396  int posXmax = std::min(posPsfBBox.getMaxX(), posModelBBox.getMaxX());
397  int posYmax = std::min(posPsfBBox.getMaxY(), posModelBBox.getMaxY());
398  geom::Box2I posBBox = geom::Box2I(geom::Point2I(posXmin, posYmin),
399  geom::Point2I(posXmax, posYmax));
400  afwImage::Image<afwMath::Kernel::Pixel> posSubim(*posPsf, posBBox);
401  afwImage::Image<double> posModelSubim(posModel, posBBox);
402  posModelSubim += posSubim;
403 
404  negModel *= negFlux; // scale negative model to image
405  posModel *= posFlux; // scale positive model to image
406  afwImage::Image<double> residuals(negModel, true); // full model contains negative lobe...
407  residuals += posModel; // plus positive lobe...
408  residuals -= data; // minus the data...
409  residuals *= residuals; // squared...
410  residuals /= var; // divided by the variance : [(model-data)/sigma]**2
412  double chi2 = stats.getValue(afwMath::SUM);
413  int nPix = stats.getValue(afwMath::NPOINT);
414  return std::pair<double,int>(chi2, nPix);
415 }

◆ fail()

void lsst::ip::diffim::PsfDipoleFlux::fail ( afw::table::SourceRecord measRecord,
meas::base::MeasurementError error = NULL 
) const
virtual

Handle an exception thrown by the current algorithm by setting flags in the given record.

fail() is called by the measurement framework when an exception is allowed to propagate out of one the algorithm's measure() methods. It should generally set both a general failure flag for the algorithm as well as a specific flag indicating the error condition, if possible. To aid in this, if the exception was an instance of MeasurementError, it will be passed in, carrying information about what flag to set.

An algorithm can also to chose to set flags within its own measure() methods, and then just return, rather than throw an exception. However, fail() should be implemented even when all known failure modes do not throw exceptions, to ensure that unexpected exceptions thrown in lower-level code are properly handled.

Implements lsst::meas::base::BaseAlgorithm.

Definition at line 513 of file DipoleAlgorithms.cc.

513  {
514  _flagHandler.handleFailure(measRecord, error);
515 }

◆ getFlagDefinitions()

meas::base::FlagDefinitionList const & lsst::ip::diffim::DipoleFluxAlgorithm::getFlagDefinitions ( )
staticinherited

Definition at line 66 of file DipoleAlgorithms.cc.

66  {
67  return dipoleFluxFlagDefinitions;
68 }

◆ getLogName()

std::string lsst::meas::base::BaseAlgorithm::getLogName ( ) const
inlineinherited

Definition at line 66 of file Algorithm.h.

66 { return _logName; }

◆ getNegativeKeys()

ResultKey const& lsst::ip::diffim::DipoleFluxAlgorithm::getNegativeKeys ( ) const
inlineinherited

Definition at line 134 of file DipoleAlgorithms.h.

134 { return _negativeKeys; }

◆ getPositiveKeys()

ResultKey const& lsst::ip::diffim::DipoleFluxAlgorithm::getPositiveKeys ( ) const
inlineinherited

Return the standard flux keys registered by this algorithm.

Definition at line 133 of file DipoleAlgorithms.h.

133 { return _positiveKeys; }

◆ measure()

void lsst::ip::diffim::PsfDipoleFlux::measure ( afw::table::SourceRecord measRecord,
afw::image::Exposure< float > const &  exposure 
) const
virtual

Called to measure a single child source in an image.

Before this method is called, all neighbors will be replaced with noise, using the outputs of the deblender. Outputs should be saved in the given SourceRecord, which can also be used to obtain centroid (see SafeCentroidExtractor) and shape (see SafeShapeExtractor) information.

Implements lsst::meas::base::SingleFrameAlgorithm.

Definition at line 417 of file DipoleAlgorithms.cc.

420  {
421 
422  typedef afw::image::Exposure<float>::MaskedImageT MaskedImageT;
423 
424  CONST_PTR(afw::detection::Footprint) footprint = source.getFootprint();
425  if (!footprint) {
426  throw LSST_EXCEPT(pex::exceptions::RuntimeError,
427  (boost::format("No footprint for source %d") % source.getId()).str());
428  }
429 
430  afw::detection::PeakCatalog peakCatalog = afw::detection::PeakCatalog(footprint->getPeaks());
431 
432  if (peakCatalog.size() == 0) {
433  throw LSST_EXCEPT(pex::exceptions::RuntimeError,
434  (boost::format("No peak for source %d") % source.getId()).str());
435  }
436  else if (peakCatalog.size() == 1) {
437  // No deblending to do
438  return;
439  }
440 
441  // For N>=2, just measure the brightest-positive and brightest-negative
442  // peaks. peakCatalog is automatically ordered by peak flux, with the most
443  // positive one (brightest) being first
444  afw::detection::PeakRecord const& positivePeak = peakCatalog.front();
445  afw::detection::PeakRecord const& negativePeak = peakCatalog.back();
446 
447  // Set up fit parameters and param names
448  ROOT::Minuit2::MnUserParameters fitPar;
449 
450  fitPar.Add((boost::format("P%d")%NEGCENTXPAR).str(), negativePeak.getFx(), _ctrl.stepSizeCoord);
451  fitPar.Add((boost::format("P%d")%NEGCENTYPAR).str(), negativePeak.getFy(), _ctrl.stepSizeCoord);
452  fitPar.Add((boost::format("P%d")%NEGFLUXPAR).str(), negativePeak.getPeakValue(), _ctrl.stepSizeFlux);
453  fitPar.Add((boost::format("P%d")%POSCENTXPAR).str(), positivePeak.getFx(), _ctrl.stepSizeCoord);
454  fitPar.Add((boost::format("P%d")%POSCENTYPAR).str(), positivePeak.getFy(), _ctrl.stepSizeCoord);
455  fitPar.Add((boost::format("P%d")%POSFLUXPAR).str(), positivePeak.getPeakValue(), _ctrl.stepSizeFlux);
456 
457  // Create the minuit object that knows how to minimise our functor
458  //
459  MinimizeDipoleChi2 minimizerFunc(*this, source, exposure);
460  minimizerFunc.setErrorDef(_ctrl.errorDef);
461 
462  //
463  // tell minuit about it
464  //
465  ROOT::Minuit2::MnMigrad migrad(minimizerFunc, fitPar);
466 
467  //
468  // And let it loose
469  //
470  ROOT::Minuit2::FunctionMinimum min = migrad(_ctrl.maxFnCalls);
471 
472  float minChi2 = min.Fval();
473  bool const isValid = min.IsValid() && std::isfinite(minChi2);
474 
475  if (true || isValid) { // calculate coeffs even in minuit is unhappy
476 
477  /* I need to call chi2 one more time to grab nPix to calculate chi2/dof.
478  Turns out that the Minuit operator method has to be const, and the
479  measurement _apply method has to be const, so I can't store nPix as a
480  private member variable anywhere. Consted into a corner.
481  */
482  std::pair<double,int> fit = chi2(source, exposure,
483  min.UserState().Value(NEGCENTXPAR),
484  min.UserState().Value(NEGCENTYPAR),
485  min.UserState().Value(NEGFLUXPAR),
486  min.UserState().Value(POSCENTXPAR),
487  min.UserState().Value(POSCENTYPAR),
488  min.UserState().Value(POSFLUXPAR));
489  double evalChi2 = fit.first;
490  int nPix = fit.second;
491 
492  PTR(geom::Point2D) minNegCentroid(new geom::Point2D(min.UserState().Value(NEGCENTXPAR),
493  min.UserState().Value(NEGCENTYPAR)));
494  source.set(getNegativeKeys().getInstFlux(), min.UserState().Value(NEGFLUXPAR));
495  source.set(getNegativeKeys().getInstFluxErr(), min.UserState().Error(NEGFLUXPAR));
496 
497  PTR(geom::Point2D) minPosCentroid(new geom::Point2D(min.UserState().Value(POSCENTXPAR),
498  min.UserState().Value(POSCENTYPAR)));
499  source.set(getPositiveKeys().getInstFlux(), min.UserState().Value(POSFLUXPAR));
500  source.set(getPositiveKeys().getInstFluxErr(), min.UserState().Error(POSFLUXPAR));
501 
502  source.set(_chi2dofKey, evalChi2 / (nPix - minimizerFunc.getNpar()));
503  source.set(_negCentroid.getX(), minNegCentroid->getX());
504  source.set(_negCentroid.getY(), minNegCentroid->getY());
505  source.set(_posCentroid.getX(), minPosCentroid->getX());
506  source.set(_posCentroid.getY(), minPosCentroid->getY());
507  source.set(_avgCentroid.getX(), 0.5*(minNegCentroid->getX() + minPosCentroid->getX()));
508  source.set(_avgCentroid.getY(), 0.5*(minNegCentroid->getY() + minPosCentroid->getY()));
509 
510  }
511 }

◆ measureForced()

virtual void lsst::meas::base::SimpleAlgorithm::measureForced ( afw::table::SourceRecord measRecord,
afw::image::Exposure< float > const &  exposure,
afw::table::SourceRecord const &  refRecord,
afw::geom::SkyWcs const &  refWcs 
) const
inlinevirtualinherited

Called to measure a single child source in an image.

Before this method is called, all neighbors will be replaced with noise, using the outputs of the deblender. Outputs should be saved in the given SourceRecord, which can also be used to obtain centroid (see SafeCentroidExtractor) and shape (see SafeShapeExtractor) information.

Implements lsst::meas::base::ForcedAlgorithm.

Reimplemented in lsst::meas::extensions::photometryKron::KronFluxAlgorithm.

Definition at line 172 of file Algorithm.h.

175  {
176  measure(measRecord, exposure);
177  }

◆ measureN()

void lsst::meas::base::SingleFrameAlgorithm::measureN ( afw::table::SourceCatalog const &  measCat,
afw::image::Exposure< float > const &  exposure 
) const
virtualinherited

Called to simultaneously measure all children in a deblend family, in a single image.

Outputs should be saved in the given SourceCatalog, which can also be used to obtain centroid (see SafeCentroidExtractor) and shape (see SafeShapeExtractor) information.

The default implementation simply throws an exception, indicating that simultaneous measurement is not supported.

Definition at line 31 of file Algorithm.cc.

32  {
33  throw LSST_EXCEPT(pex::exceptions::LogicError, "measureN not implemented for this algorithm");
34 }

◆ measureNForced()

virtual void lsst::meas::base::SimpleAlgorithm::measureNForced ( afw::table::SourceCatalog const &  measCat,
afw::image::Exposure< float > const &  exposure,
afw::table::SourceCatalog const &  refRecord,
afw::geom::SkyWcs const &  refWcs 
) const
inlinevirtualinherited

Called to simultaneously measure all children in a deblend family, in a single image.

Outputs should be saved in the given SourceCatalog, which can also be used to obtain centroid (see SafeCentroidExtractor) and shape (see SafeShapeExtractor) information.

The default implementation simply throws an exception, indicating that simultaneous measurement is not supported.

Reimplemented from lsst::meas::base::ForcedAlgorithm.

Definition at line 179 of file Algorithm.h.

182  {
183  measureN(measCat, exposure);
184  }

Member Data Documentation

◆ _flagHandler

meas::base::FlagHandler lsst::ip::diffim::DipoleFluxAlgorithm::_flagHandler
protectedinherited

Definition at line 145 of file DipoleAlgorithms.h.

◆ _fluxResultKey

meas::base::FluxResultKey lsst::ip::diffim::DipoleFluxAlgorithm::_fluxResultKey
protectedinherited

Definition at line 144 of file DipoleAlgorithms.h.

◆ _logName

std::string lsst::meas::base::BaseAlgorithm::_logName
protectedinherited

Definition at line 69 of file Algorithm.h.

◆ _negativeKeys

ResultKey lsst::ip::diffim::DipoleFluxAlgorithm::_negativeKeys
protectedinherited

Definition at line 148 of file DipoleAlgorithms.h.

◆ _positiveKeys

ResultKey lsst::ip::diffim::DipoleFluxAlgorithm::_positiveKeys
protectedinherited

Definition at line 147 of file DipoleAlgorithms.h.

◆ FAILURE

meas::base::FlagDefinition const lsst::ip::diffim::DipoleFluxAlgorithm::FAILURE = dipoleFluxFlagDefinitions.addFailureFlag("general failure flag, set if anything went wrong")
staticinherited

Definition at line 118 of file DipoleAlgorithms.h.

◆ NEG_FLAG

meas::base::FlagDefinition const lsst::ip::diffim::DipoleFluxAlgorithm::NEG_FLAG = dipoleFluxFlagDefinitions.add("neg_flag", "failure flag for negative, set if anything went wrong")
staticinherited

Definition at line 120 of file DipoleAlgorithms.h.

◆ POS_FLAG

meas::base::FlagDefinition const lsst::ip::diffim::DipoleFluxAlgorithm::POS_FLAG = dipoleFluxFlagDefinitions.add("pos_flag", "failure flag for positive, set if anything went wrong")
staticinherited

Definition at line 119 of file DipoleAlgorithms.h.


The documentation for this class was generated from the following files:
schema
table::Schema schema
Definition: Amplifier.cc:115
lsst::ip::diffim::POSCENTYPAR
int const POSCENTYPAR(4)
lsst::log.log.logContinued.error
def error(fmt, *args)
Definition: logContinued.py:213
lsst::meas::base::FlagHandler::handleFailure
void handleFailure(afw::table::BaseRecord &record, MeasurementError const *error=nullptr) const
Handle an expected or unexpected Exception thrown by a measurement algorithm.
Definition: FlagHandler.cc:76
lsst::ip::diffim::PsfDipoleFluxControl::stepSizeCoord
float stepSizeCoord
"Default initial step size for coordinates in non-linear fitter" ;
Definition: DipoleAlgorithms.h:69
lsst::ip::diffim::DipoleFluxAlgorithm::_negativeKeys
ResultKey _negativeKeys
Definition: DipoleAlgorithms.h:148
std::pair
lsst::meas::base::SIGMA_ONLY
@ SIGMA_ONLY
Only the diagonal elements of the covariance matrix are provided.
Definition: constants.h:45
psf
Key< int > psf
Definition: Exposure.cc:65
lsst::ip::diffim::NEGCENTXPAR
int const NEGCENTXPAR(0)
lsst::ip::diffim::DipoleFluxAlgorithm::DipoleFluxAlgorithm
DipoleFluxAlgorithm(Control const &ctrl, std::string const &name, afw::table::Schema &schema, std::string const &doc)
Definition: DipoleAlgorithms.h:194
lsst::ip::diffim::DipoleFluxAlgorithm::_flagHandler
meas::base::FlagHandler _flagHandler
Definition: DipoleAlgorithms.h:145
lsst::ip::diffim::DipoleFluxAlgorithm::_positiveKeys
ResultKey _positiveKeys
Definition: DipoleAlgorithms.h:147
lsst::ip::diffim::POSCENTXPAR
int const POSCENTXPAR(3)
lsst.pex.config.history.format
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
Definition: history.py:174
lsst::afw::geom.transform.transformContinued.name
string name
Definition: transformContinued.py:32
lsst::ip::diffim::DipoleFluxAlgorithm::getNegativeKeys
ResultKey const & getNegativeKeys() const
Definition: DipoleAlgorithms.h:134
PTR
#define PTR(...)
Definition: base.h:41
lsst::afw::math::Statistics::getValue
double getValue(Property const prop=NOTHING) const
Return the value of the desired property (if specified in the constructor)
Definition: Statistics.cc:1056
lsst::ip::diffim::NEGFLUXPAR
int const NEGFLUXPAR(2)
lsst::ip::diffim::DipoleFluxAlgorithm::getPositiveKeys
ResultKey const & getPositiveKeys() const
Return the standard flux keys registered by this algorithm.
Definition: DipoleAlgorithms.h:133
lsst::meas::base::CentroidResultKey::addFields
static CentroidResultKey addFields(afw::table::Schema &schema, std::string const &name, std::string const &doc, UncertaintyEnum uncertainty)
Add the appropriate fields to a Schema, and return a CentroidResultKey that manages them.
Definition: CentroidUtilities.cc:66
lsst::afw::math::makeStatistics
Statistics makeStatistics(lsst::afw::image::Image< Pixel > const &img, lsst::afw::image::Mask< image::MaskPixel > const &msk, int const flags, StatisticsControl const &sctrl=StatisticsControl())
Handle a watered-down front-end to the constructor (no variance)
Definition: Statistics.h:354
lsst::ip::diffim::PsfDipoleFluxControl::maxFnCalls
int maxFnCalls
"Maximum function calls for non-linear fitter; 0 = unlimited" ;
Definition: DipoleAlgorithms.h:72
data
char * data
Definition: BaseRecord.cc:62
std::isfinite
T isfinite(T... args)
lsst::ip::diffim::NEGCENTYPAR
int const NEGCENTYPAR(1)
ast::detail::source
const char * source()
Source function that allows astChannel to source from a Stream.
Definition: Stream.h:224
lsst::afw::table::Footprint
lsst::afw::detection::Footprint Footprint
Definition: Source.h:59
lsst::afw::detection::PeakCatalog
afw::table::CatalogT< PeakRecord > PeakCatalog
Definition: Peak.h:244
lsst::meas::base::SingleFrameAlgorithm::measureN
virtual void measureN(afw::table::SourceCatalog const &measCat, afw::image::Exposure< float > const &exposure) const
Called to simultaneously measure all children in a deblend family, in a single image.
Definition: Algorithm.cc:31
lsst::meas::base::SingleFrameAlgorithm::measure
virtual void measure(afw::table::SourceRecord &measRecord, afw::image::Exposure< float > const &exposure) const =0
Called to measure a single child source in an image.
CONST_PTR
#define CONST_PTR(...)
A shared pointer to a const object.
Definition: base.h:47
lsst::ip::diffim::PsfDipoleFlux::chi2
std::pair< double, int > chi2(afw::table::SourceRecord &source, afw::image::Exposure< float > const &exposure, double negCenterX, double negCenterY, double negFlux, double posCenterX, double poCenterY, double posFlux) const
Definition: DipoleAlgorithms.cc:352
LSST_EXCEPT
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition: Exception.h:48
std::min
T min(T... args)
lsst::afw::math::NPOINT
@ NPOINT
number of sample points
Definition: Statistics.h:66
lsst::geom::Box2I::getMaxY
int getMaxY() const noexcept
Definition: Box.h:162
lsst::meas::base::BaseAlgorithm::_logName
std::string _logName
Definition: Algorithm.h:69
min
int min
Definition: BoundedField.cc:103
lsst::geom::Box2I::getMaxX
int getMaxX() const noexcept
Definition: Box.h:161
lsst::afw::image::Exposure< float >::MaskedImageT
MaskedImage< float, lsst::afw::image::MaskPixel, lsst::afw::image::VariancePixel > MaskedImageT
Definition: Exposure.h:74
lsst::meas::base::CentroidResultKey::getX
afw::table::Key< CentroidElement > getX() const
Return a Key for the x coordinate.
Definition: CentroidUtilities.h:147
lsst::geom::Point< double, 2 >
lsst::ip::diffim::POSFLUXPAR
int const POSFLUXPAR(5)
isValid
bool isValid
Definition: fits.cc:399
lsst::geom::Box2I
An integer coordinate rectangle.
Definition: Box.h:55
lsst::geom::Box2I::getMinX
int getMinX() const noexcept
Definition: Box.h:157
lsst::afw::math::Statistics
Definition: Statistics.h:215
lsst::afw::detection::Psf
A polymorphic base class for representing an image's Point Spread Function.
Definition: Psf.h:76
lsst::ip::diffim::PsfDipoleFluxControl::errorDef
double errorDef
"How many sigma the error bars of the non-linear fitter represent" ;
Definition: DipoleAlgorithms.h:71
std::max
T max(T... args)
lsst::afw::image::Image
A class to represent a 2-dimensional array of pixels.
Definition: Image.h:58
lsst::meas::base::CentroidResultKey::getY
afw::table::Key< CentroidElement > getY() const
Return a Key for the y coordinate.
Definition: CentroidUtilities.h:150
lsst::afw::math::SUM
@ SUM
find sum of pixels in the image
Definition: Statistics.h:78
lsst::ip::diffim::PsfDipoleFluxControl::stepSizeFlux
float stepSizeFlux
"Default initial step size for flux in non-linear fitter" ;
Definition: DipoleAlgorithms.h:70
lsst::geom::Box2I::getMinY
int getMinY() const noexcept
Definition: Box.h:158