25 #ifndef LSST_JOINTCAL_PHOTOMETRY_MAPPING_H
26 #define LSST_JOINTCAL_PHOTOMETRY_MAPPING_H
97 Eigen::Ref<Eigen::VectorXd> derivatives)
const = 0;
150 return _transform->getNpar();
156 return _transform->transform(measuredStar.
x, measuredStar.
y, value);
161 return _transformErrors->transformError(measuredStar.
x, measuredStar.
y, value, valueErr);
171 Eigen::Ref<Eigen::VectorXd> derivatives)
const override {
175 _transform->computeParameterDerivatives(measuredStar.
x, measuredStar.
y, value, derivatives);
185 void offsetParams(Eigen::VectorXd
const &delta) { _transform->offsetParams(delta); }
188 Eigen::VectorXd
getParameters()
override {
return _transform->getParameters(); }
194 indices[k] =
index + k;
200 out <<
"index: " <<
index <<
" fixed: " <<
fixed <<
" ";
201 _transform->print(out);
233 double temp =
_chipMapping->getTransform()->transform(measuredStar.
x, measuredStar.
y, value);
246 Eigen::VectorXd joined(
getNpar());
263 void setWhatToFit(
bool const fittingChips,
bool const fittingVisits);
268 out <<
"chip mapping: ";
300 Eigen::Ref<Eigen::VectorXd> derivatives)
const override;
319 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 > _visitMapping
std::shared_ptr< PhotometryMapping > getChipMapping() const
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::shared_ptr< PhotometryMapping > getVisitMapping() const
std::size_t getNpar() const override
Number of total parameters in this mapping.
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)
void setWhatToFit(bool const fittingChips, bool const fittingVisits)
Set whether to fit chips or visits.
std::size_t getNParVisit() 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 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).
Eigen::Index getIndex()
Get the index of this mapping in the grand fit.
virtual void print(std::ostream &out) const =0
Print a string representation of the contents of this mapping, for debugging.
virtual ~PhotometryMappingBase()
PhotometryMappingBase & operator=(PhotometryMappingBase const &)=delete
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.
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.
std::shared_ptr< PhotometryTransform > getTransform() const
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
std::shared_ptr< PhotometryTransform > getTransformErrors() const
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.
double transform(MeasuredStar const &measuredStar, double value) const override
Return the on-sky transformed flux for measuredStar on ccdImage.
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.
A base class for image defects.