3 #include "lsst/log/Log.h"
9 #include "lsst/pex/exceptions.h"
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) {
36 _myMap[&im] = std::move(
id);
45 LOGLS_WARN(_log,
"Empty catalog from image: " << im.
getName());
63 pol = pol * shiftAndNormalize.
invert();
66 std::unique_ptr<SimpleGtransfoMapping>(
new SimplePolyMapping(shiftAndNormalize, pol));
72 mapType::const_iterator i = _myMap.find(&ccdImage);
73 if (i == _myMap.cend())
74 throw LSST_EXCEPT(pex::exceptions::InvalidParameterError,
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.begin(); i != _myMap.end(); ++i) {
103 for (
auto i = _myMap.begin(); i != _myMap.end(); ++i) i->second->freezeErrorScales();
108 auto p = _myMap.find(&ccdImage);
109 if (p == _myMap.end())
110 throw LSST_EXCEPT(pex::exceptions::InvalidParameterError,
111 "SimplePolyModel::getTransfo, never heard of CcdImage " + ccdImage.
getName());
112 return p->second->getTransfo();
118 if (!proj)
return nullptr;
130 return std::make_shared<TanSipPix2RaDec>(cdStuff, tangentPoint, &sip);
implements the linear transformations (6 real coefficients).
GtransfoLin getLinPart() const
The Linear part (corresponding to CD's and CRPIX's)
const Gtransfo * getSky2TP(CcdImage const &ccdImage) const
the mapping of sky coordinates (i.e.
virtual class needed in the abstraction of the distortion model
unsigned getDegree() const
returns degree
unsigned getIndex() const
position of the parameters within the grand fitting scheme
int getNpar() const
total number of parameters
Mapping implementation for a polynomial transformation.
virtual GtransfoLin linearApproximation(const Point &where, const double step=0.01) const
linear (local) approximation.
Point getTangentPoint() const
tangent point coordinates (in degrees)
const Mapping * getMapping(CcdImage const &) const
Mapping associated to a given CcdImage.
MeasuredStarList const & getCatalogForFit() const
Gets the catalog to be used for fitting, which may have been cleaned-up.
Polynomial transformation class.
GtransfoLin normalizeCoordinatesTransfo(const Frame &frame)
Returns the transformation that maps the input frame along both axes to [-1,1].
unsigned getNpar() const
Number of parameters in total.
void offsetParams(double const *delta)
Remember the error scale and freeze it.
Gtransfo const * getPix2TangentPlane() const
unsigned assignIndices(unsigned firstIndex, std::string const &whatToFit)
Positions the various parameter sets into the parameter vector, starting at firstIndex.
Gtransfo const & getTransfo(CcdImage const &ccdImage) const
Access to mappings.
rectangle with sides parallel to axes.
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()
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.
A do-nothing transformation. It anyway has dummy routines to mimick a Gtransfo.
This one is the Tangent Plane (called gnomonic) projection (from celestial sphere to tangent plane) ...
a virtual (interface) class for geometric transformations.
Point getCenter() const
Center of the frame.
void setDegree(const unsigned degree)
std::list< std::shared_ptr< CcdImage > > CcdImageList
std::shared_ptr< TanSipPix2RaDec > produceSipWcs(CcdImage const &ccdImage) const
Cook up a SIP WCS.
Handler of an actual image from a single CCD.
GtransfoLin invert() const
returns the inverse: T1 = T2.invert();
Frame const & getImageFrame() const
Frame in pixels.
std::string getName() const
Return the _name that identifies this ccdImage.