GammaLib  2.1.0.dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GWcs Class Referenceabstract

Abstract world coordinate system base class. More...

#include <GWcs.hpp>

Inheritance diagram for GWcs:
GSkyProjection GBase GWcsAIT GWcsARC GWcsAZP GWcsCAR GWcsMER GWcsMOL GWcsSFL GWcsSIN GWcsSTG GWcsTAN

Public Member Functions

 GWcs (void)
 Void constructor. More...
 
 GWcs (const std::string &coords, const double &crval1, const double &crval2, const double &crpix1, const double &crpix2, const double &cdelt1, const double &cdelt2)
 Standard WCS sky map constructor. More...
 
 GWcs (const GFitsHDU &hdu)
 Construct from FITS HDU table. More...
 
 GWcs (const GWcs &wcs)
 Copy constructor. More...
 
virtual ~GWcs (void)
 Destructor. More...
 
virtual GWcsoperator= (const GWcs &wcs)
 Assignment operator. More...
 
virtual void clear (void)=0
 Clear object. More...
 
virtual GWcsclone (void) const =0
 Clones object. More...
 
virtual std::string classname (void) const =0
 Return class name. More...
 
virtual std::string code (void) const =0
 
virtual std::string name (void) const =0
 
virtual std::string print (const GChatter &chatter=NORMAL) const =0
 Print content of object. More...
 
virtual int size (void) const
 Return dimension of projection. More...
 
virtual void read (const GFitsHDU &hdu)
 Read WCS definition from FITS header. More...
 
virtual void write (GFitsHDU &hdu) const
 Write WCS definition into FITS HDU header. More...
 
virtual double solidangle (const GSkyPixel &pixel) const
 Returns solid angle of pixel in units of steradians. More...
 
virtual GSkyDir pix2dir (const GSkyPixel &pixel) const
 Returns sky direction of sky map pixel. More...
 
virtual GSkyPixel dir2pix (const GSkyDir &dir) const
 Returns sky map pixel of sky direction. More...
 
void set (const std::string &coords, const double &crval1, const double &crval2, const double &crpix1, const double &crpix2, const double &cdelt1, const double &cdelt2)
 Set World Coordinate System parameters. More...
 
double crval (const int &inx) const
 Return value of reference pixel. More...
 
double crpix (const int &inx) const
 Return reference pixel. More...
 
double cdelt (const int &inx) const
 Return pixel size. More...
 
- Public Member Functions inherited from GSkyProjection
 GSkyProjection (void)
 Void constructor. More...
 
 GSkyProjection (const GSkyProjection &proj)
 Copy constructor. More...
 
virtual ~GSkyProjection (void)
 Destructor. More...
 
virtual GSkyProjectionoperator= (const GSkyProjection &proj)
 Assignment operator. More...
 
virtual std::string coordsys (void) const
 Returns coordinate system. More...
 
virtual void coordsys (const std::string &coordsys)
 Set coordinate system. More...
 
- Public Member Functions inherited from GBase
virtual ~GBase (void)
 Destructor. More...
 

Protected Member Functions

void init_members (void)
 Initialise class members. More...
 
void copy_members (const GWcs &wcs)
 Copy class members. More...
 
void free_members (void)
 Delete class members. More...
 
void set_members (const std::string &coords, const double &crval1, const double &crval2, const double &crpix1, const double &crpix2, const double &cdelt1, const double &cdelt2)
 Set World Coordinate System parameters. More...
 
virtual bool compare (const GSkyProjection &proj) const
 Compares sky projection. More...
 
bool undefined (const double &value) const
 Check if value is undefined. More...
 
void wcs_ini (int naxis)
 Initialise World Coordinate System. More...
 
void wcs_set (void) const
 Setup of World Coordinate System. More...
 
void wcs_set_radesys (void) const
 Set radesys and equinox members. More...
 
void wcs_set_ctype (void) const
 Set CTYPEa keywords. More...
 
void wcs_p2s (int ncoord, int nelem, const double *pixcrd, double *imgcrd, double *phi, double *theta, double *world, int *stat) const
 Pixel-to-world transformation. More...
 
void wcs_s2p (int ncoord, int nelem, const double *world, double *phi, double *theta, double *imgcrd, double *pixcrd, int *stat) const
 World-to-pixel transformation. More...
 
std::string wcs_print (const GChatter &chatter=NORMAL) const
 Print WCS information. More...
 
std::string wcs_print_value (const double &value) const
 Helper function for value printing. More...
 
void cel_ini (void) const
 Initialise celestial transformation parameters. More...
 
void cel_set (void) const
 Setup of celestial transformation. More...
 
void cel_x2s (int nx, int ny, int sxy, int sll, const double *x, const double *y, double *phi, double *theta, double *lng, double *lat, int *stat) const
 Pixel-to-world celestial transformation. More...
 
void cel_s2x (int nlng, int nlat, int sll, int sxy, const double *lng, const double *lat, double *phi, double *theta, double *x, double *y, int *stat) const
 World-to-pixel celestial transformation. More...
 
void sph_x2s (int nphi, int ntheta, int spt, int sll, const double *phi, const double *theta, double *lng, double *lat) const
 Rotation in the pixel-to-world direction. More...
 
void sph_s2x (int nlng, int nlat, int sll, int spt, const double *lng, const double *lat, double *phi, double *theta) const
 Rotation in the pixel-to-world direction. More...
 
void spc_ini (void)
 Initialise spectral transformation parameters. More...
 
void lin_ini (int naxis)
 Initialise linear transformation parameters. More...
 
void lin_set (void) const
 Initialise linear transformation parameters. More...
 
void lin_p2x (int ncoord, int nelem, const double *pixcrd, double *imgcrd) const
 Pixel-to-world linear transformation. More...
 
void lin_x2p (int ncoord, int nelem, const double *imgcrd, double *pixcrd) const
 World-to-pixel linear transformation. More...
 
void lin_matinv (const std::vector< double > &mat, std::vector< double > &inv) const
 Invert linear transformation matrix. More...
 
void prj_ini (void) const
 Initialise projection parameters. More...
 
void prj_off (const double &phi0, const double &theta0) const
 Compute fiducial offset to force (x,y) = (0,0) at (phi0,theta0) More...
 
int prj_bchk (const double &tol, const int &nphi, const int &ntheta, const int &spt, double *phi, double *theta, int *stat) const
 Performs bounds checking on native spherical coordinates. More...
 
virtual void prj_set (void) const =0
 
virtual void prj_x2s (int nx, int ny, int sxy, int spt, const double *x, const double *y, double *phi, double *theta, int *stat) const =0
 
virtual void prj_s2x (int nphi, int ntheta, int spt, int sxy, const double *phi, const double *theta, double *x, double *y, int *stat) const =0
 
void init_lock (const int &lock_id=0) const
 Initializes an OpenMP lock with a specific name. More...
 
