lsst.jointcal  16.0-21-g96865c2+1
PhotometryModel.cc
Go to the documentation of this file.
1 #include "lsst/log/Log.h"
2 
5 
6 namespace lsst {
7 namespace jointcal {
8 
9 bool PhotometryModel::validate(CcdImageList const &ccdImageList) const {
10  bool check = true;
11  for (auto const &ccdImage : ccdImageList) {
12  // Don't short circuit so that we log every place the model is negative.
13  check &= checkPositiveOnBBox(*ccdImage);
14  }
15  return check;
16 }
17 
19  bool check = true;
20  auto bbox = ccdImage.getImageFrame();
21  for (auto const &x : {bbox.xMin, bbox.getCenter().x, bbox.xMax})
22  for (auto const &y : {bbox.yMin, bbox.getCenter().y, bbox.yMax}) {
23  // flux, fluxErr, instFlux, instFluxErr all 1
25  star.setInstFluxAndErr(1, 1);
26  double result = transform(ccdImage, star);
27  // Don't short circuit so that we log every place the model is negative.
28  if (result < 0) {
29  LOGLS_WARN(_log, "CcdImage " << ccdImage.getName() << " is negative at (" << x << "," << y
30  << "): " << result);
31  check = false;
32  }
33  }
34  return check;
35 }
36 
37 } // namespace jointcal
38 } // namespace lsst
std::string getName() const
Return the _name that identifies this ccdImage.
Definition: CcdImage.h:56
table::Box2IKey bbox
bool checkPositiveOnBBox(CcdImage const &ccdImage) const
Check that the model is positive on the ccdImage bbox.
The base class for handling stars. Used by all matching routines.
Definition: BaseStar.h:27
Class for a simple mapping implementing a generic Gtransfo.
void setInstFluxAndErr(double instFlux, double instFluxErr)
Definition: MeasuredStar.h:62
objects measured on actual images.
Definition: MeasuredStar.h:19
std::unique_ptr< SchemaItem< U > > result
LOG_LOGGER _log
lsst.logging instance, to be created by a subclass so that messages have consistent name...
double x
Handler of an actual image from a single CCD.
Definition: CcdImage.h:41
bool validate(CcdImageList const &ccdImageList) const
Return true if this is a "reasonable" model.
int y
virtual double transform(CcdImage const &ccdImage, MeasuredStar const &measuredStar) const =0
Return the on-sky transformed flux for measuredStar on ccdImage.
Frame const & getImageFrame() const
Frame in pixels.
Definition: CcdImage.h:166
#define LOGLS_WARN(logger, message)