15 LOG_LOGGER _log =
LOG_GET(
"jointcal.SimplePolyModel");
23 bool initFromWcs,
unsigned nNotFit,
unsigned degree)
24 : _sky2TP(projectionHandler)
31 for (
auto i = ccdImageList.
cbegin(); i != ccdImageList.
cend(); ++i, ++count) {
33 if (count < nNotFit) {
63 pol = pol * shiftAndNormalize.
invert();
72 mapType::const_iterator i = _myMap.
find(&ccdImage);
73 if (i == _myMap.
cend())
75 "SimplePolyModel::GetMapping, never heard of CcdImage " + ccdImage.
getName());
76 return (i->second.get());
80 if (whatToFit.
find(
"Distortions") == std::string::npos) {
81 LOGLS_ERROR(_log,
"AssignIndices was called and Distortions is *not* in whatToFit.");
84 unsigned index = firstIndex;
85 for (
auto i = _myMap.
begin(); i != _myMap.
end(); ++i) {
95 for (
auto &i : _myMap) {
96 auto mapping = i.second.get();
97 mapping->offsetParams(delta.segment(mapping->getIndex(), mapping->getNpar()));
102 for (
auto i = _myMap.
begin(); i != _myMap.
end(); ++i) i->second->freezeErrorScales();
107 auto p = _myMap.
find(&ccdImage);
108 if (p == _myMap.
end())
110 "SimplePolyModel::getTransfo, never heard of CcdImage " + ccdImage.
getName());
111 return p->second->getTransfo();
117 if (!proj)
return nullptr;
129 return std::make_shared<TanSipPix2RaDec>(cdStuff, tangentPoint, &sip);
#define LOGLS_WARN(logger, message)
implements the linear transformations (6 real coefficients).
virtual class needed in the abstraction of the distortion model
GtransfoLin invert() const
returns the inverse: T1 = T2.invert();
std::string getName() const
Return the _name that identifies this ccdImage.
Mapping implementation for a polynomial transformation.
const Gtransfo * getSky2TP(CcdImage const &ccdImage) const
the mapping of sky coordinates (i.e.
Gtransfo const * getPix2TangentPlane() const
Polynomial transformation class.
GtransfoLin normalizeCoordinatesTransfo(const Frame &frame)
Returns the transformation that maps the input frame along both axes to [-1,1].
Gtransfo const & getTransfo(CcdImage const &ccdImage) const
Access to mappings.
unsigned assignIndices(unsigned firstIndex, std::string const &whatToFit)
Positions the various parameter sets into the parameter vector, starting at firstIndex.
unsigned getNpar() const
Number of parameters in total.
rectangle with sides parallel to axes.
Class for a simple mapping implementing a generic Gtransfo.
SimplePolyModel(CcdImageList const &ccdImageList, ProjectionHandler const *projectionHandler, bool initFromWCS, unsigned nNotFit=0, unsigned degree=3)
Sky2TP is just a name, it can be anything.
virtual void freezeErrorScales()
Point getTangentPoint() const
tangent point coordinates (in degrees)
This is a virtual class that allows a lot of freedom in the choice of the projection from "Sky" (wher...
void setIndex(unsigned i)
void offsetParams(Eigen::VectorXd const &delta)
Offset the parameters by the provided amounts.
const Mapping * getMapping(CcdImage const &) const
Mapping associated to a given CcdImage.
unsigned getDegree() const
returns degree
Point getCenter() const
Center of the frame.
A do-nothing transformation. It anyway has dummy routines to mimick a Gtransfo.
#define LSST_EXCEPT(type,...)
virtual GtransfoLin linearApproximation(const Point &where, const double step=0.01) const
linear (local) approximation.
This one is the Tangent Plane (called gnomonic) projection (from celestial sphere to tangent plane) ...
GtransfoLin getLinPart() const
The Linear part (corresponding to CD's and CRPIX's)
MeasuredStarList const & getCatalogForFit() const
Gets the catalog to be used for fitting, which may have been cleaned-up.
a virtual (interface) class for geometric transformations.
void setDegree(const unsigned degree)
std::shared_ptr< TanSipPix2RaDec > produceSipWcs(CcdImage const &ccdImage) const
Cook up a SIP WCS.
Handler of an actual image from a single CCD.
#define LOGLS_ERROR(logger, message)
Frame const & getImageFrame() const
Frame in pixels.
int getNpar() const
total number of parameters