25#ifndef LSST_JOINTCAL_PHOTOMETRY_MAPPING_H
26#define LSST_JOINTCAL_PHOTOMETRY_MAPPING_H
98 Eigen::Ref<Eigen::VectorXd> derivatives)
const = 0;
151 return _transform->getNpar();
157 return _transform->transform(measuredStar.
x, measuredStar.
y, value);
162 return _transformErrors->transformError(measuredStar.
x, measuredStar.
y, value, valueErr);
172 Eigen::Ref<Eigen::VectorXd> derivatives)
const override {
176 _transform->computeParameterDerivatives(measuredStar.
x, measuredStar.
y, value, derivatives);
186 void offsetParams(Eigen::VectorXd
const &delta) { _transform->offsetParams(delta); }
189 Eigen::VectorXd
getParameters()
override {
return _transform->getParameters(); }
195 indices[k] =
index + k;
201 out <<
"index: " <<
index <<
" fixed: " <<
fixed <<
" ";
202 _transform->print(out);
234 double temp =
_chipMapping->getTransform()->transform(measuredStar.
x, measuredStar.
y, value);
247 Eigen::VectorXd joined(
getNpar());
264 void setWhatToFit(
bool fittingChips,
bool fittingVisits);
269 out <<
"chip mapping: ";
301 Eigen::Ref<Eigen::VectorXd> derivatives)
const override;
320 Eigen::Ref<Eigen::VectorXd> derivatives)
const override;
Implementation of the Photometric Calibration class.
void computeParameterDerivatives(MeasuredStar const &measuredStar, double value, Eigen::Ref< Eigen::VectorXd > derivatives) const override
Compute the derivatives with respect to the parameters (i.e.
double transformError(MeasuredStar const &measuredStar, double value, double valueErr) const override
Return the on-sky transformed flux uncertainty for measuredStar on ccdImage.
ChipVisitFluxMapping(std::shared_ptr< PhotometryMapping > chipMapping, std::shared_ptr< PhotometryMapping > visitMapping)
ChipVisitMagnitudeMapping(std::shared_ptr< PhotometryMapping > chipMapping, std::shared_ptr< PhotometryMapping > visitMapping)
void computeParameterDerivatives(MeasuredStar const &measuredStar, double value, Eigen::Ref< Eigen::VectorXd > derivatives) const override
Compute the derivatives with respect to the parameters (i.e.
double transformError(MeasuredStar const &measuredStar, double value, double valueErr) const override
Return the on-sky transformed flux uncertainty for measuredStar on ccdImage.
A two-level photometric transform: one for the ccd and one for the visit.
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
std::shared_ptr< PhotometryMapping > _visitMapping
Eigen::VectorXd getParameters() override
void print(std::ostream &out) const override
Print a string representation of the contents of this mapping, for debugging.
std::shared_ptr< PhotometryMapping > _chipMapping
void freezeErrorTransform() override
Once this routine has been called, the error transform is not modified by offsetParams().
std::size_t getNpar() const override
Number of total parameters in this mapping.
void setWhatToFit(bool fittingChips, bool fittingVisits)
Set whether to fit chips or visits.
void getMappingIndices(IndexVector &indices) const override
Gets how this set of parameters (of length getNpar()) map into the "grand" fit.
std::size_t getNParChip() const
ChipVisitPhotometryMapping(std::shared_ptr< PhotometryMapping > chipMapping, std::shared_ptr< PhotometryMapping > visitMapping)
std::size_t getNParVisit() const
std::shared_ptr< PhotometryMapping > getVisitMapping() const
Sources measured on images.
Relates transform(s) to their position in the fitting matrix and allows interaction with the transfor...
PhotometryMappingBase & operator=(PhotometryMappingBase &&)=delete
PhotometryMappingBase(PhotometryMappingBase const &)=delete
No copy or move: there is only ever one instance of a given mapping (i.e. per ccd+visit)
virtual ~PhotometryMappingBase()=default
PhotometryMappingBase & operator=(PhotometryMappingBase const &)=delete
virtual Eigen::VectorXd getParameters()=0
virtual std::size_t getNpar() const =0
Number of total parameters in this mapping.
void setFixed(bool _fixed)
Make this mapping's parameters fixed (i.e. not varied during fitting).
virtual void print(std::ostream &out) const =0
Print a string representation of the contents of this mapping, for debugging.
void setIndex(Eigen::Index i)
Set the index of this mapping in the grand fit.
PhotometryMappingBase(PhotometryMappingBase &&)=delete
virtual void getMappingIndices(IndexVector &indices) const =0
Gets how this set of parameters (of length getNpar()) map into the "grand" fit.
virtual double transformError(MeasuredStar const &measuredStar, double value, double valueErr) const =0
Return the on-sky transformed flux uncertainty for measuredStar on ccdImage.
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.
Eigen::Index getIndex() const
Get the index of this mapping in the grand fit.
virtual void freezeErrorTransform()=0
Once this routine has been called, the error transform is not modified by offsetParams().
virtual double transform(MeasuredStar const &measuredStar, double value) const =0
Return the on-sky transformed flux for measuredStar on ccdImage.
A mapping containing a single photometryTransform.
void getMappingIndices(IndexVector &indices) const override
Gets how this set of parameters (of length getNpar()) map into the "grand" fit.
void computeParameterDerivatives(MeasuredStar const &measuredStar, double value, Eigen::Ref< Eigen::VectorXd > derivatives) const override
Compute the derivatives with respect to the parameters (i.e.
void freezeErrorTransform() override
Once this routine has been called, the error transform is not modified by offsetParams().
Eigen::VectorXd getParameters() override
PhotometryMapping(std::shared_ptr< PhotometryTransform > transform)
Value transform takes ownership of transform, error transform aliases it.
double transformError(MeasuredStar const &measuredStar, double value, double valueErr) const override
Return the on-sky transformed flux uncertainty for measuredStar on ccdImage.
void print(std::ostream &out) const override
Print a string representation of the contents of this mapping, for debugging.
std::shared_ptr< PhotometryTransform > getTransform() const
double transform(MeasuredStar const &measuredStar, double value) const override
Return the on-sky transformed flux for measuredStar on ccdImage.
std::shared_ptr< PhotometryTransform > getTransformErrors() const
void offsetParams(Eigen::VectorXd const &delta)
Offset the transform parameters by delta.
std::size_t getNpar() const override
Number of total parameters in this mapping.