lsst.afw  14.0-25-g0e8fc950e+7
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | List of all members
lsst::afw::image::DistortedTanWcs Class Reference

Combination of a TAN WCS and a distortion model. More...

#include <DistortedTanWcs.h>

Inheritance diagram for lsst::afw::image::DistortedTanWcs:
lsst::afw::image::TanWcs lsst::afw::table::io::PersistableFacade< TanWcs > lsst::afw::image::Wcs lsst::daf::base::Persistable lsst::daf::base::Citizen lsst::afw::table::io::PersistableFacade< Wcs > lsst::afw::table::io::Persistable

Public Types

using Transform = geom::Transform< geom::Point2Endpoint, geom::Point2Endpoint >
 
typedef std::shared_ptr< Persistable > Ptr
 
typedef unsigned long memId
 
typedef memId(* memNewCallback) (const memId cid)
 
typedef memId(* memCallback) (const Citizen *ptr)
 

Public Member Functions

 DistortedTanWcs (TanWcs const &tanWcs, Transform const &pixelsToTanPixels)
 Construct a DistortedTanWcs. More...
 
virtual ~DistortedTanWcs ()
 
virtual std::shared_ptr< Wcs > clone () const
 Polymorphic deep-copy. More...
 
bool operator== (Wcs const &other) const
 
virtual void flipImage (int flipLR, int flipTB, lsst::afw::geom::Extent2I dimensions) const
 
virtual void rotateImageBy90 (int nQuarter, lsst::afw::geom::Extent2I dimensions) const
 
virtual void shiftReferencePixel (double dx, double dy)
 
bool isPersistable () const
 Whether the Wcs is persistable using afw::table::io archives. More...
 
bool hasDistortion () const
 
std::shared_ptr< Wcs > getTanWcs () const
 return the pure tan WCS component More...
 
std::shared_ptr< Transform > getPixelToTanPixel () const
 return the PIXELS to TAN_PIXELS Transform More...
 
geom::Angle pixelScale () const
 Returns the pixel scale, in Angle/pixel. More...
 
geom::Point2D distortPixel (geom::Point2D const &pixel) const
 Applies the SIP AP and BP distortion (used in the skyToPixel direction) More...
 
geom::Point2D undistortPixel (geom::Point2D const &pixel) const
 Applies the SIP A and B un-distortion (used in the pixelToSky direction) More...
 
std::shared_ptr< daf::base::PropertyList > getFitsMetadata () const override
 Return a PropertyList containing FITS header keywords that can be used to save the Wcs.x. More...
 
void setDistortionMatrices (Eigen::MatrixXd const &sipA, Eigen::MatrixXd const &sipB, Eigen::MatrixXd const &sipAp, Eigen::MatrixXd const &sipBp)
 Set the distortion matrices. More...
 
Eigen::MatrixXd const & getSipA () const
 Return the SIP forward distortion matrix for the 1st intermediate world coordinate system axis. More...
 
Eigen::MatrixXd const & getSipB () const
 Return the SIP forward distortion matrix for the 2st intermediate world coordinate system axis. More...
 
Eigen::MatrixXd const & getSipAp () const
 Return the SIP reverse distortion matrix for x pixel coordinates. More...
 
Eigen::MatrixXd const & getSipBp () const
 Return the SIP reverse distortion matrix for y pixel coordinates. More...
 
bool operator!= (Wcs const &other) const
 
std::shared_ptr< lsst::afw::coord::Coord > getSkyOrigin () const
 Returns CRVAL. This need not be the centre of the image. More...
 
lsst::afw::geom::Point2D getPixelOrigin () const
 Returns CRPIX (corrected to LSST convention). More...
 
Eigen::Matrix2d getCDMatrix () const
 Returns the CD matrix. More...
 
bool isFlipped () const
 Does the Wcs follow the convention of North=Up, East=Left? More...
 
double pixArea (lsst::afw::geom::Point2D pix00) const
 Sky area covered by a pixel at position pix00 in units of square degrees. More...
 
