2 #ifndef LSST_JOINTCAL_PHOTOMETRY_TRANSFO_H
3 #define LSST_JOINTCAL_PHOTOMETRY_TRANSFO_H
16 class PhotometryTransfoSpatiallyInvariant;
31 virtual double apply(
double x,
double y,
double instFlux)
const = 0;
33 double apply(
Point const &in,
double instFlux)
const {
return apply(in.
x, in.
y, instFlux); }
36 virtual void dump(std::ostream &stream = std::cout)
const = 0;
52 virtual std::unique_ptr<PhotometryTransfo>
clone()
const = 0;
55 const double step = 0.01)
const;
70 double apply(
double x,
double y,
double instFlux)
const override {
return instFlux * _value; }
72 void dump(std::ostream &stream = std::cout)
const override { stream << _value; }
74 int getNpar()
const override {
return 1; }
76 void offsetParams(
const double *delta)
override { _value -= *delta; };
78 std::unique_ptr<PhotometryTransfo>
clone()
const override {
84 const double step = 0.01)
const {
89 void setValue(
double value) { _value = value; }
101 #endif // LSST_JOINTCAL_PHOTOMETRY_TRANSFO_H
PhotometryTransfoSpatiallyInvariant(double value=1)
virtual std::unique_ptr< PhotometryTransfo > clone() const =0
return a copy (allocated by new) of the transformation.
virtual void dump(std::ostream &stream=std::cout) const =0
dumps the transfo coefficients to stream.
std::string __str__() const
Return a string describing this transfo. For the pybind11/python layer.
void offsetParams(const double *delta) override
Offset the parameters by some amount during fitting.
void computeDerivative(Point const &where, PhotometryTransfoSpatiallyInvariant &derivative, const double step=0.01) const
double apply(Point const &in, double instFlux) const
double apply(double x, double y, double instFlux) const override
Apply the transform to instFlux at (x,y), put result in flux.
void computeDerivative(Point const &where, PhotometryTransfoSpatiallyInvariant &derivative, const double step=0.01) const
The spatial derivative of a constant zeropoint is 1.
std::unique_ptr< PhotometryTransfo > clone() const override
return a copy (allocated by new) of the transformation.
void dump(std::ostream &stream=std::cout) const override
dumps the transfo coefficients to stream.
virtual int getNpar() const
Return the number of parameters (used to compute chisq)
virtual void offsetParams(double const *delta)=0
Offset the parameters by some amount during fitting.
virtual double apply(double x, double y, double instFlux) const =0
Apply the transform to instFlux at (x,y), put result in flux.
int getNpar() const override
Return the number of parameters (used to compute chisq)
void setValue(double value)