void set_lock (const int &lock_id=0) const
 Sets an OpenMP lock with a specific name. More...
 
void unset_lock (const int &lock_id=0) const
 Releases a previously set OpenMP lock. More...
 
- Protected Member Functions inherited from GSkyProjection
void init_members (void)
 Initialise class members. More...
 
void copy_members (const GSkyProjection &proj)
 Copy class members. More...
 
void free_members (void)
 Delete class members. More...
 

Protected Attributes

bool m_wcsset
 WCS information is set. More...
 
int m_naxis
 Number of axes. More...
 
std::vector< double > m_crval
 CRVALia keyvalues for each coord axis. More...
 
std::vector< std::string > m_cunit
 CUNITia keyvalues for each coord axis. More...
 
std::vector< std::string > m_ctype
 CTYPEia keyvalues for each coord axis. More...
 
std::vector< std::string > m_ctype_c
 CTYPEia comments for each coord axis. More...
 
double m_lonpole
 LONPOLEa keyvalue. More...
 
double m_latpole
 LATPOLEa keyvalue. More...
 
double m_restfrq
 RESTFRQa keyvalue. More...
 
double m_restwav
 RESTWAVa keyvalue. More...
 
std::string m_radesys
 RADESYS keyvalue. More...
 
double m_equinox
 EQUINOX keyvalue. More...
 
std::vector< double > m_cd
 CDi_ja linear transformation matrix. More...
 
std::vector< double > m_crota
 CROTAia keyvalues for each coord axis. More...
 
int m_lng
 Longitude axis. More...
 
int m_lat
 Latitude axis. More...
 
int m_spec
 Spectral axis. More...
 
bool m_linset
 Linear transformation is set. More...
 
bool m_unity
 Signals unity PC matrix. More...
 
std::vector< double > m_crpix
 CRPIXja keyvalues for each pixel axis. More...
 
std::vector< double > m_pc
 PCi_ja linear transformation matrix. More...
 
std::vector< double > m_cdelt
 CDELTia keyvalues for each coord axis. More...
 
std::vector< double > m_piximg
 Pixel to image transformation matrix. More...
 
std::vector< double > m_imgpix
 Image to pixel transformation matrix. More...
 
bool m_celset
 Celestial transformation is set. More...
 
bool m_offset
 Force (x,y) = (0,0) at (phi_0,theta_0) More...
 
double m_phi0
 Native azimuth angle of fiducial point. More...
 
double m_theta0
 Native zenith angle of fiducial point. More...
 
double m_ref [4]
 Celestial coordinates of fiducial. More...
 
double m_euler [5]
 Euler angles and functions thereof. More...
 
int m_latpreq
 LATPOLEa requirement. More...
 
bool m_isolat
 True if |latitude| is preserved. More...
 
bool m_prjset
 Projection is set. More...
 
double m_r0
 Radius of the generating sphere. More...
 
double m_pv [PVN]
 Projection parameters. More...
 
bool m_bounds
 Enable strict bounds checking. More...
 
double m_x0
 Fiducial x offset. More...
 
double m_y0
 Fiducial y offset. More...
 
std::vector< double > m_w
 Intermediate values. More...
 
bool m_has_pix2dir_cache
 Has valid pix2dir cache value. More...
 
bool m_has_dir2pix_cache
 Has valid dir2pix cache value. More...
 
GSkyDir m_last_pix2dir_dir
 Last sky direction for pix2dir. More...
 
GSkyDir m_last_dir2pix_dir
 Last sky direction for dir2pix. More...
 
GSkyPixel m_last_pix2dir_pix
 Last pixel for pix2dir. More...
 
GSkyPixel m_last_dir2pix_pix
 Last pixel for dir2pix. More...
 
- Protected Attributes inherited from GSkyProjection
int m_coordsys
 0=CEL, 1=GAL More...
 

Static Private Attributes

static const int PVN = 32
 
static const double UNDEFINED = 987654321.0e99
 

Detailed Description

Abstract world coordinate system base class.

Definition at line 51 of file GWcs.hpp.

Constructor & Destructor Documentation

GWcs::GWcs ( void  )

Void constructor.

Definition at line 80 of file GWcs.cpp.

References init_members().

GWcs::GWcs ( const std::string &  coords,
const double &  crval1,
const double &  crval2,
const double &  crpix1,
const double &  crpix2,
const double &  cdelt1,
const double &  cdelt2 
)

Standard WCS sky map constructor.

Parameters
[in]coordsCoordinate system.
[in]crval1X value of reference pixel.
[in]crval2Y value of reference pixel.
[in]crpix1X index of reference pixel (first pixel is 1).
[in]crpix2Y index of reference pixel (first pixel is 1).
[in]cdelt1Increment in x direction at reference pixel (deg).
[in]cdelt2Increment in y direction at reference pixel (deg).

Construct standard WCS sky map from standard definition parameters.

Definition at line 103 of file GWcs.cpp.

References init_members(), and set_members().

GWcs::GWcs ( const GFitsHDU hdu)
explicit

Construct from FITS HDU table.

Parameters
[in]hduFITS HDU.

Definition at line 124 of file GWcs.cpp.

References init_members(), and read().

GWcs::GWcs ( const GWcs wcs)

Copy constructor.

Parameters
wcsWorld Coordinate System.

Definition at line 142 of file GWcs.cpp.

References copy_members(), and init_members().

GWcs::~GWcs ( void  )
virtual

Destructor.

Definition at line 158 of file GWcs.cpp.

References free_members().

Member Function Documentation

double GWcs::cdelt ( const int &  inx) const

Return pixel size.

