LSST Applications g0265f82a02+0e5473021a,g02d81e74bb+0dd8ce4237,g1470d8bcf6+3ea6592b6f,g2079a07aa2+86d27d4dc4,g2305ad1205+5ca4c0b359,g295015adf3+d10818ec9d,g2a9a014e59+6f9be1b9cd,g2bbee38e9b+0e5473021a,g337abbeb29+0e5473021a,g3ddfee87b4+703ba97ebf,g487adcacf7+4fa16da234,g50ff169b8f+96c6868917,g52b1c1532d+585e252eca,g591dd9f2cf+ffa42b374e,g5a732f18d5+53520f316c,g64a986408d+0dd8ce4237,g858d7b2824+0dd8ce4237,g8a8a8dda67+585e252eca,g99cad8db69+d39438377f,g9ddcbc5298+9a081db1e4,ga1e77700b3+15fc3df1f7,ga8c6da7877+f1d96605c8,gb0e22166c9+60f28cb32d,gb6a65358fc+0e5473021a,gba4ed39666+c2a2e4ac27,gbb8dafda3b+e5339d463f,gc120e1dc64+da31e9920e,gc28159a63d+0e5473021a,gcf0d15dbbd+703ba97ebf,gdaeeff99f8+f9a426f77a,ge6526c86ff+889fc9d533,ge79ae78c31+0e5473021a,gee10cc3b42+585e252eca,gf18bd8381d+7268b93478,gff1a9f87cc+0dd8ce4237,w.2024.16
LSST Data Management Base Package
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
lsst::jointcal::ChipVisitAstrometryMapping Class Reference

The mapping with two transforms in a row. More...

#include <ChipVisitAstrometryMapping.h>

Inheritance diagram for lsst::jointcal::ChipVisitAstrometryMapping:
lsst::jointcal::AstrometryMapping

Public Member Functions

 ChipVisitAstrometryMapping (std::shared_ptr< SimpleAstrometryMapping > chipMapping, std::shared_ptr< SimpleAstrometryMapping > visitMapping)
 
 ChipVisitAstrometryMapping (ChipVisitAstrometryMapping const &)=delete
 No copy or move: there is only ever one instance of a given model (i.e.. per ccd+visit)
 
 ChipVisitAstrometryMapping (ChipVisitAstrometryMapping &&)=delete
 
ChipVisitAstrometryMappingoperator= (ChipVisitAstrometryMapping const &)=delete
 
ChipVisitAstrometryMappingoperator= (ChipVisitAstrometryMapping &&)=delete
 
std::size_t getNpar () const override
 Number of parameters in total.
 
void getMappingIndices (IndexVector &indices) const override
 Sets how this set of parameters (of length Npar()) map into the "grand" fit Expects that indices has enough space reserved.
 
void computeTransformAndDerivatives (FatPoint const &where, FatPoint &outPoint, Eigen::MatrixX2d &H) const override
 Actually applies the AstrometryMapping and evaluates the derivatives w.r.t the fitted parameters.
 
void transformPosAndErrors (FatPoint const &where, FatPoint &outPoint) const override
 The same as above but without the parameter derivatives (used to evaluate chi^2)
 
void offsetParams (Eigen::VectorXd const &delta) override
 Remember the error scale and freeze it.
 
AstrometryTransform const & getTransform1 () const
 access to transforms
 
AstrometryTransform const & getTransform2 () const
 access to transforms
 
void positionDerivative (Point const &where, Eigen::Matrix2d &derivative, double epsilon) const override
 The derivative w.r.t. position.
 
void freezeErrorTransform ()
 Currently not implemented.
 
void print (std::ostream &out) const override
 Print a string representation of the contents of this mapping, for debugging.
 

Friends

class ConstrainedAstrometryModel
 

Detailed Description

The mapping with two transforms in a row.

Definition at line 38 of file ChipVisitAstrometryMapping.h.

Constructor & Destructor Documentation

◆ ChipVisitAstrometryMapping() [1/3]

lsst::jointcal::ChipVisitAstrometryMapping::ChipVisitAstrometryMapping ( std::shared_ptr< SimpleAstrometryMapping > chipMapping,
std::shared_ptr< SimpleAstrometryMapping > visitMapping )