std::shared_ptr< coord::Coord > pixelToSky (double pix1, double pix2) const
 Convert from pixel position to sky coordinates (e.g. More...
 
std::shared_ptr< coord::Coord > pixelToSky (lsst::afw::geom::Point2D const &pixel) const
 Convert from pixel position to sky coordinates (e.g. More...
 
void pixelToSky (double pixel1, double pixel2, geom::Angle &sky1, geom::Angle &sky2) const
 Convert from pixel position to sky coordinates (e.g. More...
 
geom::Point2D skyToPixel (geom::Angle sky1, geom::Angle sky2) const
 Convert from sky coordinates (e.g. More...
 
geom::Point2D skyToPixel (coord::Coord const &coord) const
 Convert from sky coordinates (e.g. RA/dec) to pixel positions. More...
 
geom::Point2D skyToIntermediateWorldCoord (coord::Coord const &coord) const
 Convert from sky coordinates (e.g. More...
 
afw::coord::CoordSystem getCoordSystem () const
 
double getEquinox () const
 
bool isSameSkySystem (Wcs const &wcs) const
 Return true if a WCS has the same coordinate system and equinox as this one. More...
 
geom::LinearTransform getLinearTransform () const
 Return the linear part of the Wcs, the CD matrix in FITS-speak, as an AffineTransform. More...
 
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. More...
 
geom::AffineTransform linearizePixelToSky (geom::Point2D const &pix, geom::AngleUnit skyUnit=geom::degrees) const
 Return the local linear approximation to Wcs::pixelToSky at a point given in pixel coordinates. More...
 
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. More...
 
geom::AffineTransform linearizeSkyToPixel (geom::Point2D const &pix, geom::AngleUnit skyUnit=geom::degrees) const
 Return the local linear approximation to Wcs::skyToPixel at a point given in pixel coordinates. More...
 
virtual void shiftReferencePixel (geom::Extent2D const &d)
 
void serialize (Archive &, unsigned int const)
 
std::string repr () const
 
void markPersistent (void)
 
memId getId () const
 
void writeFits (std::string const &fileName, std::string const &mode="w") const
 Write the object to a regular FITS file. More...
 
void writeFits (fits::MemFileManager &manager, std::string const &mode="w") const
 Write the object to a FITS image in memory. More...
 
void writeFits (fits::Fits &fitsfile) const
 Write the object to an already-open FITS object. More...
 

Static Public Member Functions

static void decodeSipHeader (daf::base::PropertySet const &fitsMetadata, std::string const &which, Eigen::MatrixXd &m)
 Decode the SIP headers for a given matrix, if present. More...
 
static std::shared_ptr< TanWcs > readFits (fits::Fits &fitsfile)
 Read an object from an already open FITS object. More...
 
static std::shared_ptr< TanWcs > readFits (std::string const &fileName, int hdu=INT_MIN)
 Read an object from a regular FITS file. More...
 
static std::shared_ptr< TanWcs > readFits (fits::MemFileManager &manager, int hdu=INT_MIN)
 Read an object from a FITS file in memory. More...
 
static std::shared_ptr< Wcs > readFits (fits::Fits &fitsfile)
 Read an object from an already open FITS object. More...
 
static std::shared_ptr< Wcs > readFits (std::string const &fileName, int hdu=INT_MIN)
 Read an object from a regular FITS file. More...
 
static std::shared_ptr< Wcs > readFits (fits::MemFileManager &manager, int hdu=INT_MIN)
 Read an object from a FITS file in memory. More...
 
static bool hasBeenCorrupted ()
 
static memId getNextMemId ()
 
static int init ()
 
static int census (int, memId startingMemId=0)
 
static void census (std::ostream &stream, memId startingMemId=0)
 
static const std::vector< const Citizen *> * census ()
 
static int census (int, memId startingMemId=0)
 
static void census (std::ostream &stream, memId startingMemId=0)
 
static const std::vector< const Citizen *> * census ()
 
static memId setNewCallbackId (memId id)
 
static memId setNewCallbackId (memId id)
 
static memId setDeleteCallbackId (memId id)
 
static memId setDeleteCallbackId (memId id)
 
static memNewCallback setNewCallback (memNewCallback func)
 
static memCallback setDeleteCallback (memCallback func)
 
static memCallback setCorruptionCallback (memCallback func)
 

Public Attributes

 magicSentinel
 

Protected Types

typedef io::OutputArchiveHandle OutputArchiveHandle
 

Protected Member Functions

virtual void pixelToSkyImpl (double pixel1, double pixel2, geom::Angle skyTmp[2]) const
 Worker routine for skyToPixel. More...
 
virtual geom::Point2D skyToPixelImpl (geom::Angle sky1, geom::Angle sky2) const
 Worker routine for pixelToSky. More...
 
bool _mayBePersistable () const
 Perform basic checks on whether *this might be persistable. More...
 
virtual std::string getPythonModule () const
 Return the fully-qualified Python module that should be imported to guarantee that its factory is registered. More...
 
bool _isIcrs () const
 
std::shared_ptr< afw::coord::Coord > 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 Coord. More...
 
std::shared_ptr< afw::coord::Coord > convertCoordToSky (coord::Coord const &coord) const
 Given a Coord (as a shared pointer), return the sky position in the correct coordinate system for this Wcs. More...
 
virtual geom::AffineTransform linearizePixelToSkyInternal (geom::Point2D const &pix, coord::Coord const &coord, geom::AngleUnit skyUnit) const
 Implementation for the overloaded public linearizePixelToSky methods, requiring both a pixel coordinate and the corresponding sky coordinate. More...
 
virtual geom::AffineTransform linearizeSkyToPixelInternal (geom::Point2D const &pix, coord::Coord const &coord, geom::AngleUnit skyUnit) const
 Implementation for the overloaded public linearizeSkyToPixel methods, requiring both a pixel coordinate and the corresponding sky coordinate. More...
 
void initWcsLibFromFits (std::shared_ptr< lsst::daf::base::PropertySet const > const &fitsMetadata)
 Parse a fits header, extract the relevant metadata and create a Wcs object. More...
 
void _initWcs ()
 Set some internal variables that we need to refer to. More...
 
void _setWcslibParams ()
 

Protected Attributes

struct wcsprm * _wcsInfo
 
int _nWcsInfo
 
int _relax
 Degree of permissiveness for wcspih (0 for strict); see wcshdr.h for details. More...
 
int _wcsfixCtrl
 Do potentially unsafe translations of non-standard unit strings? 0/1 = no/yes. More...
 
int _wcshdrCtrl
 Controls messages to stderr from wcshdr (0 for none); see wcshdr.h for details. More...
 
int _nReject
 
coord::CoordSystem _coordSystem
 
bool _skyAxesSwapped
 if true then the sky axes are swapped More...
 

Detailed Description

Combination of a TAN WCS and a distortion model.

This object represents a common case for raw or minimally processed data; we have estimates for:

Warning
This is not a full-fledged WCS class in several respects:
  • It has no standard FITS WCS representation.
  • It does not support persistence or unpersistence from FITS. The usual use case is to represent the WCS for an exposure that has a plain TAN WCS and a distortion model in its detector; As such, the data is present in two disparate places, making persistence difficult.
  • It cannot be flipped or rotated. This is probably fixable, but does not seem worth the work.

Definition at line 49 of file DistortedTanWcs.h.

Member Typedef Documentation

◆ OutputArchiveHandle

typedef io::OutputArchiveHandle lsst::afw::table::io::Persistable::OutputArchiveHandle
protectedinherited

Definition at line 107 of file Persistable.h.

◆ Transform

Definition at line 51 of file DistortedTanWcs.h.

Constructor & Destructor Documentation

◆ DistortedTanWcs()

lsst::afw::image::DistortedTanWcs::DistortedTanWcs ( TanWcs const &  tanWcs,
Transform const &  pixelsToTanPixels 
)

Construct a DistortedTanWcs.

Parameters
[in]tanWcspure tangent-plane WCS
[in]pixelsToTanPixelsa Transform that converts from PIXELS to TAN_PIXELS coordinates in the forward direction. This can be obtained from an exposure using: detector = exposure.getDetector() pixelsToTanPixels = detector.getTransformMap()[lsst.afw.cameraGeom.TAN_PIXELS]
Exceptions
pex::exceptions::InvalidParameterErrorif tanWcs.hasDistortion()

Definition at line 31 of file DistortedTanWcs.cc.

◆ ~DistortedTanWcs()

virtual lsst::afw::image::DistortedTanWcs::~DistortedTanWcs ( )
inlinevirtual

Definition at line 66 of file DistortedTanWcs.h.

Member Function Documentation

◆ _initWcs()

void lsst::afw::image::Wcs::_initWcs ( )
protectedinherited

Set some internal variables that we need to refer to.

Definition at line 114 of file Wcs.cc.

◆ _isIcrs()

bool lsst::afw::image::Wcs::_isIcrs ( ) const
inlineprotectedinherited

Definition at line 371 of file Wcs.h.

◆ _mayBePersistable()

bool lsst::afw::image::Wcs::_mayBePersistable ( ) const
protectedinherited

Perform basic checks on whether *this might be persistable.

Definition at line 998 of file Wcs.cc.

◆ _setWcslibParams()

void lsst::afw::image::Wcs::_setWcslibParams ( )
protectedinherited

Definition at line 68 of file Wcs.cc.

◆ clone()

std::shared_ptr< Wcs > lsst::afw::image::DistortedTanWcs::clone ( void  ) const
virtual

Polymorphic deep-copy.

Reimplemented from lsst::afw::image::Wcs.

Definition at line 38 of file DistortedTanWcs.cc.

◆ convertCoordToSky()

std::shared_ptr< coord::Coord > lsst::afw::image::Wcs::convertCoordToSky ( coord::Coord const &  coord) const
protectedinherited

Given a Coord (as a shared pointer), return the sky position in the correct coordinate system for this Wcs.

Definition at line 736 of file Wcs.cc.

◆ decodeSipHeader()

static void lsst::afw::image::TanWcs::decodeSipHeader ( daf::base::PropertySet const &  fitsMetadata,
std::string const &  which,
Eigen::MatrixXd &  m 
)
staticinherited

Decode the SIP headers for a given matrix, if present.

◆ distortPixel()

geom::Point2D lsst::afw::image::TanWcs::distortPixel ( geom::Point2D const &  pixel) const
inherited

Applies the SIP AP and BP distortion (used in the skyToPixel direction)

◆ flipImage()

void lsst::afw::image::DistortedTanWcs::flipImage ( int  flipLR,
int  flipTB,
lsst::afw::geom::Extent2I  dimensions 
) const
virtual
Warning
not implemented

Reimplemented from lsst::afw::image::Wcs.

Definition at line 46 of file DistortedTanWcs.cc.

◆ getCDMatrix()

Eigen::Matrix2d lsst::afw::image::Wcs::getCDMatrix ( ) const
inherited

Returns the CD matrix.

Definition at line 545 of file Wcs.cc.

◆ getCoordSystem()

afw::coord::CoordSystem lsst::afw::image::Wcs::getCoordSystem ( ) const
inlineinherited

Definition at line 229 of file Wcs.h.

◆ getEquinox()

double lsst::afw::image::Wcs::getEquinox ( ) const
inherited

Definition at line 784 of file Wcs.cc.

◆ getFitsMetadata()

std::shared_ptr<daf::base::PropertyList> lsst::afw::image::TanWcs::getFitsMetadata ( ) const
overridevirtualinherited

Return a PropertyList containing FITS header keywords that can be used to save the Wcs.x.

Reimplemented from lsst::afw::image::Wcs.

◆ getLinearTransform()

geom::LinearTransform lsst::afw::image::Wcs::getLinearTransform ( ) const
inherited

Return the linear part of the Wcs, the CD matrix in FITS-speak, as an AffineTransform.

Definition at line 911 of file Wcs.cc.

◆ getPixelOrigin()

GeomPoint lsst::afw::image::Wcs::getPixelOrigin ( ) const
inherited

Returns CRPIX (corrected to LSST convention).

Definition at line 537 of file Wcs.cc.

◆ getPixelToTanPixel()

std::shared_ptr<Transform> lsst::afw::image::DistortedTanWcs::getPixelToTanPixel ( ) const
inline

return the PIXELS to TAN_PIXELS Transform

Definition at line 91 of file DistortedTanWcs.h.

◆ getPythonModule()

std::string lsst::afw::image::Wcs::getPythonModule ( ) const
protectedvirtualinherited

Return the fully-qualified Python module that should be imported to guarantee that its factory is registered.

Must be less than ArchiveIndexSchema::MAX_MODULE_LENGTH characters.

Will be ignored if empty.

Reimplemented from lsst::afw::table::io::Persistable.

Definition at line 977 of file Wcs.cc.

◆ getSipA()

Eigen::MatrixXd const& lsst::afw::image::TanWcs::getSipA ( ) const
inlineinherited

Return the SIP forward distortion matrix for the 1st intermediate world coordinate system axis.

Definition at line 149 of file TanWcs.h.

◆ getSipAp()

Eigen::MatrixXd const& lsst::afw::image::TanWcs::getSipAp ( ) const
inlineinherited

Return the SIP reverse distortion matrix for x pixel coordinates.

Definition at line 155 of file TanWcs.h.

◆ getSipB()

Eigen::MatrixXd const& lsst::afw::image::TanWcs::getSipB ( ) const
inlineinherited

Return the SIP forward distortion matrix for the 2st intermediate world coordinate system axis.

Definition at line 152 of file TanWcs.h.

◆ getSipBp()

Eigen::MatrixXd const& lsst::afw::image::TanWcs::getSipBp ( ) const
inlineinherited

Return the SIP reverse distortion matrix for y pixel coordinates.

Definition at line 158 of file TanWcs.h.

◆ getSkyOrigin()

CoordPtr lsst::afw::image::Wcs::getSkyOrigin ( ) const
inherited

Returns CRVAL. This need not be the centre of the image.

Definition at line 532 of file Wcs.cc.

◆ getTanWcs()

std::shared_ptr<Wcs> lsst::afw::image::DistortedTanWcs::getTanWcs ( ) const
inline

return the pure tan WCS component

Definition at line 88 of file DistortedTanWcs.h.

◆ hasDistortion()

bool lsst::afw::image::DistortedTanWcs::hasDistortion ( ) const
inlinevirtual

Reimplemented from lsst::afw::image::Wcs.

Definition at line 85 of file DistortedTanWcs.h.

◆ initWcsLibFromFits()

void lsst::afw::image::Wcs::initWcsLibFromFits ( std::shared_ptr< lsst::daf::base::PropertySet const > const &  fitsMetadata)
protectedinherited

Parse a fits header, extract the relevant metadata and create a Wcs object.

Definition at line 160 of file Wcs.cc.

◆ isFlipped()

bool lsst::afw::image::Wcs::isFlipped ( ) const
inherited

Does the Wcs follow the convention of North=Up, East=Left?

The conventional sense for a WCS image is to have North up and East to the left, or at least to be able to rotate the image to that orientation. It is possible to create a "flipped" WCS, where East points right when the image is rotated such that North is up. Flipping a WCS is akin to producing a mirror image. This function tests whether the image is flipped or not.

Definition at line 643 of file Wcs.cc.

◆ isPersistable()

bool lsst::afw::image::DistortedTanWcs::isPersistable ( ) const
inlinevirtual

Whether the Wcs is persistable using afw::table::io archives.

Reimplemented from lsst::afw::image::Wcs.

Definition at line 83 of file DistortedTanWcs.h.

◆ isSameSkySystem()

bool lsst::afw::image::Wcs::isSameSkySystem ( Wcs const &  wcs) const
inherited

Return true if a WCS has the same coordinate system and equinox as this one.

There are two special cases:

  • Equinox is ignored if the coordinate system is ICRS
  • FK5 J2000 is considered the same as ICRS

Definition at line 791 of file Wcs.cc.

◆ linearizePixelToSky() [1/2]

geom::AffineTransform lsst::afw::image::Wcs::linearizePixelToSky ( coord::Coord const &  coord,
geom::AngleUnit  skyUnit = geom::degrees 
) const
inherited

Return the local linear approximation to Wcs::pixelToSky at a point given in sky coordinates.

The local linear approximation is defined such the following is true (ignoring floating-point errors):

wcs.linearizePixelToSky(sky, skyUnit)(wcs.skyToPixel(sky)) == sky.getPosition(skyUnit);

(recall that AffineTransform::operator() is matrix multiplication with the augmented point (x,y,1)).

This is currently implemented as a numerical derivative, but we should specialise the Wcs class (or rather its implementation) to handle "simple" cases such as TAN-SIP analytically

Parameters
[in]coordPosition in sky coordinates where transform is desired.
[in]skyUnitUnits to use for sky coordinates; units of matrix elements will be skyUnits/pixel.

Definition at line 863 of file Wcs.cc.

◆ linearizePixelToSky() [2/2]

geom::AffineTransform lsst::afw::image::Wcs::linearizePixelToSky ( geom::Point2D const &  pix,
geom::AngleUnit  skyUnit = geom::degrees 
) const
inherited

Return the local linear approximation to Wcs::pixelToSky at a point given in pixel coordinates.

The local linear approximation is defined such the following is true (ignoring floating-point errors):

wcs.linearizePixelToSky(pix, skyUnit)(pix) == wcs.pixelToSky(pix).getPosition(skyUnit)

(recall that AffineTransform::operator() is matrix multiplication with the augmented point (x,y,1)).

This is currently implemented as a numerical derivative, but we should specialise the Wcs class (or rather its implementation) to handle "simple" cases such as TAN-SIP analytically

Parameters
[in]pixPosition in pixel coordinates where transform is desired.
[in]skyUnitUnits to use for sky coordinates; units of matrix elements will be skyUnits/pixel.

Definition at line 866 of file Wcs.cc.

◆ linearizePixelToSkyInternal()

geom::AffineTransform lsst::afw::image::Wcs::linearizePixelToSkyInternal ( geom::Point2D const &  pix,
coord::Coord const &  coord,
geom::AngleUnit  skyUnit 
) const
protectedvirtualinherited

Implementation for the overloaded public linearizePixelToSky methods, requiring both a pixel coordinate and the corresponding sky coordinate.

Definition at line 870 of file Wcs.cc.

◆ linearizeSkyToPixel() [1/2]

geom::AffineTransform lsst::afw::image::Wcs::linearizeSkyToPixel ( coord::Coord const &  coord,
geom::AngleUnit  skyUnit = geom::degrees 
) const
inherited

Return the local linear approximation to Wcs::skyToPixel at a point given in sky coordinates.

The local linear approximation is defined such the following is true (ignoring floating-point errors):

wcs.linearizeSkyToPixel(sky, skyUnit)(sky.getPosition(skyUnit)) == wcs.skyToPixel(sky)

(recall that AffineTransform::operator() is matrix multiplication with the augmented point (x,y,1)).

This is currently implemented as a numerical derivative, but we should specialise the Wcs class (or rather its implementation) to handle "simple" cases such as TAN-SIP analytically

Parameters
[in]coordPosition in sky coordinates where transform is desired.
[in]skyUnitUnits to use for sky coordinates; units of matrix elements will be pixels/skyUnit.

Definition at line 897 of file Wcs.cc.

◆ linearizeSkyToPixel() [2/2]

geom::AffineTransform lsst::afw::image::Wcs::linearizeSkyToPixel ( geom::Point2D const &  pix,
geom::AngleUnit  skyUnit = geom::degrees 
) const
inherited

Return the local linear approximation to Wcs::skyToPixel at a point given in pixel coordinates.

The local linear approximation is defined such the following is true (ignoring floating-point errors):

wcs.linearizeSkyToPixel(pix, skyUnit)(wcs.pixelToSky(pix).getPosition(skyUnit)) == pix

(recall that AffineTransform::operator() is matrix multiplication with the augmented point (x,y,1)).

This is currently implemented as a numerical derivative, but we should specialise the Wcs class (or rather its implementation) to handle "simple" cases such as TAN-SIP analytically

Parameters
[in]pixPosition in pixel coordinates where transform is desired.
[in]skyUnitUnits to use for sky coordinates; units of matrix elements will be pixels/skyUnit.

Definition at line 901 of file Wcs.cc.

◆ linearizeSkyToPixelInternal()

geom::AffineTransform lsst::afw::image::Wcs::linearizeSkyToPixelInternal ( geom::Point2D const &  pix,
coord::Coord const &  coord,
geom::AngleUnit  skyUnit 
) const
protectedvirtualinherited

Implementation for the overloaded public linearizeSkyToPixel methods, requiring both a pixel coordinate and the corresponding sky coordinate.

Definition at line 905 of file Wcs.cc.

◆ makeCorrectCoord()

CoordPtr lsst::afw::image::Wcs::makeCorrectCoord ( geom::Angle  sky0,
geom::Angle  sky1 
) const
protectedinherited

Given a sky position, use the values stored in ctype and radesys to return the correct sub-class of Coord.

Definition at line 841 of file Wcs.cc.

◆ operator!=()

bool lsst::afw::image::Wcs::operator!= ( Wcs const &  other) const
inlineinherited

Definition at line 141 of file Wcs.h.

◆ operator==()

bool lsst::afw::image::DistortedTanWcs::operator== ( Wcs const &  other) const
Warning
not implemented (because Transform operator== is not implemented)

Definition at line 42 of file DistortedTanWcs.cc.

◆ pixArea()

double lsst::afw::image::Wcs::pixArea ( lsst::afw::geom::Point2D  pix00) const
inherited

Sky area covered by a pixel at position pix00 in units of square degrees.

Parameters
pix00The pixel point where the area is desired

Definition at line 661 of file Wcs.cc.

◆ pixelScale()

geom::Angle lsst::afw::image::TanWcs::pixelScale ( ) const
inherited

Returns the pixel scale, in Angle/pixel.

◆ pixelToSky() [1/3]

CoordPtr lsst::afw::image::Wcs::pixelToSky ( double  pix1,
double  pix2 
) const
inherited

Convert from pixel position to sky coordinates (e.g.

RA/dec)

Convert a pixel position (e.g. x,y) to a celestial coordinate (e.g. RA/dec). The output coordinate system depends on the values of CTYPE used to construct the object. For RA/dec, the CTYPES should be RA—TAN and DEC–TAN.

Definition at line 822 of file Wcs.cc.

◆ pixelToSky() [2/3]

CoordPtr lsst::afw::image::Wcs::pixelToSky ( lsst::afw::geom::Point2D const &  pixel) const
inherited

Convert from pixel position to sky coordinates (e.g.

RA/dec)

Convert a pixel position (e.g. x,y) to a celestial coordinate (e.g. RA/dec). The output coordinate system depends on the values of CTYPE used to construct the object. For RA/dec, the CTYPES should be RA—TAN and DEC–TAN.

Definition at line 820 of file Wcs.cc.

◆ pixelToSky() [3/3]

void lsst::afw::image::Wcs::pixelToSky ( double  pixel1,
double  pixel2,
geom::Angle &  sky1,
geom::Angle &  sky2 
) const
inherited

Convert from pixel position to sky coordinates (e.g.

RA/dec)

Note
This routine is designed for the knowledgeable user in need of performance; it's safer to call the version that returns a std::shared_ptr<Coord>.

Definition at line 830 of file Wcs.cc.

◆ pixelToSkyImpl()

void lsst::afw::image::DistortedTanWcs::pixelToSkyImpl ( double  pixel1,
double  pixel2,
geom::Angle  skyTmp[2] 
) const
protectedvirtual

Worker routine for skyToPixel.

Parameters
[in]pixel1pixel position, x
[in]pixel2pixel position, y
[in]skyTmpsky position, longitude, latitude (e.g. RA, Dec)

Reimplemented from lsst::afw::image::Wcs.

Definition at line 63 of file DistortedTanWcs.cc.

◆ readFits() [1/6]

static std::shared_ptr<TanWcs > lsst::afw::table::io::PersistableFacade< TanWcs >::readFits ( fits::Fits &  fitsfile)
inlinestaticinherited

Read an object from an already open FITS object.

Parameters
[in]fitsfileFITS object to read from, already positioned at the desired HDU.

Definition at line 180 of file Persistable.h.

◆ readFits() [2/6]

static std::shared_ptr<Wcs > lsst::afw::table::io::PersistableFacade< Wcs >::readFits ( fits::Fits &  fitsfile)
inlinestaticinherited

Read an object from an already open FITS object.

Parameters
[in]fitsfileFITS object to read from, already positioned at the desired HDU.

Definition at line 180 of file Persistable.h.

◆ readFits() [3/6]

static std::shared_ptr<Wcs > lsst::afw::table::io::PersistableFacade< Wcs >::readFits ( std::string const &  fileName,
int  hdu = INT_MIN 
)
inlinestaticinherited

Read an object from a regular FITS file.

Parameters
[in]fileNameName of the file to read.
[in]hduHDU to read, where 0 is the primary. The special value of INT_MIN skips the primary HDU if it is empty.

Definition at line 191 of file Persistable.h.

◆ readFits() [4/6]

static std::shared_ptr<TanWcs > lsst::afw::table::io::PersistableFacade< TanWcs >::readFits ( std::string const &  fileName,
int  hdu = INT_MIN 
)
inlinestaticinherited

Read an object from a regular FITS file.

Parameters
[in]fileNameName of the file to read.
[in]hduHDU to read, where 0 is the primary. The special value of INT_MIN skips the primary HDU if it is empty.

Definition at line 191 of file Persistable.h.

◆ readFits() [5/6]

static std::shared_ptr<Wcs > lsst::afw::table::io::PersistableFacade< Wcs >::readFits ( fits::MemFileManager &  manager,
int  hdu = INT_MIN 
)
inlinestaticinherited

Read an object from a FITS file in memory.

Parameters
[in]managerManager for the memory to read from.
[in]hduHDU to read, where 0 is the primary. The special value of INT_MIN skips the primary HDU if it is empty.

Definition at line 202 of file Persistable.h.

◆ readFits() [6/6]

static std::shared_ptr<TanWcs > lsst::afw::table::io::PersistableFacade< TanWcs >::readFits ( fits::MemFileManager &  manager,
int  hdu = INT_MIN 
)
inlinestaticinherited

Read an object from a FITS file in memory.

Parameters
[in]managerManager for the memory to read from.
[in]hduHDU to read, where 0 is the primary. The special value of INT_MIN skips the primary HDU if it is empty.

Definition at line 202 of file Persistable.h.

◆ rotateImageBy90()

void lsst::afw::image::DistortedTanWcs::rotateImageBy90 ( int  nQuarter,
lsst::afw::geom::Extent2I  dimensions 
) const
virtual
Warning
not implemented

Reimplemented from lsst::afw::image::Wcs.

Definition at line 50 of file DistortedTanWcs.cc.

◆ setDistortionMatrices()

void lsst::afw::image::TanWcs::setDistortionMatrices ( Eigen::MatrixXd const &  sipA,
Eigen::MatrixXd const &  sipB,
Eigen::MatrixXd const &  sipAp,
Eigen::MatrixXd const &  sipBp 
)
inherited

Set the distortion matrices.

Parameters
sipAForward distortion matrix for 1st axis
sipBForward distortion matrix for 2nd axis
sipApReverse distortion matrix for 1st axis
sipBpReverse distortion matrix for 2nd axis

Because the base class provides the option of creating a Wcs without distortion coefficients we supply a way of setting them here. This also help make code neater by breaking an enormous constructor (above) into two small pieces.

◆ shiftReferencePixel() [1/2]

void lsst::afw::image::DistortedTanWcs::shiftReferencePixel ( double  dx,
double  dy 
)
virtual
Warning
not implemented

Reimplemented from lsst::afw::image::Wcs.

Definition at line 54 of file DistortedTanWcs.cc.

◆ shiftReferencePixel() [2/2]

virtual void lsst::afw::image::Wcs::shiftReferencePixel ( geom::Extent2D const &  d)
inlinevirtualinherited

Definition at line 333 of file Wcs.h.

◆ skyToIntermediateWorldCoord()

GeomPoint lsst::afw::image::Wcs::skyToIntermediateWorldCoord ( coord::Coord const &  coord) const
inherited

Convert from sky coordinates (e.g.

RA/dec) to intermediate world coordinates

Intermediate world coordinates are in DEGREES.

Definition at line 742 of file Wcs.cc.

◆ skyToPixel() [1/2]

GeomPoint lsst::afw::image::Wcs::skyToPixel ( geom::Angle  sky1,
geom::Angle  sky2 
) const
inherited

Convert from sky coordinates (e.g.

RA/dec) to pixel positions

Convert a sky position (e.g. RA/dec) to a pixel position. The exact meaning of sky1, sky2 and the return value depend on the properties of the wcs (i.e. the values of CTYPE1 and CTYPE2), but the inputs are usually RA/dec. The outputs are x and y pixel position.

ASSUMES the angles are in the appropriate coordinate system for this Wcs.

Definition at line 740 of file Wcs.cc.

◆ skyToPixel() [2/2]

GeomPoint lsst::afw::image::Wcs::skyToPixel ( coord::Coord const &  coord) const
inherited

Convert from sky coordinates (e.g. RA/dec) to pixel positions.

Definition at line 731 of file Wcs.cc.

◆ skyToPixelImpl()

geom::Point2D lsst::afw::image::DistortedTanWcs::skyToPixelImpl ( geom::Angle  sky1,
geom::Angle  sky2 
) const
protectedvirtual

Worker routine for pixelToSky.

Parameters
[out]sky1sky position, longitude (e.g. RA)
[out]sky2sky position, latitude (e.g. Dec)

Reimplemented from lsst::afw::image::Wcs.

Definition at line 58 of file DistortedTanWcs.cc.

◆ undistortPixel()

geom::Point2D lsst::afw::image::TanWcs::undistortPixel ( geom::Point2D const &  pixel) const
inherited

Applies the SIP A and B un-distortion (used in the pixelToSky direction)

◆ writeFits() [1/3]

void lsst::afw::table::io::Persistable::writeFits ( std::string const &  fileName,
std::string const &  mode = "w" 
) const
inherited

Write the object to a regular FITS file.

Parameters
[in]fileNameName of the file to write to.
[in]modeIf "w", any existing file with the given name will be overwritten. If "a", new HDUs will be appended to an existing file.

◆ writeFits() [2/3]

void lsst::afw::table::io::Persistable::writeFits ( fits::MemFileManager &  manager,
std::string const &  mode = "w" 
) const
inherited

Write the object to a FITS image in memory.

Parameters
[in]managerName of the file to write to.
[in]modeIf "w", any existing file with the given name will be overwritten. If "a", new HDUs will be appended to an existing file.

◆ writeFits() [3/3]

void lsst::afw::table::io::Persistable::writeFits ( fits::Fits &  fitsfile) const
inherited

Write the object to an already-open FITS object.

Parameters
[in]fitsfileOpen FITS object to write to.

Member Data Documentation

◆ _coordSystem

coord::CoordSystem lsst::afw::image::Wcs::_coordSystem
protectedinherited

Definition at line 450 of file Wcs.h.

◆ _nReject

int lsst::afw::image::Wcs::_nReject
protectedinherited

Definition at line 449 of file Wcs.h.

◆ _nWcsInfo

int lsst::afw::image::Wcs::_nWcsInfo
protectedinherited

Definition at line 445 of file Wcs.h.

◆ _relax

int lsst::afw::image::Wcs::_relax
protectedinherited

Degree of permissiveness for wcspih (0 for strict); see wcshdr.h for details.

Definition at line 446 of file Wcs.h.

◆ _skyAxesSwapped

bool lsst::afw::image::Wcs::_skyAxesSwapped
protectedinherited

if true then the sky axes are swapped

Definition at line 451 of file Wcs.h.

◆ _wcsfixCtrl

int lsst::afw::image::Wcs::_wcsfixCtrl
protectedinherited

Do potentially unsafe translations of non-standard unit strings? 0/1 = no/yes.

Definition at line 447 of file Wcs.h.

◆ _wcshdrCtrl

int lsst::afw::image::Wcs::_wcshdrCtrl
protectedinherited

Controls messages to stderr from wcshdr (0 for none); see wcshdr.h for details.

Definition at line 448 of file Wcs.h.

◆ _wcsInfo

struct wcsprm* lsst::afw::image::Wcs::_wcsInfo
protectedinherited

Definition at line 444 of file Wcs.h.


The documentation for this class was generated from the following files: