LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
Public Member Functions | Protected Member Functions | Private 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 Member Functions

 DistortedTanWcs (TanWcs const &tanWcs, geom::XYTransform const &pixelsToTanPixels)
 Construct a DistortedTanWcs. More...
 
virtual ~DistortedTanWcs ()
 
virtual boost::shared_ptr< Wcsclone () 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 object is persistable using afw::table::io archives. More...
 
bool hasDistortion () const
 
boost::shared_ptr< WcsgetTanWcs () const
 return the pure tan WCS component More...
 
boost::shared_ptr
< geom::XYTransform
getPixelToTanPixel () const
 return the PIXELS to TAN_PIXELS XYTransform More...
 
- Public Member Functions inherited from lsst::afw::image::TanWcs
 TanWcs (geom::Point2D const &crval, geom::Point2D const &crpix, Eigen::Matrix2d const &cd, double equinox=2000, std::string const &raDecSys="FK5", std::string const &cunits1="deg", std::string const &cunits2="deg")
 Construct a tangent plane wcs without distortion terms. More...
 
 TanWcs (geom::Point2D const &crval, geom::Point2D const &crpix, Eigen::Matrix2d const &cd, Eigen::MatrixXd const &sipA, Eigen::MatrixXd const &sipB, Eigen::MatrixXd const &sipAp, Eigen::MatrixXd const &sipBp, double equinox=2000, std::string const &raDecSys="FK5", std::string const &cunits1="deg", std::string const &cunits2="deg")
 Construct a tangent plane wcs with distortion terms. More...
 
virtual ~TanWcs ()
 
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...
 
bool hasDistortion () const
 
boost::shared_ptr
< daf::base::PropertyList
getFitsMetadata () const
 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...
 
- Public Member Functions inherited from lsst::afw::image::Wcs
 Wcs (lsst::afw::geom::Point2D const &crval, lsst::afw::geom::Point2D const &crpix, Eigen::Matrix2d const &CD, std::string const &ctype1="RA---TAN", std::string const &ctype2="DEC--TAN", double equinox=2000, std::string const &raDecSys="ICRS", std::string const &cunits1="deg", std::string const &cunits2="deg")
 Create a Wcs object with some known information. More...
 
virtual ~Wcs ()
 
bool operator== (Wcs const &other) const
 
bool operator!= (Wcs const &other) const
 
lsst::afw::coord::Coord::Ptr 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
 
double pixArea (lsst::afw::geom::Point2D pix00) const
 Sky area covered by a pixel at position pix00 in units of square degrees. More...
 
geom::Angle pixelScale () const
 Returns the pixel scale [Angle/pixel]. More...
 
boost::shared_ptr< coord::CoordpixelToSky (double pix1, double pix2) const
 Convert from pixel position to sky coordinates (e.g. RA/dec) More...
 
boost::shared_ptr< coord::CoordpixelToSky (lsst::afw::geom::Point2D const &pixel) const
 Convert from pixel position to sky coordinates (e.g. RA/dec) More...
 
void pixelToSky (double pixel1, double pixel2, geom::Angle &sky1, geom::Angle &sky2) const
 
geom::Point2D skyToPixel (geom::Angle sky1, geom::Angle sky2) const
 Convert from sky coordinates (e.g. RA/dec) to pixel positions. 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. RA/dec) to intermediate world coordinates. More...
 
geom::LinearTransform getLinearTransform () const
 
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)
 
- Public Member Functions inherited from lsst::daf::base::Persistable
 Persistable (void)
 
virtual ~Persistable (void)
 
template<class Archive >
void serialize (Archive &, unsigned int const)
 
- Public Member Functions inherited from lsst::daf::base::Citizen
 Citizen (const std::type_info &)
 
 Citizen (Citizen const &)
 
 ~Citizen ()
 
Citizenoperator= (Citizen const &)
 
std::string repr () const
 Return a string representation of a Citizen. More...
 
void markPersistent (void)
 Mark a Citizen as persistent and not destroyed until process end. More...
 
memId getId () const
 Return the Citizen's ID. More...
 
- Public Member Functions inherited from lsst::afw::table::io::Persistable
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...
 
virtual ~Persistable ()
 

Protected Member Functions

virtual void pixelToSkyImpl (double pixel1, double pixel2, geom::Angle skyTmp[2]) const
 
virtual geom::Point2D skyToPixelImpl (geom::Angle sky1, geom::Angle sky2) const
 
- Protected Member Functions inherited from lsst::afw::image::TanWcs
 TanWcs (TanWcs const &rhs)
 
- Protected Member Functions inherited from lsst::afw::image::Wcs
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...
 
 Wcs ()
 Construct an invalid Wcs given no arguments. More...
 
 Wcs (boost::shared_ptr< lsst::daf::base::PropertySet const > const &fitsMetadata)
 
 Wcs (afw::table::BaseRecord const &record)
 
 Wcs (Wcs const &rhs)
 Copy constructor. More...
 
Wcsoperator= (const Wcs &)
 
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 Coord. More...
 
