25 #ifndef LSST_AFW_IMAGE_WCS_H 26 #define LSST_AFW_IMAGE_WCS_H 30 #include "lsst/base.h" 31 #include "lsst/daf/base/Persistable.h" 32 #include "lsst/daf/base/Citizen.h" 50 namespace formatters {
104 class Wcs :
public lsst::daf::base::Persistable,
105 public lsst::daf::base::Citizen,
114 friend std::shared_ptr<Wcs>
makeWcs(std::shared_ptr<lsst::daf::base::PropertySet>
const& fitsMetadata,
133 Eigen::Matrix2d
const& CD, std::string
const&
ctype1 =
"RA---TAN",
134 std::string
const&
ctype2 =
"DEC--TAN",
double equinox = 2000, std::string
const& raDecSys =
"ICRS",
135 std::string
const& cunits1 =
"deg", std::string
const& cunits2 =
"deg");
138 virtual std::shared_ptr<Wcs>
clone(
void)
const;
144 std::shared_ptr<lsst::afw::coord::Coord> getSkyOrigin()
const;
150 Eigen::Matrix2d getCDMatrix()
const;
159 virtual std::shared_ptr<lsst::daf::base::PropertyList> getFitsMetadata()
const;
169 bool isFlipped()
const;
187 std::shared_ptr<coord::Coord> pixelToSky(
double pix1,
double pix2)
const;
231 double getEquinox()
const;
240 bool isSameSkySystem(
Wcs const& wcs)
const;
330 virtual void shiftReferencePixel(
double dx,
double dy);
336 virtual bool isPersistable()
const;
356 std::string
const& raDecSys, std::string
const& cunits1, std::string
const& cunits2);
361 bool _mayBePersistable()
const;
363 virtual std::string getPersistenceName()
const;
364 virtual std::string getPythonModule()
const;
368 virtual bool _isSubset(
Wcs const& other)
const;
387 Wcs(std::shared_ptr<daf::base::PropertySet const>
const& fitsMetadata);
394 Wcs& operator=(
const Wcs&);
399 virtual void pixelToSkyImpl(
double pixel1,
double pixel2,
geom::Angle skyTmp[2])
const;
418 std::shared_ptr<afw::coord::Coord> convertCoordToSky(
coord::Coord const& coord)
const;
437 void initWcsLibFromFits(std::shared_ptr<lsst::daf::base::PropertySet const>
const& fitsMetadata);
442 void _setWcslibParams();
471 std::shared_ptr<Wcs>
makeWcs(std::shared_ptr<lsst::daf::base::PropertySet>
const& fitsMetadata,
472 bool stripMetadata =
false);
487 double CD21,
double CD22);
491 std::shared_ptr<lsst::daf::base::PropertySet>
const& metadata,
492 std::shared_ptr<Wcs const>
const& wcs
511 virtual std::shared_ptr<afw::geom::XYTransform> invert()
const;
514 virtual std::shared_ptr<afw::geom::XYTransform>
clone()
const;
519 std::shared_ptr<Wcs const>
_dst;
520 std::shared_ptr<Wcs const>
_src;
527 #endif // LSST_AFW_IMAGE_WCS_H
virtual bool hasDistortion() const
afw::coord::CoordSystem getCoordSystem() const
std::shared_ptr< ImageT > flipImage(ImageT const &inImage, bool flipLR, bool flipTB)
Flip an image left–right and/or top–bottom.
int stripWcsKeywords(std::shared_ptr< lsst::daf::base::PropertySet > const &metadata, std::shared_ptr< Wcs const > const &wcs)
An object passed to Persistable::write to allow it to persist itself.
std::shared_ptr< Wcs > makeWcs(coord::Coord const &crval, geom::Point2D const &crpix, double CD11, double CD12, double CD21, double CD22)
Create a Wcs object from crval, crpix, CD, using CD elements (useful from python) ...
AngleUnit constexpr degrees
constant with units of degrees
table::PointKey< double > crval
bool operator==(CoordKey const &lhs, CoordKey const &rhs)
Compare CoordKeys for equality using the constituent Keys.
Implementation of the WCS standard for a any projection.
table::Key< std::string > ctype2
A class used to convert scalar POD types such as double to Angle.
A base class for objects that can be persisted via afw::table::io Archive classes.
lsst::daf::base::PropertySet PropertySet
afw::table::PointKey< int > dimensions
A class representing an angle.
A base class for image defects.
geom::Point2I getImageXY0FromMetadata(std::string const &wcsName, lsst::daf::base::PropertySet *metadata)
std::shared_ptr< lsst::daf::base::PropertyList > createTrivialWcsAsPropertySet(std::string const &wcsName, int const x0=0, int const y0=0)
table::Key< double > equinox
std::shared_ptr< ImageT > rotateImageBy90(ImageT const &image, int nQuarter)
Rotate an image by an integral number of quarter turns.
bool _skyAxesSwapped
if true then the sky axes are swapped
Base class for all records.
bool operator!=(Wcs const &other) const
int _wcshdrCtrl
Controls messages to stderr from wcshdr (0 for none); see wcshdr.h for details.
int _relax
Degree of permissiveness for wcspih (0 for strict); see wcshdr.h for details.
int _wcsfixCtrl
Do potentially unsafe translations of non-standard unit strings? 0/1 = no/yes.
table::PointKey< int > pixel
This is the base class for spherical coordinates.
A CRTP facade class for subclasses of Persistable.
table::Key< std::string > ctype1
coord::CoordSystem _coordSystem
virtual void shiftReferencePixel(geom::Extent2D const &d)
table::PointKey< double > crpix