lsst.jointcal  master-g9041cab851+10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | List of all members
lsst::jointcal::AstrometryFit Class Reference

Class that handles the astrometric least squares problem. More...

#include <AstrometryFit.h>

Inheritance diagram for lsst::jointcal::AstrometryFit:
lsst::jointcal::FitterBase

Public Member Functions

 AstrometryFit (std::shared_ptr< Associations > associations, std::shared_ptr< AstrometryModel > astrometryModel, double posError)
 this is the only constructor More...
 
 AstrometryFit (AstrometryFit const &)=delete
 No copy or move: there is only ever one fitter of a given type. More...
 
 AstrometryFit (AstrometryFit &&)=delete
 
AstrometryFitoperator= (AstrometryFit const &)=delete
 
AstrometryFitoperator= (AstrometryFit &&)=delete
 
void assignIndices (std::string const &whatToFit) override
 Set parameters to fit and assign indices in the big matrix. More...
 
void freezeErrorScales ()
 The transformations used to propagate errors are freezed to the current state. More...
 
void offsetParams (Eigen::VectorXd const &delta) override
 Offset the parameters by the requested quantities. More...
 
void saveResultTuples (std::string const &tupleName) const override
 Save the full chi2 term per star that was used in the minimization, for debugging. More...
 
void makeMeasResTuple (std::string const &tupleName) const
 Produces a tuple containing residuals of measurement terms. More...
 
void makeRefResTuple (std::string const &tupleName) const
 Produces a tuple containing residuals of reference terms. More...
 
void checkStuff ()
 DEBUGGING routine. More...
 
- Public Member Functions inherited from lsst::jointcal::FitterBase
 FitterBase (std::shared_ptr< Associations > associations)
 
 FitterBase (FitterBase const &)=delete
 No copy or move: there is only ever one fitter of a given type. More...
 
 FitterBase (FitterBase &&)=delete
 
FitterBaseoperator= (FitterBase const &)=delete
 
FitterBaseoperator= (FitterBase &&)=delete
 
MinimizeResult minimize (std::string const &whatToFit, double nSigmaCut=0)
 Does a 1 step minimization, assuming a linear model. More...
 
Chi2Statistic computeChi2 () const
 Returns the chi2 for the current state. More...
 
void leastSquareDerivatives (TripletList &tripletList, Eigen::VectorXd &grad) const
 Evaluates the chI^2 derivatives (Jacobian and gradient) for the current whatToFit setting. More...
 

Additional Inherited Members

- Protected Member Functions inherited from lsst::jointcal::FitterBase
unsigned findOutliers (double nSigmaCut, MeasuredStarList &msOutliers, FittedStarList &fsOutliers) const
 Find Measurements and references contributing more than a cut, computed as

\[ <chi2> + nSigmaCut + rms(chi2). \]

The outliers are NOT removed, and no refit is done. More...

 
void outliersContributions (MeasuredStarList &msOutliers, FittedStarList &fsOutliers, TripletList &tripletList, Eigen::VectorXd &grad)
 Contributions to derivatives from (presumably) outlier terms. More...
 
void removeMeasOutliers (MeasuredStarList &outliers)
 Remove measuredStar outliers from the fit. No Refit done. More...
 
void removeRefOutliers (FittedStarList &outliers)
 Remove refStar outliers from the fit. No Refit done. More...
 
- Protected Attributes inherited from lsst::jointcal::FitterBase
std::shared_ptr< Associations_associations
 
std::string _whatToFit
 
int _lastNTrip
 
unsigned int _nParTot
 
unsigned _nMeasuredStars
 

Detailed Description

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.

Definition at line 55 of file AstrometryFit.h.

Constructor & Destructor Documentation

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

this is the only constructor

Definition at line 28 of file AstrometryFit.cc.

lsst::jointcal::AstrometryFit::AstrometryFit ( AstrometryFit const &  )
delete

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

lsst::jointcal::AstrometryFit::AstrometryFit ( AstrometryFit &&  )
delete

Member Function Documentation

void lsst::jointcal::AstrometryFit::assignIndices ( std::string const &  whatToFit)
overridevirtual

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

Parameters
[in]whatToFitValid 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.

Implements lsst::jointcal::FitterBase.

Definition at line 431 of file AstrometryFit.cc.

void lsst::jointcal::AstrometryFit::checkStuff ( )

DEBUGGING routine.

Definition at line 521 of file AstrometryFit.cc.

void lsst::jointcal::AstrometryFit::freezeErrorScales ( )
inline

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.

Definition at line 94 of file AstrometryFit.h.

void lsst::jointcal::AstrometryFit::makeMeasResTuple ( std::string const &  tupleName) const

Produces a tuple containing residuals of measurement terms.

Definition at line 567 of file AstrometryFit.cc.

void lsst::jointcal::AstrometryFit::makeRefResTuple ( std::string const &  tupleName) const

Produces a tuple containing residuals of reference terms.

Definition at line 625 of file AstrometryFit.cc.

void lsst::jointcal::AstrometryFit::offsetParams ( Eigen::VectorXd const &  delta)
overridevirtual

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]deltavector of offsets to apply

Implements lsst::jointcal::FitterBase.

Definition at line 469 of file AstrometryFit.cc.

AstrometryFit& lsst::jointcal::AstrometryFit::operator= ( AstrometryFit const &  )
delete
AstrometryFit& lsst::jointcal::AstrometryFit::operator= ( AstrometryFit &&  )
delete
void lsst::jointcal::AstrometryFit::saveResultTuples ( std::string const &  tupleName) const
overridevirtual

Save the full chi2 term per star that was used in the minimization, for debugging.

Saves results to text files "tupleName-meas" and "tupleName-ref" for the MeasuredStar and RefStar tuples, respectively. This method is mostly useful for debugging: we will probably want to create a better persistence system for jointcal's internal representations in the future.

Implements lsst::jointcal::FitterBase.

Definition at line 553 of file AstrometryFit.cc.


The documentation for this class was generated from the following files: