43 bool initFromWcs,
unsigned nNotFit,
unsigned order)
45 _skyToTangentPlane(projectionHandler)
50 for (
auto i = ccdImageList.
cbegin(); i != ccdImageList.
cend(); ++i, ++count) {
52 if (count < nNotFit) {
70 while (pol.
getNpar() > 2 * nObj) {
72 << pol.
getOrder() <<
", due to too few sources (" << nObj
73 <<
" vs. " << pol.
getNpar() <<
" parameters)");
89 pol = pol * shiftAndNormalize.
inverted();
98 return findMapping(ccdImage);
102 if (whatToFit.
find(
"Distortions") == std::string::npos) {
103 LOGLS_ERROR(
_log,
"AssignIndices was called and Distortions is *not* in whatToFit.");
106 Eigen::Index index = firstIndex;
107 for (
auto i = _myMap.begin(); i != _myMap.end(); ++i) {
117 for (
auto &i : _myMap) {
124 for (
auto &i : _myMap) i.second->freezeErrorTransform();
129 for (
auto &i : _myMap) {
130 total += i.second->getNpar();
152 auto iwcToSkyMap = iwcToSkyWcs->getFrameDict()->getMapping(
"PIXELS",
"SKY");
153 auto skyFrame = iwcToSkyWcs->getFrameDict()->getFrame(
"SKY");
157 return std::make_shared<afw::geom::SkyWcs>(frameDict);
162 if (i == _myMap.end())
164 "SimpleAstrometryModel cannot find CcdImage " + ccdImage.
getName());
165 return i->second.get();
#define LOGLS_WARN(logger, message)
Log a warn-level message using an iostream-based interface.
AstrometryTransform const & getTransform(CcdImage const &ccdImage) const
Access to mappings.
SimpleAstrometryModel(CcdImageList const &ccdImageList, const std::shared_ptr< ProjectionHandler const > projectionHandler, bool initFromWCS, unsigned nNotFit=0, unsigned order=3)
LOG_LOGGER _log
lsst.logging instance, to be created by a subclass so that messages have consistent name...
const AstrometryMapping * getMapping(CcdImage const &) const override
Mapping associated to a given CcdImage.
std::size_t getNpar() const
Number of parameters in total.
void offsetParams(Eigen::VectorXd const &delta) override
Offset the parameters by the provided amounts (by -delta).
std::shared_ptr< AstrometryTransform > const getPixelToTangentPlane() const
std::string getName() const
Return the _name that identifies this ccdImage.
void setIndex(Eigen::Index i)
Mapping implementation for a polynomial transformation.
Interface between AstrometryFit and the combinations of Mappings from pixels to some tangent plane (a...
std::size_t getTotalParameters() const override
Return the total number of parameters in this model.
const std::shared_ptr< AstrometryTransform const > getSkyToTangentPlane(CcdImage const &ccdImage) const override
the mapping of sky coordinates (i.e.
Eigen::Index assignIndices(std::string const &whatToFit, Eigen::Index firstIndex) override
Positions the various parameter sets into the parameter vector, starting at firstIndex.
LSST DM logging module built on log4cxx.
std::shared_ptr< afw::geom::SkyWcs > makeSkyWcs(CcdImage const &ccdImage) const override
Make a SkyWcs that contains this model.
rectangle with sides parallel to axes.
AstrometryTransformLinear normalizeCoordinatesTransform(const Frame &frame)
Returns the transformation that maps the input frame along both axes to [-1,1].
AngleUnit constexpr degrees
constant with units of degrees
A base class for image defects.
void addFrame(int iframe, Mapping const &map, Frame const &frame) override
Add a new Frame and an associated Mapping to this FrameSet so as to define a new coordinate system...
Frame is used to represent a coordinate system.
This one is the Tangent Plane (called gnomonic) projection (from celestial sphere to tangent plane) ...
T dynamic_pointer_cast(T... args)
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Point in an unspecified spherical coordinate system.
MeasuredStarList const & getCatalogForFit() const
Gets the catalog to be used for fitting, which may have been cleaned-up.
std::shared_ptr< SkyWcs > makeSkyWcs(daf::base::PropertySet &metadata, bool strip=false)
Construct a SkyWcs from FITS keywords.
Eigen::Matrix2d makeCdMatrix(lsst::geom::Angle const &scale, lsst::geom::Angle const &orientation=0 *lsst::geom::degrees, bool flipX=false)
Make a WCS CD matrix.
Reports invalid arguments.
virtual class needed in the abstraction of the distortion model
CcdImageKey getHashKey() const
Handler of an actual image from a single CCD.
#define LOG_GET(logger)
Returns a Log object associated with logger.
A FrameSet whose frames can be referenced by domain name.
#define LOGLS_ERROR(logger, message)
Log a error-level message using an iostream-based interface.
void freezeErrorTransform() override
Frame const & getImageFrame() const
Frame in pixels.