afw::coord::Coord::Ptr convertCoordToSky (coord::Coord const &coord) const
 
virtual geom::AffineTransform linearizePixelToSkyInternal (geom::Point2D const &pix, coord::Coord const &coord, geom::AngleUnit skyUnit) const
 
virtual geom::AffineTransform linearizeSkyToPixelInternal (geom::Point2D const &pix, coord::Coord const &coord, geom::AngleUnit skyUnit) const
 
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. More...
 
void _initWcs ()
 
void _setWcslibParams ()
 
- Protected Member Functions inherited from lsst::afw::table::io::Persistable
 Persistable ()
 
 Persistable (Persistable const &other)
 
void operator= (Persistable const &other)
 

Private Attributes

boost::shared_ptr
< geom::XYTransform
_pixelsToTanPixelsPtr
 

Additional Inherited Members

- Public Types inherited from lsst::afw::image::TanWcs
typedef boost::shared_ptr
< lsst::afw::image::TanWcs
Ptr
 
typedef boost::shared_ptr
< lsst::afw::image::TanWcs
const > 
ConstPtr
 
- Public Types inherited from lsst::afw::image::Wcs
typedef boost::shared_ptr< WcsPtr
 
typedef boost::shared_ptr< Wcs
const > 
ConstPtr
 
- Public Types inherited from lsst::daf::base::Persistable
typedef boost::shared_ptr
< Persistable
Ptr
 
- Public Types inherited from lsst::daf::base::Citizen
enum  { magicSentinel = 0xdeadbeef }
 
typedef unsigned long memId
 Type of the block's ID. More...
 
typedef memId(* memNewCallback )(const memId cid)
 A function used to register a callback. More...
 
typedef memId(* memCallback )(const Citizen *ptr)
 
- Static Public Member Functions inherited from lsst::afw::image::TanWcs
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 Public Member Functions inherited from lsst::afw::table::io::PersistableFacade< TanWcs >
static boost::shared_ptr< TanWcs > readFits (fits::Fits &fitsfile)
 Read an object from an already open FITS object. More...
 
static boost::shared_ptr< TanWcs > readFits (std::string const &fileName, int hdu=0)
 Read an object from a regular FITS file. More...
 
static boost::shared_ptr< TanWcs > readFits (fits::MemFileManager &manager, int hdu=0)
 Read an object from a FITS file in memory. More...
 
- Static Public Member Functions inherited from lsst::daf::base::Citizen
static bool hasBeenCorrupted ()
 Check all allocated blocks for corruption. More...
 
static memId getNextMemId ()
 Return the memId of the next object to be allocated. More...
 
static int init ()
 Called once when the memory system is being initialised. More...
 
static int census (int, memId startingMemId=0)
 How many active Citizens are there? More...
 
static void census (std::ostream &stream, memId startingMemId=0)
 Print a list of all active Citizens to stream, sorted by ID. More...
 
static const std::vector
< const Citizen * > * 
census ()
 Return a (newly allocated) std::vector of active Citizens sorted by ID. More...
 
static memId setNewCallbackId (memId id)
 Call the NewCallback when block is allocated. More...
 
static memId setDeleteCallbackId (memId id)
 Call the current DeleteCallback when block is deleted. More...
 
static memNewCallback setNewCallback (memNewCallback func)
 Set the NewCallback function. More...
 
static memCallback setDeleteCallback (memCallback func)
 Set the DeleteCallback function. More...
 
static memCallback setCorruptionCallback (memCallback func)
 Set the CorruptionCallback function. More...
 
- Static Public Member Functions inherited from lsst::afw::table::io::PersistableFacade< Wcs >
static boost::shared_ptr< WcsreadFits (fits::Fits &fitsfile)
 Read an object from an already open FITS object. More...
 
static boost::shared_ptr< WcsreadFits (std::string const &fileName, int hdu=0)
 Read an object from a regular FITS file. More...
 
static boost::shared_ptr< WcsreadFits (fits::MemFileManager &manager, int hdu=0)
 Read an object from a FITS file in memory. More...
 
- Protected Types inherited from lsst::afw::table::io::Persistable
typedef io::OutputArchiveHandle OutputArchiveHandle
 
- Protected Attributes inherited from lsst::afw::image::Wcs
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
 

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.

Constructor & Destructor Documentation

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

Construct a DistortedTanWcs.

Parameters
[in]tanWcspure tangent-plane WCS
[in]pixelsToTanPixelsan XYTransform 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.

34  :
35  TanWcs(tanWcs),
36  _pixelsToTanPixelsPtr(pixelsToTanPixels.clone())
37 {
38  if (tanWcs.hasDistortion()) {
39  throw LSST_EXCEPT(pex::exceptions::InvalidParameterError, "tanWcs has distortion terms");
40  }
41 }
boost::shared_ptr< geom::XYTransform > _pixelsToTanPixelsPtr
#define LSST_EXCEPT(type,...)
Definition: Exception.h:46
virtual lsst::afw::image::DistortedTanWcs::~DistortedTanWcs ( )
inlinevirtual

