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 Mapping * getMapping(const CcdImage &) const
Mapping associated to a given CcdImage.
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
void offsetParams(const Eigen::VectorXd &delta)
Offset the parameters by the provided amounts.
const Gtransfo * getPix2TangentPlane() const
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)
SimplePolyModel(const CcdImageList &ccdImageList, const ProjectionHandler *projectionHandler, bool initFromWCS, unsigned nNotFit=0, unsigned degree=3)
Sky2TP is just a name, it can be anything.
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(const double *delta)
Remember the error scale and freeze it.
rectangle with sides parallel to axes.
const Gtransfo & getTransfo(const CcdImage &ccdImage) const
Access to mappings.
std::shared_ptr< TanSipPix2RaDec > produceSipWcs(const CcdImage &ccdImage) const
Cook up a SIP WCS.
virtual void freezeErrorScales()
const Frame & getImageFrame() const
Frame in pixels.
This is a virtual class that allows a lot of freedom in the choice of the projection from "Sky" (wher...
void setIndex(unsigned i)
const MeasuredStarList & getCatalogForFit() const
Gets the catalog to be used for fitting, which may have been cleaned-up.
A do-nothing transformation. It anyway has dummy routines to mimick a Gtransfo.
const Gtransfo * getSky2TP(const CcdImage &ccdImage) const
the mapping of sky coordinates (i.e.
This one is the Tangent Plane (called gnomonic) projection (from celestial sphere to tangent plane) ...
unsigned assignIndices(unsigned firstIndex, const std::string &whatToFit)
Positions the various parameter sets into the parameter vector, starting at firstIndex.
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
Handler of an actual image from a single CCD.
GtransfoLin invert() const
returns the inverse: T1 = T2.invert();
std::string getName() const
Return the _name that identifies this ccdImage.