Definition at line 36 of file ChipVisitAstrometryMapping.cc.

38 : _m1(std::move(chipMapping)), _m2(std::move(visitMapping)) {
39 /* Allocate the record of temporary variables, so that they are not
40 allocated at every call. This is hidden behind a pointer in order
41 to be allowed to alter them in a const routine. */
42 tmp = std::make_unique<tmpVars>();
43 setWhatToFit(true, true);
44}
T move(T... args)

◆ ChipVisitAstrometryMapping() [2/3]

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

No copy or move: there is only ever one instance of a given model (i.e.. per ccd+visit)

◆ ChipVisitAstrometryMapping() [3/3]

lsst::jointcal::ChipVisitAstrometryMapping::ChipVisitAstrometryMapping ( ChipVisitAstrometryMapping && )
delete

Member Function Documentation

◆ computeTransformAndDerivatives()

void lsst::jointcal::ChipVisitAstrometryMapping::computeTransformAndDerivatives ( FatPoint const & where,
FatPoint & outPoint,
Eigen::MatrixX2d & H ) const
overridevirtual

Actually applies the AstrometryMapping and evaluates the derivatives w.r.t the fitted parameters.

This is grouped into a single call because for most models, evaluating the derivatives w.r.T parameters is not much longer than just transforming

Implements lsst::jointcal::AstrometryMapping.

Definition at line 65 of file ChipVisitAstrometryMapping.cc.

66 {
67 // not true in general. Will crash if H is too small.
68 // assert(H.cols()==Npar());
69
70 FatPoint pMid;
71 // don't need errors there but no Mapping::Transform() routine.
72
73 if (_nPar1) {
74 _m1->computeTransformAndDerivatives(where, pMid, tmp->h1);
75 // the last argument is epsilon and is not used for polynomials
76 _m2->positionDerivative(pMid, tmp->dt2dx, 1e-4);
77 H.block(0, 0, _nPar1, 2) = tmp->h1 * tmp->dt2dx;
78 } else
79 _m1->transformPosAndErrors(where, pMid);
80 if (_nPar2) {
81 _m2->computeTransformAndDerivatives(pMid, outPoint, tmp->h2);
82 H.block(_nPar1, 0, _nPar2, 2) = tmp->h2;
83 } else
84 _m2->transformPosAndErrors(pMid, outPoint);
85}

◆ freezeErrorTransform()

void lsst::jointcal::ChipVisitAstrometryMapping::freezeErrorTransform ( )

Currently not implemented.

Definition at line 122 of file ChipVisitAstrometryMapping.cc.

122 {
124 " The routine ChipVisitAstrometryMapping::freezeErrorTransform() was thought to be "
125 "useless and is not implemented (yet)");
126}
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition Exception.h:48
Reports errors from accepting an object of an unexpected or inappropriate type.
Definition Runtime.h:167

◆ getMappingIndices()

void lsst::jointcal::ChipVisitAstrometryMapping::getMappingIndices ( IndexVector & indices) const
overridevirtual

Sets how this set of parameters (of length Npar()) map into the "grand" fit Expects that indices has enough space reserved.

Implements lsst::jointcal::AstrometryMapping.

Definition at line 48 of file ChipVisitAstrometryMapping.cc.

48 {
49 std::size_t npar = getNpar();
50 if (indices.size() < npar) indices.resize(npar);
51 // in case we are only fitting one of the two transforms
52 if (_nPar1)
53 _m1->getMappingIndices(indices);
54 else if (_nPar2) {
55 _m2->getMappingIndices(indices);
56 return;
57 }
58 // if we get here we are fitting both
59 // there is probably a more elegant way to feed a subpart of a std::vector
60 IndexVector ind2(_nPar2);
61 _m2->getMappingIndices(ind2);
62 for (Eigen::Index k = 0; k < _nPar2; ++k) indices.at(k + _nPar1) = ind2.at(k);
63}
T at(T... args)
std::size_t getNpar() const override
Number of parameters in total.
T resize(T... args)
T size(T... args)

◆ getNpar()

std::size_t lsst::jointcal::ChipVisitAstrometryMapping::getNpar ( ) const
overridevirtual

