Class AstrometryFit

Inheritance Relationships

Base Type

Class Documentation

class AstrometryFit : public lsst::jointcal::FitterBase

Class that handles the astrometric least squares problem.

This is the class that actually computes the quantities required to carry out a LS astrometric fit wrt distortion mappings and coordinates of common objects. Namely it computes the Jacobian and gradient of the chi2 (w.r.t. parameters), and the Chi2 itself. It interfaces with the actual modelling of distortions via a mimimum virtual interface AstrometryModel, and the actual mappings via an other virtual interface : Mapping.

In short AstrometryFit aims at computing derivatives of least quares. The terms of the chi2 are of two kinds:

kind 1 -> (T(X_M) - p(F))^T W (T(X_M) - p(F))

with X_M is a measured (2d) position in CCD coordinates, F refers to the position of the object in some space, defined in practise by p. There is one such term per measurement. The default setup would be that p is the projection from sky to some tangent plane and hence T maps the CCD coordinates onto this TP. p is obtained via the DistorsionModel and can be different for all CcdImage’s. Depending on what is beeing fitted, one could imagine cases where the projector p is the same for all CcdImages.

Kind 2 -> (p’(F)-p’(R))^T W_R (p’(F)-p’(R)) R refers to some externally-provided reference object position, and p’ to some projector from sky to some plane. The reference objects define the overall coordinate frame, which is required when all T and all F are fitted simultaneously. There is one such term per external reference object. There can be more F (fitted) objects than R (reference) objects.

In the same framework, one can fit relative transforms between images by setting p = Identity for all input CcdImages and not fitting T for one of the CcdImage’s. One does not need reference object and would then naturally not have any Kind 2 terms.

Public Functions

AstrometryFit(std::shared_ptr<Associations> associations, std::shared_ptr<AstrometryModel> astrometryModel, double posError)

this is the only constructor

AstrometryFit(AstrometryFit const&)

No copy or move: there is only ever one fitter of a given type.

AstrometryFit(AstrometryFit&&)
AstrometryFit &operator=(AstrometryFit const&)
AstrometryFit &operator=(AstrometryFit&&)
void assignIndices(std::string const &whatToFit)

Set parameters to fit and assign indices in the big matrix.

Parameters
  • [in] whatToFit: Valid strings: zero or more of “Distortions”, “Positions”, “Refrac”, “PM” which define which parameter set is going to be variable when computing derivatives (leastSquareDerivatives) and minimizing (minimize()). whatToFit=”Positions Distortions” will minimize w.r.t mappings and objects positions, and not w.r.t proper motions and refraction modeling. However if proper motions and/or refraction parameters have already been set, then they are accounted for when computing residuals. The string is forwarded to the AstrometryModel, and it can then be used to turn subsets of distortion parameter on or off, if the AstrometryModel implements such a thing.

void freezeErrorTransform()

The transformations used to propagate errors are freezed to the current state. The routine can be called when the mappings are roughly in place. After the call, the transformations used to propage errors are no longer affected when updating the mappings. This allows to have an exactly linear fit, which can be useful.

void offsetParams(Eigen::VectorXd const &delta)

Offset the parameters by the requested quantities. The used parameter layout is the one from the last call to assignIndices or minimize(). There is no easy way to check that the current setting of whatToFit and the provided Delta vector are compatible: we can only test the size.

Parameters
  • [in] delta: vector of offsets to apply

std::shared_ptr<AstrometryModel> getModel() const

Return the model being fit.

void checkStuff()

DEBUGGING routine

Protected Functions

void saveChi2MeasContributions(std::string const &filename) const

Save a CSV file containing residuals of measurement terms.

void saveChi2RefContributions(std::string const &filename) const

Save a CSV file containing residuals of reference terms.