63 size_t nObj =
im.getCatalogForFit().size();
69 if (
pol.getOrder() > 0)
71 while (
pol.getNpar() > 2 *
nObj) {
73 <<
pol.getOrder() <<
", due to too few sources (" <<
nObj
74 <<
" vs. " <<
pol.getNpar() <<
" parameters)");
75 pol.setOrder(
pol.getOrder() - 1);
86 const Frame &frame =
im.getImageFrame();
92 _myMap[
im.getHashKey()] =
103 if (
whatToFit.find(
"Distortions") == std::string::npos) {
104 LOGLS_ERROR(
_log,
"AssignIndices was called and Distortions is *not* in whatToFit.");
108 for (
auto &
i : _myMap) {
112 index += p->getNpar();
118 for (
auto &
i : _myMap) {
119 auto mapping =
i.second.
get();
120 mapping->offsetParams(
delta.segment(mapping->getIndex(), mapping->getNpar()));
125 for (
auto &
i : _myMap)
i.second->freezeErrorTransform();
130 for (
auto &
i : _myMap) {
131 total +=
i.second->getNpar();
137 out <<
"SimpleAstrometryModel: " << _myMap.size() <<
" mappings" <<
std::endl;
139 out <<
"Sensor to sky transforms:" <<
std::endl;
140 for (
auto &
i : _myMap) {
172 auto i = _myMap.find(
ccdImage.getHashKey());
173 if (
i == _myMap.end())
175 "SimpleAstrometryModel cannot find CcdImage " +
ccdImage.getName());
176 return i->second.
get();
#define LSST_EXCEPT(type,...)
#define LOGLS_WARN(logger, message)
#define LOGLS_ERROR(logger, message)
virtual class needed in the abstraction of the distortion model
Interface between AstrometryFit and the combinations of Mappings from pixels to some tangent plane (a...
LOG_LOGGER _log
lsst.logging instance, to be created by a subclass so that messages have consistent name.
Handler of an actual image from a single CCD.
rectangle with sides parallel to axes.
Class for a simple mapping implementing a generic AstrometryTransform.
void setIndex(Eigen::Index i)
Set the index of this mapping in the grand fit.
Eigen::Index assignIndices(std::string const &whatToFit, Eigen::Index firstIndex) override
Positions the various parameter sets into the parameter vector, starting at firstIndex.
void offsetParams(Eigen::VectorXd const &delta) override
Offset the parameters by the provided amounts (by -delta).
std::size_t getTotalParameters() const override
Return the total number of parameters in this model.
SimpleAstrometryModel(CcdImageList const &ccdImageList, std::shared_ptr< ProjectionHandler const > projectionHandler, bool initFromWCS, unsigned nNotFit=0, unsigned order=3)
const std::shared_ptr< AstrometryTransform const > getSkyToTangentPlane(CcdImage const &ccdImage) const override
the mapping of sky coordinates (i.e.
AstrometryTransform const & getTransform(CcdImage const &ccdImage) const
Access to mappings.
void print(std::ostream &out) const override
Print a string representation of the contents of this mapping, for debugging.
AstrometryMapping * findMapping(CcdImage const &ccdImage) const override
Return a pointer to the mapping associated with this ccdImage.
void freezeErrorTransform() override
const AstrometryMapping * getMapping(CcdImage const &) const override
Mapping associated to a given CcdImage.
std::shared_ptr< afw::geom::SkyWcs > makeSkyWcs(CcdImage const &ccdImage) const override
Make a SkyWcs that contains this model.
Mapping implementation for a polynomial transformation.
std::shared_ptr< SkyWcs > makeSkyWcs(daf::base::PropertySet &metadata, bool strip=false)
Eigen::Matrix2d makeCdMatrix(lsst::geom::Angle const &scale, lsst::geom::Angle const &orientation=0 *lsst::geom::degrees, bool flipX=false)
AngleUnit constexpr degrees
AstrometryTransformLinear normalizeCoordinatesTransform(const Frame &frame)
Returns the transformation that maps the input frame along both axes to [-1,1].