Number of parameters in total.

Implements lsst::jointcal::AstrometryMapping.

Definition at line 46 of file ChipVisitAstrometryMapping.cc.

46{ return _nPar1 + _nPar2; }

◆ getTransform1()

AstrometryTransform const & lsst::jointcal::ChipVisitAstrometryMapping::getTransform1 ( ) const
inline

access to transforms

Definition at line 72 of file ChipVisitAstrometryMapping.h.

72{ return _m1->getTransform(); }

◆ getTransform2()

AstrometryTransform const & lsst::jointcal::ChipVisitAstrometryMapping::getTransform2 ( ) const
inline

access to transforms

Definition at line 75 of file ChipVisitAstrometryMapping.h.

75{ return _m2->getTransform(); }

◆ offsetParams()

void lsst::jointcal::ChipVisitAstrometryMapping::offsetParams ( Eigen::VectorXd const & delta)
inlineoverridevirtual

Remember the error scale and freeze it.

Note
this routine is not used when fitting (the Model manages the mappings separately), but can be useful for debugging

Implements lsst::jointcal::AstrometryMapping.

Definition at line 66 of file ChipVisitAstrometryMapping.h.

66 {
67 _m1->offsetParams(delta.segment(_m1->getIndex(), _m1->getNpar()));
68 _m2->offsetParams(delta.segment(_m2->getIndex() + _m1->getNpar(), _m2->getNpar()));
69 }

◆ operator=() [1/2]

ChipVisitAstrometryMapping & lsst::jointcal::ChipVisitAstrometryMapping::operator= ( ChipVisitAstrometryMapping && )
delete

◆ operator=() [2/2]

ChipVisitAstrometryMapping & lsst::jointcal::ChipVisitAstrometryMapping::operator= ( ChipVisitAstrometryMapping const & )
delete

◆ positionDerivative()

void lsst::jointcal::ChipVisitAstrometryMapping::positionDerivative ( Point const & where,
Eigen::Matrix2d & derivative,
double epsilon ) const
overridevirtual

The derivative w.r.t. position.

Implements lsst::jointcal::AstrometryMapping.

Definition at line 110 of file ChipVisitAstrometryMapping.cc.

111 {
112 Eigen::Matrix2d d1, d2; // seems that it does not trigger dynamic allocation
113 _m1->positionDerivative(where, d1, 1e-4);
114 FatPoint pMid;
115 _m1->transformPosAndErrors(where, pMid);
116 _m2->positionDerivative(pMid, d2, 1e-4);
117 /* The following line is not a mistake. It is a consequence
118 of chosing derivative(0,1) = d(y_out)/d x_in. */
119 derivative = d1 * d2;
120}

◆ print()

void lsst::jointcal::ChipVisitAstrometryMapping::print ( std::ostream & out) const
overridevirtual

Print a string representation of the contents of this mapping, for debugging.

This string representation can be very verbose, as it contains all of the parameters of all of the transforms in this mapping.

Implements lsst::jointcal::AstrometryMapping.

Definition at line 128 of file ChipVisitAstrometryMapping.cc.

128 {
129 out << "Composed Astrometry Mapping:" << std::endl;
130 out << "Sensor f(x,y)->(u,v): " << *_m1 << std::endl;
131 out << "Visit f(u,v)->alpha,delta: " << *_m2 << std::endl;
132}
T endl(T... args)

◆ transformPosAndErrors()

void lsst::jointcal::ChipVisitAstrometryMapping::transformPosAndErrors ( FatPoint const & where,
FatPoint & outPoint ) const
overridevirtual

The same as above but without the parameter derivatives (used to evaluate chi^2)

Implements lsst::jointcal::AstrometryMapping.

Definition at line 104 of file ChipVisitAstrometryMapping.cc.

104 {
105 FatPoint pMid;
106 _m1->transformPosAndErrors(where, pMid);
107 _m2->transformPosAndErrors(pMid, outPoint);
108}

Friends And Related Symbol Documentation

◆ ConstrainedAstrometryModel

friend class ConstrainedAstrometryModel
friend

Definition at line 85 of file ChipVisitAstrometryMapping.h.


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