25 #ifndef LSST_JOINTCAL_PHOTOMETRY_MAPPING_H 26 #define LSST_JOINTCAL_PHOTOMETRY_MAPPING_H 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(); }
189 indices[k] =
index + k;
195 stream <<
"index: " <<
index <<
" fixed: " <<
fixed <<
" transform parameters: ";
220 _chipMapping(
std::
move(chipMapping)),
221 _visitMapping(
std::
move(visitMapping)) {}
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().
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...
virtual std::size_t getNpar() const =0
Number of total parameters in this mapping.
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
void getMappingIndices(IndexVector &indices) const override
Gets how this set of parameters (of length getNpar()) map into the "grand" fit.
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
std::size_t getNParVisit() const
A base class for image defects.
virtual void getMappingIndices(IndexVector &indices) const =0
Gets how this set of parameters (of length getNpar()) map into the "grand" fit.
std::size_t getNParChip() const
void dump(std::ostream &stream=std::cout) const override
Dump the contents of the transforms, for debugging.
void setIndex(Eigen::Index i)
Set the index of this mapping in the grand fit.
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.
std::size_t getNpar() const override
Number of total parameters in this mapping.
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()
Eigen::Index getIndex()
Get the index of this mapping in the grand fit.
ChipVisitPhotometryMapping(std::shared_ptr< PhotometryMapping > chipMapping, std::shared_ptr< PhotometryMapping > visitMapping)
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).
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.
std::size_t getNpar() const override
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)
A two-level photometric transform: one for the ccd and one for the visit.
Eigen::VectorXd getParameters() override