LSST Applications g0f08755f38+c89d42e150,g1635faa6d4+b6cf076a36,g1653933729+a8ce1bb630,g1a0ca8cf93+4c08b13bf7,g28da252d5a+f33f8200ef,g29321ee8c0+0187be18b1,g2bbee38e9b+9634bc57db,g2bc492864f+9634bc57db,g2cdde0e794+c2c89b37c4,g3156d2b45e+41e33cbcdc,g347aa1857d+9634bc57db,g35bb328faa+a8ce1bb630,g3a166c0a6a+9634bc57db,g3e281a1b8c+9f2c4e2fc3,g414038480c+077ccc18e7,g41af890bb2+e740673f1a,g5fbc88fb19+17cd334064,g7642f7d749+c89d42e150,g781aacb6e4+a8ce1bb630,g80478fca09+f8b2ab54e1,g82479be7b0+e2bd23ab8b,g858d7b2824+c89d42e150,g9125e01d80+a8ce1bb630,g9726552aa6+10f999ec6a,ga5288a1d22+065360aec4,gacf8899fa4+9553554aa7,gae0086650b+a8ce1bb630,gb58c049af0+d64f4d3760,gbd46683f8f+ac57cbb13d,gc28159a63d+9634bc57db,gcf0d15dbbd+e37acf7834,gda3e153d99+c89d42e150,gda6a2b7d83+e37acf7834,gdaeeff99f8+1711a396fd,ge2409df99d+cb1e6652d6,ge79ae78c31+9634bc57db,gf0baf85859+147a0692ba,gf3967379c6+02b11634a5,w.2024.45
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: