26 #ifndef LSST_AFW_IMAGE_WCS_H
27 #define LSST_AFW_IMAGE_WCS_H
51 namespace formatters {
113 typedef boost::shared_ptr<Wcs>
Ptr;
125 Eigen::Matrix2d
const & CD,
126 std::string
const &
ctype1=
"RA---TAN", std::string
const &
ctype2=
"DEC--TAN",
127 double equinox=2000, std::string
const & raDecSys=
"ICRS",
128 std::string
const & cunits1=
"deg", std::string
const & cunits2=
"deg"
196 double pixel1,
double pixel2, geom::
Angle& sky1, geom::
Angle& sky2
331 Eigen::Matrix2d const & CD,
333 double equinox, std::
string const & raDecSys,
334 std::
string const & cunits1, std::
string const & cunits2
358 explicit
Wcs(afw::
table::BaseRecord const & record);
361 Wcs& operator= (const
Wcs &);
376 coord::
Coord const & coord,
377 geom::AngleUnit skyUnit
382 coord::
Coord const & coord,
383 geom::AngleUnit skyUnit
413 double CD11,
double CD12,
double CD21,
double CD22);
441 virtual
PTR(afw::geom::XYTransform)
clone() const;
453 #endif // LSST_AFW_IMAGE_WCS_H
geom::Point2I getImageXY0FromMetadata(std::string const &wcsName, lsst::daf::base::PropertySet *metadata)
virtual bool hasDistortion() const
A coordinate class intended to represent absolute positions.
lsst::afw::geom::Angle Angle
lsst::afw::coord::Coord Coord
geom::AffineTransform linearizePixelToSky(coord::Coord const &coord, geom::AngleUnit skyUnit=geom::degrees) const
Return the local linear approximation to Wcs::pixelToSky at a point given in sky coordinates.
An object passed to Persistable::write to allow it to persist itself.
boost::shared_ptr< Coord > Ptr
virtual void pixelToSkyImpl(double pixel1, double pixel2, geom::Angle skyTmp[2]) const
Class for storing ordered metadata with comments.
friend Wcs::Ptr makeWcs(boost::shared_ptr< lsst::daf::base::PropertySet > const &fitsMetadata, bool stripMetadata)
Create a Wcs of the correct class using a FITS header.
geom::Point2D skyToPixel(geom::Angle sky1, geom::Angle sky2) const
Convert from sky coordinates (e.g. RA/dec) to pixel positions.
afw::coord::Coord::Ptr convertCoordToSky(coord::Coord const &coord) const
virtual bool _isSubset(Wcs const &other) const
afw::coord::Coord::Ptr makeCorrectCoord(geom::Angle sky0, geom::Angle sky1) const
Given a sky position, use the values stored in ctype and radesys to return the correct sub-class of C...
void initWcsLibFromFits(boost::shared_ptr< lsst::daf::base::PropertySet const > const &fitsMetadata)
Parse a fits header, extract the relevant metadata and create a Wcs object.
table::PointKey< double > crval
Point< double, 2 > Point2D
void initWcsLib(geom::Point2D const &crval, geom::Point2D const &crpix, Eigen::Matrix2d const &CD, std::string const &ctype1, std::string const &ctype2, double equinox, std::string const &raDecSys, std::string const &cunits1, std::string const &cunits2)
Manually initialise a wcs struct using values passed by the constructor.
virtual geom::AffineTransform linearizeSkyToPixelInternal(geom::Point2D const &pix, coord::Coord const &coord, geom::AngleUnit skyUnit) const
virtual void write(OutputArchiveHandle &handle) const
Write the object to one or more catalogs.
geom::Point2D skyToIntermediateWorldCoord(coord::Coord const &coord) const
Convert from sky coordinates (e.g. RA/dec) to intermediate world coordinates.
virtual Ptr clone(void) const
Implementation of the WCS standard for a any projection.
boost::shared_ptr< coord::Coord > pixelToSky(double pix1, double pix2) const
Convert from pixel position to sky coordinates (e.g. RA/dec)
table::Key< std::string > ctype2
bool _mayBePersistable() const
Perform basic checks on whether *this might be persistable.
A class used to convert scalar POD types such as double to Angle.
virtual void shiftReferencePixel(double dx, double dy)
Move the pixel reference position by (dx, dy)
virtual geom::Point2D skyToPixelImpl(geom::Angle sky1, geom::Angle sky2) const
std::map< Citizen const *, CitizenInfo > table
table::Key< table::Array< Kernel::Pixel > > image
A base class for objects that can be persisted via afw::table::io Archive classes.
virtual std::string getPythonModule() const
Return the fully-qualified Python module that should be imported to guarantee that its factory is reg...
virtual boost::shared_ptr< lsst::daf::base::PropertyList > getFitsMetadata() const
Return a PropertyList containing FITS header keywords that can be used to save the Wcs...
afw::table::PointKey< int > dimensions
boost::shared_ptr< Wcs const > ConstPtr
virtual void rotateImageBy90(int nQuarter, lsst::afw::geom::Extent2I dimensions) const
Rotate image by nQuarter times 90 degrees.
table::Key< double > equinox
bool operator==(Wcs const &other) const
Eigen::Matrix2d getCDMatrix() const
Returns the CD matrix.
geom::Angle pixelScale() const
Returns the pixel scale [Angle/pixel].
Wcs()
Construct an invalid Wcs given no arguments.
lsst::afw::geom::Point2D getPixelOrigin() const
Returns CRPIX (corrected to LSST convention).
virtual void flipImage(int flipLR, int flipTB, lsst::afw::geom::Extent2I dimensions) const
Flip CD matrix around the y-axis.
boost::shared_ptr< lsst::daf::base::PropertyList > createTrivialWcsAsPropertySet(std::string const &wcsName, int const x0=0, int const y0=0)
lsst::afw::coord::Coord::Ptr getSkyOrigin() const
Returns CRVAL. This need not be the centre of the image.
virtual geom::AffineTransform linearizePixelToSkyInternal(geom::Point2D const &pix, coord::Coord const &coord, geom::AngleUnit skyUnit) const
#define LSST_PERSIST_FORMATTER(formatter...)
boost::shared_ptr< Wcs > Ptr
Interface for Persistable base class.
bool operator!=(Wcs const &other) const
virtual std::string getPersistenceName() const
Return the unique name used to persist this object and look up its factory.
Base class for all records.
int _wcshdrCtrl
Controls messages to stderr from wcshdr (0 for none); see wcshdr.h for details.
geom::LinearTransform getLinearTransform() const
int _relax
Degree of permissiveness for wcspih (0 for strict); see wcshdr.h for details.
Class for storing generic metadata.
int _wcsfixCtrl
Do potentially unsafe translations of non-standard unit strings? 0/1 = no/yes.
virtual bool isPersistable() const
Whether the Wcs is persistable using afw::table::io archives.
double pixArea(lsst::afw::geom::Point2D pix00) const
Sky area covered by a pixel at position pix00 in units of square degrees.
geom::AffineTransform linearizeSkyToPixel(coord::Coord const &coord, geom::AngleUnit skyUnit=geom::degrees) const
Return the local linear approximation to Wcs::skyToPixel at a point given in sky coordinates.
lsst::afw::image::XYTransformFromWcsPair XYTransformFromWcsPair
table::PointKey< int > pixel
Base class for all persistable classes.
Citizen is a class that should be among all LSST classes base classes, and handles basic memory manag...
int stripWcsKeywords(boost::shared_ptr< lsst::daf::base::PropertySet > const &metadata, boost::shared_ptr< Wcs const > const &wcs)
A coordinate class intended to represent offsets and dimensions.
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
Functions to handle coordinates.