Parameters
[in]inxCoordinate index [0,...,m_naxis[.
Returns
Pixel size.
Exceptions
GException::out_of_rangeIndex is out of valid range.

Definition at line 935 of file GWcs.cpp.

References G_CDELT, m_cdelt, and m_naxis.

Referenced by gammalib::com_wcs_mer2car(), GSkyMap::convolution_kernel(), GSkyMap::extract(), GSkyMap::is_same(), GCOMDri::print(), and gammalib::resolution().

void GWcs::cel_ini ( void  ) const
protected

Initialise celestial transformation parameters.

Code adapted from cel.c::celini().

Definition at line 1866 of file GWcs.cpp.

References m_celset, m_euler, m_isolat, m_latpreq, m_offset, m_phi0, m_ref, m_theta0, prj_ini(), and UNDEFINED.

Referenced by wcs_ini(), and wcs_set().

void GWcs::cel_s2x ( int  nlng,
int  nlat,
int  sll,
int  sxy,
const double *  lng,
const double *  lat,
double *  phi,
double *  theta,
double *  x,
double *  y,
int *  stat 
) const
protected

World-to-pixel celestial transformation.

Parameters
[in]nlngLongitude vector length.
[in]nlatLatitude vector length (0=no replication, nlat=nlng).
[in]sllInput vector step.
[in]sxyOutput vector step.
[in]lngCelestial longitude of the projected point [deg].
[in]latCelestial latitude of the projected point [deg].
[out]phiLongitude of the projected point in native spherical coordinates [deg].
[out]thetaLatitude of the projected point in native spherical coordinates [deg].
[out]xVector of projected x coordinates.
[out]yVector of projected y coordinates.
[out]statStatus return value for each vector element (0=success, 1=invalid).

This method transforms (x,y) coordinates in the plane of projection to celestial coordinates (lng,lat). The method has been adapted from the wcslib function cel.c::celx2s.

Definition at line 2247 of file GWcs.cpp.

References cel_set(), m_celset, m_isolat, prj_s2x(), and sph_s2x().

Referenced by wcs_s2p().

void GWcs::cel_set ( void  ) const
protected

Setup of celestial transformation.

Exceptions
GException::runtime_errorInvalid values encountered.

This method sets up the celestial transformation information. The method has been adapted from the wcslib function cel.c::celset. It:

  • sets the projection (using prj_set)
  • computes the native longitude and latitude and stores the results in m_ref[2] and m_ref[3]
  • computes the Euler angles for the celestial transformation and stores the result in m_euler
  • it sets the m_latpreq (0=, 1=two solutions)
  • it sets the m_isolat flag

The m_latpreq member is for informational purposes and indicates how the LATPOLEa keyword was used

  • 0: Not required, theta_p (== delta_p) was determined uniquely by the CRVALia and LONPOLEa keywords.
  • 1: Required to select between two valid solutions of theta_p.
  • 2: theta_p was specified solely by LATPOLEa.

The m_isolat flag is true if the spherical rotation preserves the magnitude of the latitude, which occurs if the axes of the native and celestial coordinates are coincident. It signals an opportunity to cache intermediate calculations common to all elements in a vector computation.

Definition at line 1921 of file GWcs.cpp.

References abs(), gammalib::acosd(), gammalib::atan2d(), gammalib::cosd(), G_CEL_SET, m_celset, m_euler, m_isolat, m_latpreq, m_offset, m_phi0, m_ref, m_theta0, prj_set(), gammalib::sincosd(), gammalib::sind(), sqrt(), gammalib::str(), UNDEFINED, and undefined().

Referenced by cel_s2x(), cel_x2s(), and wcs_set().

void GWcs::cel_x2s ( int  nx,
int  ny,
int  sxy,
int  sll,
const double *  x,
const double *  y,
double *  phi,
double *  theta,
double *  lng,
double *  lat,
int *  stat 
) const
protected

Pixel-to-world celestial transformation.

Parameters
[in]nxX pixel vector length.
[in]nyY pixel vector length (0=no replication, ny=nx).
[in]sxyInput vector step.
[in]sllOutput vector step.
[in]xVector of projected x coordinates.
[in]yVector of projected y coordinates.
[out]phiLongitude of the projected point in native spherical coordinates [deg].
[out]thetaLatitude of the projected point in native spherical coordinates [deg].
[out]lngCelestial longitude of the projected point [deg].
[out]latCelestial latitude of the projected point [deg].
[out]statStatus return value for each vector element (0=success, 1=invalid).

This method transforms (x,y) coordinates in the plane of projection to celestial coordinates (lng,lat). The method has been adapted from the wcslib function cel.c::celx2s.

Definition at line 2194 of file GWcs.cpp.

References cel_set(), m_celset, prj_x2s(), and sph_x2s().

Referenced by wcs_p2s().

virtual std::string GWcs::classname ( void  ) const
pure virtual

Return class name.

Returns
String containing the class name.

Returns the class name for non-abstract classes in a human readable way.

Implements GSkyProjection.

Implemented in GWcsGLS, GWcsAIT, GWcsARC, GWcsAZP, GWcsCAR, GWcsMER, GWcsMOL, GWcsSFL, GWcsSIN, GWcsSTG, and GWcsTAN.

virtual void GWcs::clear ( void  )
pure virtual

Clear object.

Sets the object to a clean initial state. After calling the method the object will be in the same state as it were if an empty instance of the object would have been created.

Implements GSkyProjection.

Implemented in GWcsGLS, GWcsAIT, GWcsARC, GWcsAZP, GWcsCAR, GWcsMER, GWcsMOL, GWcsSFL, GWcsSIN, GWcsSTG, and GWcsTAN.

Referenced by set().

virtual GWcs* GWcs::clone ( void  ) const
pure virtual

Clones object.

Returns
Pointer to deep copy of object.

Creates a deep copy of the object and returns a pointer to the object.

Implements GSkyProjection.

Implemented in GWcsGLS, GWcsAIT, GWcsARC, GWcsAZP, GWcsCAR, GWcsMER, GWcsMOL, GWcsSFL, GWcsSIN, GWcsSTG, and GWcsTAN.

virtual std::string GWcs::code ( void  ) const
pure virtual
bool GWcs::compare ( const GSkyProjection proj) const
protectedvirtual

Compares sky projection.

Parameters
[in]projSky projection.
Returns
True if proj is identical to the actual object.

This method is a helper for the World Coordinate Comparison friends. It does not compare derived quantities as those may not have been initialised in both objects.

Implements GSkyProjection.

Definition at line 1129 of file GWcs.cpp.

References code(), m_cdelt, GSkyProjection::m_coordsys, m_crpix, m_crval, m_lat, and m_lng.

void GWcs::copy_members ( const GWcs wcs)
protected
double GWcs::crpix ( const int &  inx) const

Return reference pixel.

Parameters
[in]inxCoordinate index [0,...,m_naxis[.
Returns
Reference pixel.
Exceptions
GException::out_of_rangeIndex is out of valid range.

Definition at line 911 of file GWcs.cpp.

References G_CRPIX, m_crpix, and m_naxis.

Referenced by gammalib::com_wcs_mer2car(), GSkyMap::extract(), GSkyMap::is_same(), and GCOMDri::print().

double GWcs::crval ( const int &  inx) const

Return value of reference pixel.

Parameters
[in]inxCoordinate index [0,...,m_naxis[.
Returns
Value of reference pixel.
Exceptions
GException::out_of_rangeIndex is out of valid range.

Definition at line 887 of file GWcs.cpp.

References G_CRVAL, m_crval, and m_naxis.

Referenced by gammalib::com_wcs_mer2car(), GSkyMap::extract(), GSkyMap::is_same(), and GCOMDri::print().

GSkyPixel GWcs::dir2pix ( const GSkyDir dir) const
virtual

Returns sky map pixel of sky direction.

Parameters
[in]dirSky direction.
Returns
Sky map pixel.

Returns the sky map pixel for a given sky direction. Note that the sky map pixel values start from 0 while the WCS pixel reference starts from 1.

A pre-computation cache is implemented so that successive calls with the same dir value will returned the cached sky pixel. The pre-computation cache is OMP thread safe.

Implements GSkyProjection.

Definition at line 776 of file GWcs.cpp.

References GSkyDir::b_deg(), GSkyDir::dec_deg(), GSkyDir::l_deg(), GSkyProjection::m_coordsys, m_has_dir2pix_cache, m_last_dir2pix_dir, m_last_dir2pix_pix, GSkyDir::ra_deg(), set_lock(), unset_lock(), wcs_s2p(), and GSkyPixel::xy().

void GWcs::free_members ( void  )
protected
void GWcs::init_lock ( const int &  lock_id = 0) const
inlineprotected

Initializes an OpenMP lock with a specific name.

Parameters
[in]lock_idIdentifier of the lock that should be initialized

Definition at line 274 of file GWcs.hpp.

Referenced by init_members().

void GWcs::init_members ( void  )
protected
void GWcs::lin_ini ( int  naxis)
protected

Initialise linear transformation parameters.

Code adapted from lin.c::linini().

Definition at line 2779 of file GWcs.cpp.

References m_cdelt, m_crpix, m_imgpix, m_linset, m_pc, m_piximg, and m_unity.

Referenced by wcs_ini().

void GWcs::lin_matinv ( const std::vector< double > &  mat,
std::vector< double > &  inv 
) const
protected

Invert linear transformation matrix.

Parameters
[in]matMatrix
[out]invInverted matrix
Exceptions
GException::runtime_errorSingular matrix encountered.

Inverts a linear transformation matrix that is stored in a vector. The matrix dimension is assumed to be m_naxis*m_naxis. This method has been adapted from lin.c::matinv().

Definition at line 3052 of file GWcs.cpp.

References abs(), G_LIN_MATINV, m_naxis, and gammalib::str().

Referenced by lin_set().

void GWcs::lin_p2x ( int  ncoord,
int  nelem,
const double *  pixcrd,
double *  imgcrd 
) const
protected

Pixel-to-world linear transformation.

Parameters
[in]ncoordNumber of coordinates.
[in]nelemVector length of each coordinate (>=m_naxis).
[in]pixcrdArray of pixel coordinates (ncoord*nelem).
[out]imgcrdArray of intermediate world coordinates (ncoord*nelem).

Transforms pixel coordinates to intermediate world coordinates. This method has been adapted from lin.c::linp2x(). The method performs distinct computations depending of whether the PC matrix is unity or not, avoiding a matrix multiplication when it is not necessary.

Definition at line 2899 of file GWcs.cpp.

References lin_set(), m_cdelt, m_crpix, m_linset, m_naxis, m_piximg, and m_unity.

Referenced by wcs_p2s().

void GWcs::lin_set ( void  ) const
protected

Initialise linear transformation parameters.

Code adapted from lin.c::linset(). It requires m_pc to be set and to be of size m_naxis*m_naxis.

Definition at line 2829 of file GWcs.cpp.

References lin_matinv(), m_cdelt, m_imgpix, m_linset, m_naxis, m_pc, m_piximg, and m_unity.

Referenced by lin_p2x(), lin_x2p(), and wcs_set().

void GWcs::lin_x2p ( int  ncoord,
int  nelem,
const double *  imgcrd,
double *  pixcrd 
) const
protected

World-to-pixel linear transformation.

Parameters
[in]ncoordNumber of coordinates.
[in]nelemVector length of each coordinate (>=m_naxis).
[in]imgcrdArray of intermediate world coordinates (ncoord*nelem).
[out]pixcrdArray of pixel coordinates (ncoord*nelem).

Transforms intermediate world coordinates to pixel coordinates. This method has been adapted from lin.c::linx2p(). The method performs distinct computations depending of whether the PC matrix is unity or not, avoiding a matrix multiplication when it is not necessary.

Definition at line 2978 of file GWcs.cpp.

References lin_set(), m_cdelt, m_crpix, m_imgpix, m_linset, m_naxis, and m_unity.

Referenced by wcs_s2p().

virtual std::string GWcs::name ( void  ) const
pure virtual
GWcs & GWcs::operator= ( const GWcs wcs)
virtual

Assignment operator.

Parameters
[in]wcsWorld Coordinate System.
Returns
World Coordinate System.

Definition at line 180 of file GWcs.cpp.

References copy_members(), free_members(), init_members(), and GSkyProjection::operator=().

Referenced by GWcsAIT::operator=(), GWcsTAN::operator=(), GWcsSTG::operator=(), GWcsSIN::operator=(), GWcsSFL::operator=(), GWcsMOL::operator=(), GWcsMER::operator=(), GWcsCAR::operator=(), GWcsAZP::operator=(), and GWcsARC::operator=().

GSkyDir GWcs::pix2dir ( const GSkyPixel pixel) const
virtual

Returns sky direction of sky map pixel.

Parameters
[in]pixelSky map pixel.
Returns
Sky direction.

Returns the sky direction of a sky map pixel. Note that the sky map pixel values start from 0 while the WCS pixel reference starts from 1.

A pre-computation cache is implemented so that successive calls with the same pixel value will returned the cached sky direction. The pre-computation cache is OMP thread safe.

Implements GSkyProjection.

Definition at line 692 of file GWcs.cpp.

References GSkyDir::lb_deg(), GSkyProjection::m_coordsys, m_has_pix2dir_cache, m_last_pix2dir_dir, m_last_pix2dir_pix, GSkyDir::radec_deg(), set_lock(), unset_lock(), wcs_p2s(), GSkyPixel::x(), and GSkyPixel::y().

Referenced by solidangle().

virtual std::string GWcs::print ( const GChatter chatter = NORMAL) const
pure virtual

Print content of object.

Parameters
[in]chatterChattiness (defaults to NORMAL).
Returns
String containing the content of the object.

Formats the content in a standard way and puts this content in a C++ string that is returned.

Implements GSkyProjection.

Implemented in GWcsGLS, GWcsAIT, GWcsARC, GWcsAZP, GWcsCAR, GWcsMER, GWcsMOL, GWcsSFL, GWcsSIN, GWcsSTG, and GWcsTAN.

int GWcs::prj_bchk ( const double &  tol,
const int &  nphi,
const int &  ntheta,
const int &  spt,
double *  phi,
double *  theta,
int *  stat 
) const
protected

Performs bounds checking on native spherical coordinates.

Parameters
[in]tolTolerance for the bounds check [deg]
[in]nphiNumber of bins in phi.
[in]nthetaNumber of bins in theta.
[in]sptStep size.
[in,out]phiPointer to phi array [deg]
[in,out]thetaPointer to theta array [deg]
[in,out]statPointer to status array.

Performs bounds checking on native spherical coordinates. As returned by the deprojection (x2s) routines, native longitude is expected to lie in the closed interval [-180,180], with latitude in [-90,90].

A tolerance may be specified to provide a small allowance for numerical imprecision. Values that lie outside the allowed range by not more than the specified tolerance will be adjusted back into range.

Code adapted from prj.c::prjbchk().

Definition at line 3281 of file GWcs.cpp.

References m_bounds.

Referenced by GWcsARC::prj_x2s(), GWcsSFL::prj_x2s(), GWcsMOL::prj_x2s(), GWcsMER::prj_x2s(), and GWcsCAR::prj_x2s().

void GWcs::prj_ini ( void  ) const
protected

Initialise projection parameters.

Code adapted from prj.c::prjini().

Definition at line 3202 of file GWcs.cpp.

References m_bounds, m_prjset, m_pv, m_r0, m_w, m_x0, m_y0, PVN, and UNDEFINED.

Referenced by cel_ini().

void GWcs::prj_off ( const double &  phi0,
const double &  theta0 
) const
protected

Compute fiducial offset to force (x,y) = (0,0) at (phi0,theta0)

Parameters
[in]phi0Fiducial longitude
[in]theta0Fiducial latitude

Code adapted from prj.c::prjoff().

Definition at line 3232 of file GWcs.cpp.

References m_phi0, m_theta0, m_x0, m_y0, prj_s2x(), and undefined().

Referenced by GWcsAIT::prj_set(), GWcsTAN::prj_set(), GWcsSTG::prj_set(), GWcsSIN::prj_set(), GWcsSFL::prj_set(), GWcsMOL::prj_set(), GWcsMER::prj_set(), GWcsCAR::prj_set(), GWcsAZP::prj_set(), and GWcsARC::prj_set().

virtual void GWcs::prj_s2x ( int  nphi,
int  ntheta,
int  spt,
int  sxy,
const double *  phi,
const double *  theta,
double *  x,
double *  y,
int *  stat 
) const
protectedpure virtual

Implemented in GWcsAIT, GWcsARC, GWcsAZP, GWcsCAR, GWcsMER, GWcsMOL, GWcsSFL, GWcsSIN, GWcsSTG, and GWcsTAN.

Referenced by cel_s2x(), and prj_off().

virtual void GWcs::prj_set ( void  ) const
protectedpure virtual

Implemented in GWcsAIT, GWcsARC, GWcsAZP, GWcsCAR, GWcsMER, GWcsMOL, GWcsSFL, GWcsSIN, GWcsSTG, and GWcsTAN.

Referenced by cel_set().

virtual void GWcs::prj_x2s ( int  nx,
int  ny,
int  sxy,
int  spt,
const double *  x,
const double *  y,
double *  phi,
double *  theta,
int *  stat 
) const
protectedpure virtual

Implemented in GWcsAIT, GWcsARC, GWcsAZP, GWcsCAR, GWcsMER, GWcsMOL, GWcsSFL, GWcsSIN, GWcsSTG, and GWcsTAN.

Referenced by cel_x2s().

void GWcs::read ( const GFitsHDU hdu)
virtual

Read WCS definition from FITS header.

Parameters
[in]hduFITS HDU.
Exceptions
GException::invalid_valueCoordinate system is not of valid type.

This method reads the WCS definition from the FITS header.

Implements GSkyProjection.

Definition at line 220 of file GWcs.cpp.

References GSkyProjection::free_members(), free_members(), G_READ, GFitsHDU::has_card(), GSkyProjection::init_members(), init_members(), m_equinox, m_lat, m_lng, m_radesys, GFitsHDU::real(), set_members(), GFitsHDU::string(), and wcs_set().

Referenced by GWcs().

void GWcs::set ( const std::string &  coords,
const double &  crval1,
const double &  crval2,
const double &  crpix1,
const double &  crpix2,
const double &  cdelt1,
const double &  cdelt2 
)

Set World Coordinate System parameters.

Parameters
[in]coordsCoordinate system.
[in]crval1X value of reference pixel.
[in]crval2Y value of reference pixel.
[in]crpix1X index of reference pixel (first pixel is 1).
[in]crpix2Y index of reference pixel (first pixel is 1).
[in]cdelt1Increment in x direction at reference pixel (deg).
[in]cdelt2Increment in y direction at reference pixel (deg).

This method sets the WCS parameters.

Definition at line 859 of file GWcs.cpp.

References clear(), set_members(), and wcs_set().

Referenced by GSkyMap::extract(), and GSkyMap::set_wcs().

void GWcs::set_lock ( const int &  lock_id = 0) const
inlineprotected

Sets an OpenMP lock with a specific name.

Parameters
[in]lock_idIdentifier of the lock that should be set

Definition at line 291 of file GWcs.hpp.

Referenced by dir2pix(), and pix2dir().

void GWcs::set_members ( const std::string &  coords,
const double &  crval1,
const double &  crval2,
const double &  crpix1,
const double &  crpix2,
const double &  cdelt1,
const double &  cdelt2 
)
protected

Set World Coordinate System parameters.

Parameters
[in]coordsCoordinate system.
[in]crval1X value of reference pixel.
[in]crval2Y value of reference pixel.
[in]crpix1X index of reference pixel (first pixel is 1).
[in]crpix2Y index of reference pixel (first pixel is 1).
[in]cdelt1Increment in x direction at reference pixel (deg).
[in]cdelt2Increment in y direction at reference pixel (deg).

This method sets the WCS parameters. It does not call wcs_set(), however, as wcs_set() may depend on the availability of derived class methods which can not be used in a base class constructor.

Todo:
Implement parameter validity check

Definition at line 1090 of file GWcs.cpp.

References GSkyProjection::coordsys(), m_cdelt, m_crpix, m_crval, m_lat, m_lng, and wcs_ini().

Referenced by GWcs(), read(), and set().

int GWcs::size ( void  ) const
inlinevirtual

Return dimension of projection.

Returns
Dimension of projection.

Returns the dimension of the projection.

Implements GSkyProjection.

Definition at line 249 of file GWcs.hpp.

double GWcs::solidangle ( const GSkyPixel pixel) const
virtual

Returns solid angle of pixel in units of steradians.

Parameters
[in]pixelPixel index (x,y)

Estimates solid angles of pixels using the Girard equation for excess area - see: http://mathworld.wolfram.com/SphericalPolygon.html

Below, the definiton of the pixel cornes and sides are shown as used within the code.

        a12
    1---------2
    |\       /|
    | \a13  / |
    |  \   /  |
    |   \ /   |
 a14|    X    |a23
    |   / \   |
    |  /   \  |
    | /a24  \ |
    |/       \|
    4---------3
        a34

Implements GSkyProjection.

Definition at line 487 of file GWcs.cpp.

References gammalib::acos(), atan(), GSkyDir::celvector(), cos(), cross(), gammalib::deg2rad, GSkyDir::dist(), gammalib::pi, pix2dir(), sin(), sqrt(), tan(), gammalib::twopi, GSkyPixel::x(), and GSkyPixel::y().

void GWcs::spc_ini ( void  )
protected

Initialise spectral transformation parameters.

Code adapted from spc.c::spcini(). The actual version of the code does nothing.

Definition at line 2761 of file GWcs.cpp.

Referenced by wcs_ini().

void GWcs::sph_s2x ( int  nlng,
int  nlat,
int  sll,
int  spt,
const double *  lng,
const double *  lat,
double *  phi,
double *  theta 
) const
protected

Rotation in the pixel-to-world direction.

Parameters
[in]nlngLongitude vector length.
[in]nlatLatitude vector length (0=no replication).
[in]sllInput vector step.
[in]sptOutput vector step.
[in]lngCelestial longitude [deg].
[in]latCelestial latitude [deg].
[out]phiLongitude in the native coordinate system of the projection [deg].
[out]thetaLatitude in the native coordinate system of the projection [deg].

This method has been adapted from the wcslib function sph.c::sphs2x(). The interface follows very closely that of wcslib.

Definition at line 2551 of file GWcs.cpp.

References abs(), gammalib::acosd(), gammalib::asind(), gammalib::atan2d(), gammalib::cosd(), m_euler, gammalib::sincosd(), and sqrt().

Referenced by cel_s2x().

void GWcs::sph_x2s ( int  nphi,
int  ntheta,
int  spt,
int  sll,
const double *  phi,
const double *  theta,
double *  lng,
double *  lat 
) const
protected

Rotation in the pixel-to-world direction.

Parameters
[in]nphiPhi vector length.
[in]nthetaTheta vector length (0=no replication).
[in]sptInput vector step.
[in]sllOutput vector step.
[in]phiLongitude in the native coordinate system of the projection [deg].
[in]thetaLatitude in the native coordinate system of the projection [deg].
[out]lngCelestial longitude [deg].
[out]latCelestial latitude [deg].

This method has been adapted from the wcslib function sph.c::sphx2s(). The interface follows very closely that of wcslib.

Definition at line 2310 of file GWcs.cpp.

References abs(), gammalib::acosd(), gammalib::asind(), gammalib::atan2d(), gammalib::cosd(), m_euler, gammalib::sincosd(), and sqrt().

Referenced by cel_x2s().

bool GWcs::undefined ( const double &  value) const
inlineprotected

Check if value is undefined.

Parameters
[in]valueValue to check
Returns
True if value is undefined, false otherwise

Definition at line 262 of file GWcs.hpp.

References UNDEFINED.

Referenced by cel_set(), prj_off(), GWcsSIN::prj_set(), GWcsAZP::prj_set(), wcs_print_value(), wcs_set_radesys(), and write().

void GWcs::unset_lock ( const int &  lock_id = 0) const
inlineprotected

Releases a previously set OpenMP lock.

Parameters
[in]lock_idIdentifier of the lock to be released

Definition at line 305 of file GWcs.hpp.

Referenced by dir2pix(), and pix2dir().

void GWcs::wcs_ini ( int  naxis)
protected

Initialise World Coordinate System.

Parameters
[in]naxisNumber of axes

This method initialises the World Coordinate System information. The method has been adapted from the wcslib function wcs.c::wcsini. In contrast to the wcslib function, however, this method accepts naxis=0. In this case, all vectors are cleared.

Definition at line 1170 of file GWcs.cpp.

References cel_ini(), lin_ini(), m_cd, m_cdelt, m_crota, m_crpix, m_crval, m_ctype, m_ctype_c, m_cunit, m_equinox, m_lat, m_latpole, m_lng, m_lonpole, m_naxis, m_pc, m_radesys, m_restfrq, m_restwav, m_spec, m_wcsset, spc_ini(), and UNDEFINED.

Referenced by init_members(), and set_members().

void GWcs::wcs_p2s ( int  ncoord,
int  nelem,
const double *  pixcrd,
double *  imgcrd,
double *  phi,
double *  theta,
double *  world,
int *  stat 
) const
protected

Pixel-to-world transformation.

Parameters
[in]ncoordNumber of coordinates.
[in]nelemVector length of each coordinate (>=m_naxis).
[in]pixcrdArray [ncoord][nelem] of pixel coordinates.
[out]imgcrdArray [ncoord][nelem] of intermediate world coordinates.
[out]phiArray [ncoord] of longitudes in native coordinate system.
[out]thetaArray [ncoord] of latitudes in native coordinate system.
[out]worldArray [ncoord][nelem] of world coordinates.
[out]statArray [ncoord] of pixel coordinates validity.
Exceptions
GException::invalid_argumentInvalid input parameters provided

This method transforms pixel coordinates to world coordinates. The method has been adapted from wcs.c::wcsp2s(). Note that this method is extremely simplified with respect to wcslib, but it does the job for now.

For celestial axes, imgcrd[][wcs.lng] and imgcrd[][wcs.lat] are the projected x-, and y-coordinates in pseudo "degrees" and world[][wcs.lng] and world[][wcs.lat] are the celestial longitude and latitude [deg] For spectral axes, imgcrd[][wcs.spec] is the intermediate spectral coordinate, in SI units and world[][wcs.spec] is ...

Todo:

Check for constant x and/or y to speed-up computations

Zero the unused world coordinate elements

Definition at line 1514 of file GWcs.cpp.

References cel_x2s(), G_WCS_P2S, lin_p2x(), m_lat, m_lng, m_naxis, m_wcsset, gammalib::str(), and wcs_set().

Referenced by pix2dir().

std::string GWcs::wcs_print_value ( const double &  value) const
protected

Helper function for value printing.

Parameters
[in]valueDouble precision value

This helper function either prints a double precision value or the word 'UNDEFINED', depending on whether the value is defined or not.

Definition at line 1837 of file GWcs.cpp.

References gammalib::str(), and undefined().

Referenced by wcs_print().

void GWcs::wcs_s2p ( int  ncoord,
int  nelem,
const double *  world,
double *  phi,
double *  theta,
double *  imgcrd,
double *  pixcrd,
int *  stat 
) const
protected

World-to-pixel transformation.

Parameters
[in]ncoordNumber of coordinates.
[in]nelemVector length of each coordinate (>=m_naxis).
[in]worldArray [ncoord][nelem] of world coordinates.
[out]phiArray [ncoord] of longitudes in native coordinate system.
[out]thetaArray [ncoord] of latitudes in native coordinate system.
[out]imgcrdArray [ncoord][nelem] of intermediate world coordinates.
[out]pixcrdArray [ncoord][nelem] of pixel coordinates.
[out]statArray [ncoord] of pixel coordinates validity.
Exceptions
GException::wcs_invalid_parameterInvalid input parameters provided

This method transforms world coordinates to pixel coordinates. The method has been adapted from wcs.c::wcss2p(). Note that this method is extremely simplified with respect to wcslib, but it does the job for now.

For celestial axes, imgcrd[][wcs.lng] and imgcrd[][wcs.lat] are the projected x-, and y-coordinates in pseudo "degrees" and world[][wcs.lng] and world[][wcs.lat] are the celestial longitude and latitude [deg] For spectral axes, imgcrd[][wcs.spec] is the intermediate spectral coordinate, in SI units and world[][wcs.spec] is ...

Todo:

Check for constant x and/or y to speed-up computations

Zero the unused world coordinate elements

Definition at line 1589 of file GWcs.cpp.

References cel_s2x(), G_WCS_S2P, lin_x2p(), m_lat, m_lng, m_naxis, m_wcsset, gammalib::str(), and wcs_set().

Referenced by dir2pix().

void GWcs::wcs_set ( void  ) const
protected

Setup of World Coordinate System.

This method sets up the World Coordinate System information. In particular it:

  • initialises the celestial parameters (call to cel_ini)
  • sets the m_ref information (reference value and native pole)
  • sets the celestial parameters (call to cel_set)
  • sets the linear transformation (call to lin_set) The method has been adapted from the wcslib function wcs.c::wcsset.
Todo:

Determine axis types from CTYPEia

Convert to canonical units

Do we have PVi_ma keyvalues?

Do simple alias translations

Update PVi_ma keyvalues

Non-linear spectral axis present?

Tabular axes present?

Definition at line 1262 of file GWcs.cpp.

References cel_ini(), cel_set(), code(), lin_set(), m_crval, m_lat, m_latpole, m_lng, m_lonpole, m_offset, m_phi0, m_r0, m_ref, m_theta0, m_wcsset, and wcs_set_radesys().

Referenced by GWcsAIT::GWcsAIT(), GWcsARC::GWcsARC(), GWcsAZP::GWcsAZP(), GWcsCAR::GWcsCAR(), GWcsGLS::GWcsGLS(), GWcsMER::GWcsMER(), GWcsMOL::GWcsMOL(), GWcsSFL::GWcsSFL(), GWcsSIN::GWcsSIN(), GWcsSTG::GWcsSTG(), GWcsTAN::GWcsTAN(), init_members(), read(), set(), wcs_p2s(), and wcs_s2p().

void GWcs::wcs_set_ctype ( void  ) const
protected

Set CTYPEa keywords.

Exceptions
GException::invalid_valueWCS projection not valid.
GException::wcs_bad_coordsCoordinate system is not of valid type.

This method has been inspired by code from wcshdr.c::wcshdo.

Definition at line 1391 of file GWcs.cpp.

References code(), G_WCS_SET_CTYPE, GSkyProjection::m_coordsys, m_ctype, m_ctype_c, m_lat, m_lng, m_spec, name(), and gammalib::str().

Referenced by write().

void GWcs::wcs_set_radesys ( void  ) const
protected

Set radesys and equinox members.

Set default values for radesys and equinox for equatorial, ecliptic or helioecliptic coordinates. For other coordinates the radesys and equinox members are set to empty/undefined values.

This method has been inspired by code from wcs.c::wcsset.

Definition at line 1328 of file GWcs.cpp.

References GSkyProjection::m_coordsys, m_equinox, m_radesys, UNDEFINED, and undefined().

Referenced by wcs_set().

void GWcs::write ( GFitsHDU hdu) const
virtual

Write WCS definition into FITS HDU header.

Parameters
[in]hduFITS HDU.

This method writes the World Coordinate System definition into the FITS HDU header.

This method has been adapted from wcshdr.c::wcshdo().

Implements GSkyProjection.

Definition at line 342 of file GWcs.cpp.

References GFitsHDU::card(), m_cdelt, m_crpix, m_crval, m_ctype, m_ctype_c, m_cunit, m_equinox, m_lat, m_latpole, m_lng, m_lonpole, m_naxis, m_radesys, m_restfrq, m_restwav, m_spec, gammalib::str(), gammalib::strip_whitespace(), undefined(), and wcs_set_ctype().

Member Data Documentation

bool GWcs::m_bounds
mutableprotected

Enable strict bounds checking.

Definition at line 214 of file GWcs.hpp.

Referenced by copy_members(), prj_bchk(), prj_ini(), GWcsAZP::prj_s2x(), GWcsTAN::prj_s2x(), GWcsSIN::prj_s2x(), and wcs_print().

std::vector<double> GWcs::m_cd
protected

CDi_ja linear transformation matrix.

Definition at line 183 of file GWcs.hpp.

Referenced by copy_members(), and wcs_ini().

std::vector<double> GWcs::m_cdelt
protected

CDELTia keyvalues for each coord axis.

Definition at line 194 of file GWcs.hpp.

Referenced by cdelt(), compare(), copy_members(), lin_ini(), lin_p2x(), lin_set(), lin_x2p(), set_members(), wcs_ini(), wcs_print(), and write().

bool GWcs::m_celset
mutableprotected

Celestial transformation is set.

Definition at line 199 of file GWcs.hpp.

Referenced by cel_ini(), cel_s2x(), cel_set(), cel_x2s(), and copy_members().

std::vector<double> GWcs::m_crota
protected

CROTAia keyvalues for each coord axis.

Definition at line 184 of file GWcs.hpp.

Referenced by copy_members(), and wcs_ini().

std::vector<double> GWcs::m_crpix
protected

CRPIXja keyvalues for each pixel axis.

Definition at line 192 of file GWcs.hpp.

Referenced by compare(), copy_members(), crpix(), lin_ini(), lin_p2x(), lin_x2p(), set_members(), wcs_ini(), wcs_print(), and write().

std::vector<double> GWcs::m_crval
protected

CRVALia keyvalues for each coord axis.

Definition at line 173 of file GWcs.hpp.

Referenced by compare(), copy_members(), crval(), set_members(), wcs_ini(), wcs_print(), wcs_set(), and write().

std::vector<std::string> GWcs::m_ctype
mutableprotected

CTYPEia keyvalues for each coord axis.

Definition at line 175 of file GWcs.hpp.

Referenced by copy_members(), wcs_ini(), wcs_set_ctype(), and write().

std::vector<std::string> GWcs::m_ctype_c
mutableprotected

CTYPEia comments for each coord axis.

Definition at line 176 of file GWcs.hpp.

Referenced by copy_members(), wcs_ini(), wcs_set_ctype(), and write().

std::vector<std::string> GWcs::m_cunit
protected

CUNITia keyvalues for each coord axis.

Definition at line 174 of file GWcs.hpp.

Referenced by copy_members(), wcs_ini(), wcs_print(), and write().

double GWcs::m_equinox
mutableprotected

EQUINOX keyvalue.

Definition at line 182 of file GWcs.hpp.

Referenced by copy_members(), read(), wcs_ini(), wcs_set_radesys(), and write().

double GWcs::m_euler[5]
mutableprotected

Euler angles and functions thereof.

Definition at line 206 of file GWcs.hpp.

Referenced by cel_ini(), cel_set(), copy_members(), sph_s2x(), sph_x2s(), and wcs_print().

bool GWcs::m_has_dir2pix_cache
mutableprotected

Has valid dir2pix cache value.

Definition at line 224 of file GWcs.hpp.

Referenced by copy_members(), dir2pix(), and init_members().

bool GWcs::m_has_pix2dir_cache
mutableprotected

Has valid pix2dir cache value.

Definition at line 223 of file GWcs.hpp.

Referenced by copy_members(), init_members(), and pix2dir().

std::vector<double> GWcs::m_imgpix
mutableprotected

Image to pixel transformation matrix.

Definition at line 196 of file GWcs.hpp.

Referenced by copy_members(), lin_ini(), lin_set(), lin_x2p(), and wcs_print().

bool GWcs::m_isolat
mutableprotected

True if |latitude| is preserved.

Definition at line 208 of file GWcs.hpp.

Referenced by cel_ini(), cel_s2x(), cel_set(), copy_members(), and wcs_print().

GSkyDir GWcs::m_last_dir2pix_dir
mutableprotected

Last sky direction for dir2pix.

Definition at line 226 of file GWcs.hpp.

Referenced by copy_members(), dir2pix(), and init_members().

GSkyPixel GWcs::m_last_dir2pix_pix
mutableprotected

Last pixel for dir2pix.

Definition at line 228 of file GWcs.hpp.

Referenced by copy_members(), dir2pix(), and init_members().

GSkyDir GWcs::m_last_pix2dir_dir
mutableprotected

Last sky direction for pix2dir.

Definition at line 225 of file GWcs.hpp.

Referenced by copy_members(), init_members(), and pix2dir().

GSkyPixel GWcs::m_last_pix2dir_pix
mutableprotected

Last pixel for pix2dir.

Definition at line 227 of file GWcs.hpp.

Referenced by copy_members(), init_members(), and pix2dir().

int GWcs::m_lat
protected

Latitude axis.

Definition at line 186 of file GWcs.hpp.

Referenced by compare(), copy_members(), read(), set_members(), wcs_ini(), wcs_p2s(), wcs_print(), wcs_s2p(), wcs_set(), wcs_set_ctype(), and write().

double GWcs::m_latpole
mutableprotected

LATPOLEa keyvalue.

Definition at line 178 of file GWcs.hpp.

Referenced by copy_members(), wcs_ini(), wcs_print(), wcs_set(), and write().

int GWcs::m_latpreq
mutableprotected

LATPOLEa requirement.

Definition at line 207 of file GWcs.hpp.

Referenced by cel_ini(), cel_set(), copy_members(), and wcs_print().

bool GWcs::m_linset
mutableprotected

Linear transformation is set.

Definition at line 190 of file GWcs.hpp.

Referenced by copy_members(), lin_ini(), lin_p2x(), lin_set(), and lin_x2p().

int GWcs::m_lng
protected

Longitude axis.

Definition at line 185 of file GWcs.hpp.

Referenced by compare(), copy_members(), read(), set_members(), wcs_ini(), wcs_p2s(), wcs_print(), wcs_s2p(), wcs_set(), wcs_set_ctype(), and write().

double GWcs::m_lonpole
mutableprotected

LONPOLEa keyvalue.

Definition at line 177 of file GWcs.hpp.

Referenced by copy_members(), wcs_ini(), wcs_print(), wcs_set(), and write().

int GWcs::m_naxis
protected

Number of axes.

Definition at line 172 of file GWcs.hpp.

Referenced by cdelt(), copy_members(), crpix(), crval(), lin_matinv(), lin_p2x(), lin_set(), lin_x2p(), wcs_ini(), wcs_p2s(), wcs_print(), wcs_s2p(), and write().

bool GWcs::m_offset
mutableprotected

Force (x,y) = (0,0) at (phi_0,theta_0)

Definition at line 200 of file GWcs.hpp.

Referenced by cel_ini(), cel_set(), copy_members(), wcs_print(), and wcs_set().

std::vector<double> GWcs::m_pc
protected

PCi_ja linear transformation matrix.

Definition at line 193 of file GWcs.hpp.

Referenced by copy_members(), lin_ini(), lin_set(), and wcs_ini().

double GWcs::m_phi0
mutableprotected

Native azimuth angle of fiducial point.

Definition at line 201 of file GWcs.hpp.

Referenced by cel_ini(), cel_set(), copy_members(), prj_off(), wcs_print(), and wcs_set().

std::vector<double> GWcs::m_piximg
mutableprotected

Pixel to image transformation matrix.

Definition at line 195 of file GWcs.hpp.

Referenced by copy_members(), lin_ini(), lin_p2x(), lin_set(), and wcs_print().

double GWcs::m_pv[PVN]
mutableprotected
std::string GWcs::m_radesys
mutableprotected

RADESYS keyvalue.

Definition at line 181 of file GWcs.hpp.

Referenced by copy_members(), read(), wcs_ini(), wcs_set_radesys(), and write().

double GWcs::m_ref[4]
mutableprotected

Celestial coordinates of fiducial.

Definition at line 203 of file GWcs.hpp.

Referenced by cel_ini(), cel_set(), copy_members(), wcs_print(), and wcs_set().

double GWcs::m_restfrq
protected

RESTFRQa keyvalue.

Definition at line 179 of file GWcs.hpp.

Referenced by copy_members(), wcs_ini(), wcs_print(), and write().

double GWcs::m_restwav
protected

RESTWAVa keyvalue.

Definition at line 180 of file GWcs.hpp.

Referenced by copy_members(), wcs_ini(), wcs_print(), and write().

int GWcs::m_spec
protected

Spectral axis.

Definition at line 187 of file GWcs.hpp.

Referenced by copy_members(), wcs_ini(), wcs_print(), wcs_set_ctype(), and write().

double GWcs::m_theta0
mutableprotected

Native zenith angle of fiducial point.

Definition at line 202 of file GWcs.hpp.

Referenced by cel_ini(), cel_set(), copy_members(), prj_off(), wcs_print(), and wcs_set().

bool GWcs::m_unity
mutableprotected

Signals unity PC matrix.

Definition at line 191 of file GWcs.hpp.

Referenced by copy_members(), lin_ini(), lin_p2x(), lin_set(), lin_x2p(), and wcs_print().

bool GWcs::m_wcsset
mutableprotected

WCS information is set.

Definition at line 171 of file GWcs.hpp.

Referenced by copy_members(), wcs_ini(), wcs_p2s(), wcs_s2p(), and wcs_set().

const int GWcs::PVN = 32
staticprivate

Definition at line 94 of file GWcs.hpp.

Referenced by copy_members(), and prj_ini().

const double GWcs::UNDEFINED = 987654321.0e99
staticprivate

Definition at line 95 of file GWcs.hpp.

Referenced by cel_ini(), cel_set(), prj_ini(), undefined(), wcs_ini(), and wcs_set_radesys().


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