25 #ifndef LSST_JOINTCAL_PHOTOMETRY_TRANSFORM_H 26 #define LSST_JOINTCAL_PHOTOMETRY_TRANSFORM_H 55 virtual double transform(
double x,
double y,
double value)
const = 0;
61 virtual double transformError(
double x,
double y,
double value,
double valueErr)
const = 0;
87 virtual void offsetParams(Eigen::VectorXd
const &delta) = 0;
101 Eigen::Ref<Eigen::VectorXd> derivatives)
const = 0;
121 void offsetParams(Eigen::VectorXd
const &delta)
override { _value -= delta[0]; };
125 Eigen::VectorXd parameters(1);
126 parameters[0] = _value;
150 double transform(
double x,
double y,
double value)
const override {
return value * getValue(); }
154 return getValue() * valueErr;
159 return std::make_shared<FluxTransformSpatiallyInvariant>(getValue());
164 Eigen::Ref<Eigen::VectorXd> derivatives)
const override {
166 derivatives[0] = value;
182 double transform(
double x,
double y,
double mag)
const override {
return mag + getValue(); }
191 return std::make_shared<MagnitudeTransformSpatiallyInvariant>(getValue());
196 Eigen::Ref<Eigen::VectorXd> derivatives)
const override {
242 double transformError(
double x,
double y,
double value,
double valueErr)
const override {
return 0; }
251 void offsetParams(Eigen::VectorXd
const &delta)
override;
254 ndarray::Array<double, 2, 2>
getCoefficients()
const {
return ndarray::copy(_coefficients); }
277 double computeChebyshev(
double x,
double y)
const;
283 void computeChebyshevDerivatives(
double x,
double y, Eigen::Ref<Eigen::VectorXd> derivatives)
const;
289 ndarray::Array<double, 2, 2> _coefficients;
290 ndarray::Size _order;
291 ndarray::Size _nParameters;
294 double oneIntegral(
double x,
double y)
const;
309 double transform(
double x,
double y,
double value)
const override {
310 return value * computeChebyshev(x, y);
315 Eigen::Ref<Eigen::VectorXd> derivatives)
const override {
316 computeChebyshevDerivatives(x, y, derivatives);
317 derivatives *= value;
322 return std::make_shared<FluxTransformChebyshev>(getCoefficients(), getBBox());
338 double transform(
double x,
double y,
double value)
const override {
339 return value + computeChebyshev(x, y);
344 Eigen::Ref<Eigen::VectorXd> derivatives)
const override {
346 computeChebyshevDerivatives(x, y, derivatives);
351 return std::make_shared<FluxTransformChebyshev>(getCoefficients(), getBBox());
358 #endif // LSST_JOINTCAL_PHOTOMETRY_TRANSFORM_H
A floating-point coordinate rectangle geometry.
A base class for image defects.
T setprecision(T... args)
UnaryFunctionT::result_type integrate(UnaryFunctionT func, typename UnaryFunctionT::argument_type const a, typename UnaryFunctionT::argument_type const b, double eps=1.0e-6)
The 1D integrator.
ndarray::Array< double const, 2, 2 > coefficients