Definition at line 67 of file DistortedTanWcs.h.

67 {};

Member Function Documentation

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

Polymorphic deep-copy.

Reimplemented from lsst::afw::image::TanWcs.

Definition at line 43 of file DistortedTanWcs.cc.

43  {
44  return PTR(Wcs)(new DistortedTanWcs(*this));
45 }
#define PTR(...)
Definition: base.h:41
Implementation of the WCS standard for a any projection.
Definition: Wcs.h:107
DistortedTanWcs(TanWcs const &tanWcs, geom::XYTransform const &pixelsToTanPixels)
Construct a DistortedTanWcs.
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 51 of file DistortedTanWcs.cc.

51  {
52  throw LSST_EXCEPT(pex::exceptions::LogicError, "flipImage is not implemented");
53 }
#define LSST_EXCEPT(type,...)
Definition: Exception.h:46
boost::shared_ptr< geom::XYTransform > lsst::afw::image::DistortedTanWcs::getPixelToTanPixel ( ) const
inline

return the PIXELS to TAN_PIXELS XYTransform

Definition at line 92 of file DistortedTanWcs.h.

92 { return _pixelsToTanPixelsPtr->clone(); }
boost::shared_ptr< geom::XYTransform > _pixelsToTanPixelsPtr
boost::shared_ptr< Wcs > lsst::afw::image::DistortedTanWcs::getTanWcs ( ) const
inline

return the pure tan WCS component

Definition at line 89 of file DistortedTanWcs.h.

89 { return TanWcs::clone(); }
virtual boost::shared_ptr< Wcs > clone() const
Polymorphic deep-copy.
bool lsst::afw::image::DistortedTanWcs::hasDistortion ( ) const
inlinevirtual

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

Definition at line 86 of file DistortedTanWcs.h.

86 { return true; }
bool lsst::afw::image::DistortedTanWcs::isPersistable ( ) const
inlinevirtual

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

Reimplemented from lsst::afw::image::TanWcs.

Definition at line 84 of file DistortedTanWcs.h.

84 { return false; }
bool lsst::afw::image::DistortedTanWcs::operator== ( Wcs const &  other) const
Warning
not implemented (because XYTransform operator== is not implemented)

Definition at line 47 of file DistortedTanWcs.cc.

47  {
48  throw LSST_EXCEPT(pex::exceptions::LogicError, "== is not implemented");
49 }
#define LSST_EXCEPT(type,...)
Definition: Exception.h:46
void lsst::afw::image::DistortedTanWcs::pixelToSkyImpl ( double  pixel1,
double  pixel2,
geom::Angle  skyTmp[2] 
) const
protectedvirtual

Worker routine for skyToPixel

Parameters
[in]sky1sky position, longitude (e.g. RA)
[in]sky2sky position, latitude (e.g. dec)

Reimplemented from lsst::afw::image::TanWcs.

Definition at line 68 of file DistortedTanWcs.cc.

68  {
69  auto const pos = geom::Point2D(pixel1, pixel2);
70  auto const tanPos = _pixelsToTanPixelsPtr->forwardTransform(pos);
71  TanWcs::pixelToSkyImpl(tanPos[0], tanPos[1], sky);
72 }
Point< double, 2 > Point2D
Definition: Point.h:286
boost::shared_ptr< geom::XYTransform > _pixelsToTanPixelsPtr
virtual void pixelToSkyImpl(double pixel1, double pixel2, geom::Angle skyTmp[2]) const
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 55 of file DistortedTanWcs.cc.

55  {
56  throw LSST_EXCEPT(pex::exceptions::LogicError, "rotateImageBy90 is not implemented");
57 }
#define LSST_EXCEPT(type,...)
Definition: Exception.h:46
void lsst::afw::image::DistortedTanWcs::shiftReferencePixel ( double  dx,
double  dy 
)
virtual
Warning
not implemented

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

Definition at line 59 of file DistortedTanWcs.cc.

59  {
60  throw LSST_EXCEPT(pex::exceptions::LogicError, "shiftReferencePixel is not implemented");
61 }
#define LSST_EXCEPT(type,...)
Definition: Exception.h:46
geom::Point2D lsst::afw::image::DistortedTanWcs::skyToPixelImpl ( geom::Angle  sky1,
geom::Angle  sky2 
) const
protectedvirtual

Worker routine for pixelToSky

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

Reimplemented from lsst::afw::image::TanWcs.

Definition at line 63 of file DistortedTanWcs.cc.

63  {
64  auto const tanPos = TanWcs::skyToPixelImpl(sky1, sky2);
65  return _pixelsToTanPixelsPtr->reverseTransform(tanPos);
66 }
virtual geom::Point2D skyToPixelImpl(geom::Angle sky1, geom::Angle sky2) const
boost::shared_ptr< geom::XYTransform > _pixelsToTanPixelsPtr

Member Data Documentation

boost::shared_ptr< geom::XYTransform > lsst::afw::image::DistortedTanWcs::_pixelsToTanPixelsPtr
private

Definition at line 115 of file DistortedTanWcs.h.


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