3 #include "lsst/log/Log.h" 11 LOG_LOGGER _log = LOG_GET(
"jointcal.SimplePhotometryModel");
18 for (
auto const &
ccdImage : ccdImageList) {
19 _myMap[
ccdImage.get()] = std::unique_ptr<PhotometryMapping>(
22 LOGLS_INFO(_log,
"SimplePhotometryModel got " << _myMap.size() <<
" ccdImage mappings.");
26 unsigned ipar = firstIndex;
27 for (
auto const &i : _myMap) {
28 auto mapping = i.second.get();
29 mapping->setIndex(ipar);
30 ipar += mapping->getNpar();
36 for (
auto &i : _myMap) {
37 auto mapping = i.second.get();
38 mapping->offsetParams(&delta[mapping->getIndex()]);
43 auto mapping = this->findMapping(ccdImage,
"photomFactor");
44 return mapping->getTransfo().apply(where, 1.0);
48 auto mapping = this->findMapping(ccdImage,
"getMappingIndices");
49 if (indices.size() < mapping->getNpar()) indices.resize(mapping->getNpar());
50 indices[0] = mapping->getIndex();
55 Eigen::VectorXd &derivatives) {
58 derivatives[0] = 1. * measuredStar.
getFlux();
62 auto i = _myMap.find(&ccdImage);
63 if (i == _myMap.end())
64 throw LSST_EXCEPT(pex::exceptions::InvalidParameterError,
65 "SimplePolyModel::" + name +
", cannot find CcdImage " + ccdImage.
getName());
66 return i->second.get();
std::string getName() const
Return the _name that identifies this ccdImage.
SimplePhotometryModel(CcdImageList const &ccdImageList)
Class for a simple mapping implementing a generic Gtransfo.
void computeParameterDerivatives(MeasuredStar const &measuredStar, CcdImage const &ccdImage, Eigen::VectorXd &derivatives) override
Compute the parametric derivatives of this model.
objects measured on actual images.
void getMappingIndices(CcdImage const &ccdImage, std::vector< unsigned > &indices) override
Get how this set of parameters (of length Npar()) map into the "grand" fit.
double photomFactor(CcdImage const &ccdImage, Point const &where=Point()) const override
Return the "photometric factor" for this ccdImage.
unsigned assignIndices(std::string const &whatToFit, unsigned firstIndex) override
Assign indices to parameters involved in mappings, starting at firstIndex.
void offsetParams(Eigen::VectorXd const &delta) override
Offset the parameters by the provided amounts.
std::list< std::shared_ptr< CcdImage > > CcdImageList
Handler of an actual image from a single CCD.