25 #ifndef LSST_JOINTCAL_PHOTOMETRY_MAPPING_H 26 #define LSST_JOINTCAL_PHOTOMETRY_MAPPING_H 56 virtual unsigned getNpar()
const = 0;
97 Eigen::Ref<Eigen::VectorXd> derivatives)
const = 0;
145 return _transform->getNpar();
151 return _transform->transform(measuredStar.
x, measuredStar.
y, value);
156 return _transformErrors->transformError(measuredStar.
x, measuredStar.
y, value, valueErr);
166 Eigen::Ref<Eigen::VectorXd> derivatives)
const override {
170 _transform->computeParameterDerivatives(measuredStar.
x, measuredStar.
y, value, derivatives);
180 void offsetParams(Eigen::VectorXd
const &delta) { _transform->offsetParams(delta); }
183 Eigen::VectorXd
getParameters()
override {
return _transform->getParameters(); }
188 for (
unsigned k = 0; k <
getNpar(); ++k) {
189 indices[k] =
index + k;
195 stream <<
"index: " <<
index <<
" fixed: " <<
fixed <<
" transform parameters: ";
220 _chipMapping(
std::
move(chipMapping)),
221 _visitMapping(
std::
move(visitMapping)) {}
224 unsigned getNpar()
const override {
return _nParChip + _nParVisit; }
228 double temp = _chipMapping->getTransform()->transform(measuredStar.
x, measuredStar.
y, value);
229 return _visitMapping->getTransform()->transform(measuredStar.
getXFocal(), measuredStar.
getYFocal(),
235 _chipMapping->freezeErrorTransform();
236 _visitMapping->freezeErrorTransform();
241 Eigen::VectorXd joined(
getNpar());
242 joined << _chipMapping->getParameters(), _visitMapping->getParameters();
258 void setWhatToFit(
bool const fittingChips,
bool const fittingVisits);
263 _chipMapping->dump(
stream);
264 stream <<
"visitMapping: ";
265 _visitMapping->dump(
stream);
294 Eigen::Ref<Eigen::VectorXd> derivatives)
const override;
313 Eigen::Ref<Eigen::VectorXd> derivatives)
const override;
319 #endif // LSST_JOINTCAL_PHOTOMETRY_MAPPING_H virtual void freezeErrorTransform()=0
Once this routine has been called, the error transform is not modified by offsetParams().
unsigned getNParVisit() const
unsigned getNParChip() const
ChipVisitFluxMapping(std::shared_ptr< PhotometryMapping > chipMapping, std::shared_ptr< PhotometryMapping > visitMapping)
Relates transform(s) to their position in the fitting matrix and allows interaction with the transfor...
std::shared_ptr< PhotometryMapping > _visitMapping
virtual Eigen::VectorXd getParameters()=0
double transform(MeasuredStar const &measuredStar, double value) const override
Return the on-sky transformed flux for measuredStar on ccdImage.
std::shared_ptr< PhotometryMapping > getChipMapping() const
void offsetParams(Eigen::VectorXd const &delta)
Offset the transform parameters by delta.
virtual double transformError(MeasuredStar const &measuredStar, double value, double valueErr) const =0
Return the on-sky transformed flux uncertainty for measuredStar on ccdImage.
void dump(std::ostream &stream=std::cout) const override
Dump the contents of the transforms, for debugging.
double transformError(MeasuredStar const &measuredStar, double value, double valueErr) const override
Return the on-sky transformed flux uncertainty for measuredStar on ccdImage.
Eigen::VectorXd getParameters() override
std::shared_ptr< PhotometryMapping > _chipMapping
virtual double transform(MeasuredStar const &measuredStar, double value) const =0
Return the on-sky transformed flux for measuredStar on ccdImage.
void freezeErrorTransform() override
Once this routine has been called, the error transform is not modified by offsetParams().
std::shared_ptr< PhotometryMapping > getVisitMapping() const
void setIndex(unsigned i)
Set the index of this mapping in the grand fit.
void getMappingIndices(std::vector< unsigned > &indices) const override
Gets how this set of parameters (of length getNpar()) map into the "grand" fit.
A base class for image defects.
void dump(std::ostream &stream=std::cout) const override
Dump the contents of the transforms, for debugging.
std::shared_ptr< PhotometryTransform > getTransform() const
void computeParameterDerivatives(MeasuredStar const &measuredStar, double value, Eigen::Ref< Eigen::VectorXd > derivatives) const override
Compute the derivatives with respect to the parameters (i.e.
objects measured on actual images.
double transform(MeasuredStar const &measuredStar, double value) const override
Return the on-sky transformed flux for measuredStar on ccdImage.
PhotometryMapping(std::shared_ptr< PhotometryTransform > transform)
Value transform takes ownership of transform, error transform aliases it.
std::shared_ptr< PhotometryTransform > getTransformErrors() const
virtual ~PhotometryMappingBase()
ChipVisitPhotometryMapping(std::shared_ptr< PhotometryMapping > chipMapping, std::shared_ptr< PhotometryMapping > visitMapping)
unsigned getNpar() const override
Number of total parameters in this mapping.
PhotometryMappingBase & operator=(PhotometryMappingBase const &)=delete
virtual void computeParameterDerivatives(MeasuredStar const &measuredStar, double value, Eigen::Ref< Eigen::VectorXd > derivatives) const =0
Compute the derivatives with respect to the parameters (i.e.
void setFixed(bool _fixed)
Make this mapping's parameters fixed (i.e. not varied during fitting).
unsigned getIndex()
Get the index of this mapping in the grand fit.
A mapping containing a single photometryTransform.
virtual void dump(std::ostream &stream=std::cout) const =0
Dump the contents of the transforms, for debugging.
Implementation of the Photometric Calibration class.
virtual unsigned getNpar() const =0
Number of total parameters in this mapping.
void freezeErrorTransform() override
Once this routine has been called, the error transform is not modified by offsetParams().
ChipVisitMagnitudeMapping(std::shared_ptr< PhotometryMapping > chipMapping, std::shared_ptr< PhotometryMapping > visitMapping)
virtual void getMappingIndices(std::vector< unsigned > &indices) const =0
Gets how this set of parameters (of length getNpar()) map into the "grand" fit.
A two-level photometric transform: one for the ccd and one for the visit.
unsigned getNpar() const override
Number of total parameters in this mapping.
Eigen::VectorXd getParameters() override