GammaLib  2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GSkyProjection Class Referenceabstract

Abstract sky projection base class. More...

#include <GSkyProjection.hpp>

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

Public Member Functions

 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 void clear (void)=0
 Clear object. More...
 
virtual GSkyProjectionclone (void) const =0
 Clones object. More...
 
virtual std::string classname (void) const =0
 Return class name. More...
 
virtual int size (void) const =0
 
virtual std::string code (void) const =0
 
virtual std::string name (void) const =0
 
virtual void read (const GFitsHDU &hdu)=0
 
virtual void write (GFitsHDU &hdu) const =0
 
virtual double solidangle (const GSkyPixel &pixel) const =0
 
virtual GSkyDir pix2dir (const GSkyPixel &pixel) const =0
 
virtual GSkyPixel dir2pix (const GSkyDir &dir) const =0
 
virtual std::string print (const GChatter &chatter=NORMAL) const =0
 Print content of object. 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 GSkyProjection &proj)
 Copy class members. More...
 
void free_members (void)
 Delete class members. More...
 
virtual bool compare (const GSkyProjection &proj) const =0
 

Protected Attributes

int m_coordsys
 0=CEL, 1=GAL More...
 

Friends

bool operator== (const GSkyProjection &a, const GSkyProjection &b)
 Equality operator. More...
 
bool operator!= (const GSkyProjection &a, const GSkyProjection &b)
 Non-equality operator. More...
 

Detailed Description

Abstract sky projection base class.

This class defines an abstract projection from sky coordinates into pixel coordinates. Sky coordinates are implemented using the GSkyDir class, pixel coordinates are implemented using the GSkyPixel class.

Definition at line 47 of file GSkyProjection.hpp.

Constructor & Destructor Documentation

GSkyProjection::GSkyProjection ( void  )

Void constructor.

Definition at line 58 of file GSkyProjection.cpp.

References init_members().

GSkyProjection::GSkyProjection ( const GSkyProjection proj)

Copy constructor.

Parameters
[in]projSky projection.

Definition at line 73 of file GSkyProjection.cpp.

References copy_members(), and init_members().

GSkyProjection::~GSkyProjection ( void  )
virtual

Destructor.

Definition at line 89 of file GSkyProjection.cpp.

References free_members().

Member Function Documentation

virtual std::string GSkyProjection::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 GBase.

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

virtual void GSkyProjection::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 GBase.

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

virtual GSkyProjection* GSkyProjection::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 GBase.

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

Referenced by GSkyMap::copy_members(), and GSkyMap::projection().

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

Implemented in GWcs, and GHealpix.

Referenced by operator==().

std::string GSkyProjection::coordsys ( void  ) const
virtual

Returns coordinate system.

Returns
Coordinate system string.

Returns one of 'CEL' (celestial), 'GAL' (galactic),

Definition at line 147 of file GSkyProjection.cpp.

References m_coordsys.

Referenced by gammalib::com_wcs_mer2car(), GSkyMap::extract(), GHealpix::GHealpix(), GSkyMap::is_same(), GHealpix::print(), GHealpix::read(), GWcs::set_members(), GWcs::wcs_print(), and GHealpix::write().

void GSkyProjection::coordsys ( const std::string &  coordsys)
virtual

Set coordinate system.

Parameters
[in]coordsysCoordinate system
Exceptions
GException::invalid_argumentInvalid coordsys parameter.

Set coordinate system from std::string. The method recognizes the following codes: 'EQU', 'CEL', 'C': celestial, 'GAL', 'G': galactic,

Definition at line 181 of file GSkyProjection.cpp.

References G_COORDSYS_SET, m_coordsys, and gammalib::toupper().

void GSkyProjection::copy_members ( const GSkyProjection proj)
protected

Copy class members.

Parameters
[in]projSky projection.

Definition at line 229 of file GSkyProjection.cpp.

References m_coordsys.

Referenced by GSkyProjection(), and operator=().

virtual GSkyPixel GSkyProjection::dir2pix ( const GSkyDir dir) const
pure virtual

Implemented in GWcs, and GHealpix.

Referenced by GSkyMap::dir2inx(), and GSkyMap::dir2pix().

virtual std::string GSkyProjection::name ( void  ) const
pure virtual
GSkyProjection & GSkyProjection::operator= ( const GSkyProjection proj)
virtual

Assignment operator.

Parameters
[in]projSky projection.
Returns
Sky projection.

Definition at line 111 of file GSkyProjection.cpp.

References copy_members(), free_members(), and init_members().

Referenced by GHealpix::operator=(), and GWcs::operator=().

virtual GSkyDir GSkyProjection::pix2dir ( const GSkyPixel pixel) const
pure virtual

Implemented in GWcs, and GHealpix.

Referenced by GSkyMap::inx2dir(), and GSkyMap::pix2dir().

virtual std::string GSkyProjection::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 GBase.

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

Referenced by GLATEventCube::print(), and GSkyMap::print().

virtual void GSkyProjection::read ( const GFitsHDU hdu)
pure virtual

Implemented in GWcs, and GHealpix.

Referenced by GSkyMap::read_healpix(), and GSkyMap::read_wcs().

virtual int GSkyProjection::size ( void  ) const
pure virtual
virtual double GSkyProjection::solidangle ( const GSkyPixel pixel) const
pure virtual

Implemented in GWcs, and GHealpix.

Referenced by GSkyMap::solidangle().

virtual void GSkyProjection::write ( GFitsHDU hdu) const
pure virtual

Implemented in GWcs, and GHealpix.

Referenced by GSkyMap::create_healpix_hdu(), and GSkyMap::create_wcs_hdu().

Friends And Related Function Documentation

bool operator!= ( const GSkyProjection a,
const GSkyProjection b 
)
friend

Non-equality operator.

Parameters
[in]aFirst sky projection.
[in]bSecond sky projection.
Returns
True if a and b are not identical.

Definition at line 276 of file GSkyProjection.cpp.

bool operator== ( const GSkyProjection a,
const GSkyProjection b 
)
friend

Equality operator.

Parameters
[in]aFirst sky projection.
[in]bSecond sky projection.
Returns
True if a and b are identical.

Definition at line 262 of file GSkyProjection.cpp.

Member Data Documentation


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