2 #ifndef LSST_JOINTCAL_PHOTOMETRY_TRANSFO_H 3 #define LSST_JOINTCAL_PHOTOMETRY_TRANSFO_H 22 class PhotometryTransfoSpatiallyInvariant;
36 virtual double transform(
double x,
double y,
double instFlux)
const = 0;
60 virtual void offsetParams(Eigen::VectorXd
const &delta) = 0;
74 Eigen::Ref<Eigen::VectorXd> derivatives)
const = 0;
91 double transform(
double x,
double y,
double instFlux)
const override {
return instFlux * _value; }
97 int getNpar()
const override {
return 1; }
100 void offsetParams(Eigen::VectorXd
const &delta)
override { _value -= delta[0]; };
104 return std::make_shared<PhotometryTransfoSpatiallyInvariant>(_value);
109 Eigen::Ref<Eigen::VectorXd> derivatives)
const override {
111 derivatives[0] = instFlux;
116 Eigen::VectorXd parameters(1);
117 parameters[0] = _value;
170 double transform(
double x,
double y,
double instFlux)
const override;
176 int getNpar()
const override {
return _nParameters; }
179 void offsetParams(Eigen::VectorXd
const &delta)
override;
183 return std::make_shared<PhotometryTransfoChebyshev>(_coefficients, _bbox);
188 Eigen::Ref<Eigen::VectorXd> derivatives)
const override;
191 ndarray::Array<double, 2, 2>
getCoefficients() {
return ndarray::copy(_coefficients); }
207 ndarray::Array<double, 2, 2> _coefficients;
208 ndarray::Size _degree;
209 ndarray::Size _nParameters;
218 #endif // LSST_JOINTCAL_PHOTOMETRY_TRANSFO_H
PhotometryTransfoSpatiallyInvariant(double value=1)
virtual Eigen::VectorXd getParameters() const =0
Get a copy of the parameters of this model, in the same order as offsetParams.
virtual void dump(std::ostream &stream=std::cout) const =0
dumps the transfo coefficients to stream.
afw::geom::Box2D getBBox() const
int getNpar() const override
Return the number of parameters (used to compute chisq)
double transform(double x, double y, double instFlux) const override
Apply the transform to instFlux at (x,y), put result in flux.
double transform(Point const &in, double instFlux) const
Return the transformed instFlux at (x,y).
virtual std::shared_ptr< PhotometryTransfo > clone() const =0
return a copy (allocated by new) of the transformation.
Class for a simple mapping implementing a generic Gtransfo.
ndarray::Size getDegree() const
friend std::ostream & operator<<(std::ostream &s, PhotometryTransfo const &transfo)
virtual void computeParameterDerivatives(double x, double y, double instFlux, Eigen::Ref< Eigen::VectorXd > derivatives) const =0
Compute the derivatives with respect to the parameters (i.e.
virtual int getNpar() const
Return the number of parameters (used to compute chisq)
ndarray::Array< double, 2, 2 > getCoefficients()
Get a copy of the coefficients of the polynomials, as a 2d array (NOTE: layout is [y][x]) ...
virtual void offsetParams(Eigen::VectorXd const &delta)=0
Offset the parameters by some (negative) amount during fitting.
void computeParameterDerivatives(double x, double y, double instFlux, Eigen::Ref< Eigen::VectorXd > derivatives) const override
Compute the derivatives with respect to the parameters (i.e.
std::shared_ptr< PhotometryTransfo > clone() const override
return a copy (allocated by new) of the transformation.
virtual double transform(double x, double y, double instFlux) const =0
Apply the transform to instFlux at (x,y), put result in flux.
Eigen::VectorXd getParameters() const override
Get a copy of the parameters of this model, in the same order as offsetParams.
ndarray::Array< double const, 2, 2 > coefficients
std::shared_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.
nth-degree 2d Chebyshev photometry transfo.
void offsetParams(Eigen::VectorXd const &delta) override
Offset the parameters by some (negative) amount during fitting.
UnaryFunctionT::result_type integrate(UnaryFunctionT func, typename UnaryFunctionT::argument_type const a, typename UnaryFunctionT::argument_type const b, double eps=1.0e-6)
void dump(std::ostream &stream=std::cout) const override
dumps the transfo coefficients to stream.
int getNpar() const override
Return the number of parameters (used to compute chisq)
void setValue(double value)