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

CTA pointing class. More...

#include <GCTAPointing.hpp>

Inheritance diagram for GCTAPointing:
GBase

Public Member Functions

 GCTAPointing (void)
 Void constructor. More...
 
 GCTAPointing (const GSkyDir &dir)
 Sky direction constructor. More...
 
 GCTAPointing (const GXmlElement &xml)
 XML constructor. More...
 
 GCTAPointing (const GCTAPointing &pnt)
 Copy constructor. More...
 
virtual ~GCTAPointing (void)
 Destructor. More...
 
virtual GCTAPointingoperator= (const GCTAPointing &pnt)
 Assignment operator. More...
 
void clear (void)
 Clear CTA pointing. More...
 
GCTAPointingclone (void) const
 Clone CTA pointing. More...
 
std::string classname (void) const
 Return class name. More...
 
const bool & is_valid (void) const
 Checks if pointing is valid. More...
 
const GSkyDirdir (void) const
 Return pointing sky direction. More...
 
void dir (const GSkyDir &dir)
 Set pointing direction. More...
 
GCTAInstDir instdir (const GSkyDir &skydir) const
 Get instrument direction from sky direction. More...
 
GSkyDir skydir (const GCTAInstDir &instdir) const
 Get sky direction direction from instrument direction. More...
 
const GMatrixrot (void) const
 Return rotation matrix. More...
 
const double & zenith (void) const
 Return pointing zenith angle. More...
 
const double & azimuth (void) const
 Return pointing azimuth angle. More...
 
void zenith (const double &zenith)
 assign zenith angle More...
 
void azimuth (const double &azimuth)
 assign azimuth angle More...
 
void read (const GXmlElement &xml)
 Read pointing from XML element. More...
 
void write (GXmlElement &xml) const
 Write pointing information into XML element. More...
 
std::string print (const GChatter &chatter=NORMAL) const
 Print CTA pointing information. 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 GCTAPointing &pnt)
 Copy class members. More...
 
void free_members (void)
 Delete class members. More...
 
void update (void) const
 Update coordinate transformation cache. More...
 

Protected Attributes

GSkyDir m_dir
 Pointing direction in sky coordinates. More...
 
bool m_valid
 Validity flag. More...
 
double m_zenith
 Pointing zenith angle (deg) More...
 
double m_azimuth
 Pointing azimuth angle (deg) More...
 
bool m_has_cache
 Has transformation cache. More...
 
GMatrix m_Rback
 Rotation matrix. More...
 

Detailed Description

CTA pointing class.

This class implements a CTA pointing. For the time being it is assumed that the pointing direction is time-independent.

Todo:
No transformation from sky coordinates to geographic coordinates has so far been implemented. The azimuth and zenith angle are not meaningful.

Definition at line 54 of file GCTAPointing.hpp.

Constructor & Destructor Documentation

GCTAPointing::GCTAPointing ( void  )

Void constructor.

Definition at line 61 of file GCTAPointing.cpp.

References init_members().

Referenced by clone().

GCTAPointing::GCTAPointing ( const GSkyDir dir)
explicit

Sky direction constructor.

Parameters
[in]dirSky direction.

Construct CTA pointing from sky direction.

Definition at line 78 of file GCTAPointing.cpp.

References dir(), and init_members().

GCTAPointing::GCTAPointing ( const GXmlElement xml)
explicit

XML constructor.

Parameters
[in]xmlXML element.

Construct CTA pointing from XML element.

Definition at line 98 of file GCTAPointing.cpp.

References init_members(), and read().

GCTAPointing::GCTAPointing ( const GCTAPointing pnt)

Copy constructor.

Parameters
[in]pntCTA pointing.

Definition at line 116 of file GCTAPointing.cpp.

References copy_members(), and init_members().

GCTAPointing::~GCTAPointing ( void  )
virtual

Destructor.

Definition at line 132 of file GCTAPointing.cpp.

References free_members().

Member Function Documentation

void GCTAPointing::azimuth ( const double &  azimuth)
inline

assign azimuth angle

Parameters
[in]azimuthThe azimuth angle (deg).

Definition at line 169 of file GCTAPointing.hpp.

References azimuth(), and m_azimuth.

std::string GCTAPointing::classname ( void  ) const
inlinevirtual

Return class name.

Returns
String containing the class name ("GCTAPointing").

Implements GBase.

Definition at line 110 of file GCTAPointing.hpp.

void GCTAPointing::clear ( void  )
virtual

Clear CTA pointing.

Implements GBase.

Definition at line 184 of file GCTAPointing.cpp.

References free_members(), and init_members().

Referenced by GCTAEventCube::init_members(), GCTAEventList::init_members(), GCTAObservation::init_members(), and read().

GCTAPointing * GCTAPointing::clone ( void  ) const
virtual

Clone CTA pointing.

Returns
Poiter to deep copy of CTA pointing.

Implements GBase.

Definition at line 202 of file GCTAPointing.cpp.

References GCTAPointing().

void GCTAPointing::copy_members ( const GCTAPointing pnt)
protected

Copy class members.

Parameters
[in]pntCTA pointing.

Definition at line 471 of file GCTAPointing.cpp.

References m_azimuth, m_dir, m_has_cache, m_Rback, m_valid, and m_zenith.

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

void GCTAPointing::dir ( const GSkyDir dir)

Set pointing direction.

Parameters
[in]dirSky direction of pointing.

Set the pointing direction to the specified sky direction.

Definition at line 215 of file GCTAPointing.cpp.

References dir(), m_dir, m_has_cache, and m_valid.

void GCTAPointing::free_members ( void  )
protected

Delete class members.

Definition at line 491 of file GCTAPointing.cpp.

Referenced by clear(), operator=(), and ~GCTAPointing().

void GCTAPointing::init_members ( void  )
protected

Initialise class members.

Definition at line 449 of file GCTAPointing.cpp.

References GSkyDir::clear(), GMatrix::clear(), m_azimuth, m_dir, m_has_cache, m_Rback, m_valid, and m_zenith.

Referenced by clear(), GCTAPointing(), and operator=().

const bool & GCTAPointing::is_valid ( void  ) const
inline

Checks if pointing is valid.

Returns
True if pointing information is valid.

Definition at line 181 of file GCTAPointing.hpp.

References m_valid.

GCTAPointing & GCTAPointing::operator= ( const GCTAPointing pnt)
virtual

Assignment operator.

Parameters
[in]pntCTA pointing.
Returns
CTA pointing.

Definition at line 154 of file GCTAPointing.cpp.

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

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

Print CTA pointing information.

Parameters
[in]chatterChattiness.
Returns
String containing pointing information.

Implements GBase.

Definition at line 418 of file GCTAPointing.cpp.

References dir(), gammalib::parformat(), and SILENT.

void GCTAPointing::read ( const GXmlElement xml)

Read pointing from XML element.

Parameters
[in]xmlXML element.
Exceptions
GException::invalid_valueInvalid XML format encountered.

Read pointing parameter from an XML element. The format of the pointing parameter is

<parameter name="Pointing" ra="83.0" dec="22.1"/>

Definition at line 353 of file GCTAPointing.cpp.

References GXmlElement::attribute(), clear(), G_READ_XML, GXmlElement::has_attribute(), GSkyDir::lb_deg(), m_dir, m_valid, GSkyDir::radec_deg(), gammalib::todouble(), and gammalib::xml_get_par().

Referenced by GCTAPointing(), and GCTAObservation::read().

const GMatrix & GCTAPointing::rot ( void  ) const

Return rotation matrix.

Returns
Rotation matrix.

Definition at line 329 of file GCTAPointing.cpp.

References m_Rback, and update().

GSkyDir GCTAPointing::skydir ( const GCTAInstDir instdir) const

Get sky direction direction from instrument direction.

Parameters
[in]instdirInstrument direction.
Returns
Sky direction.

Returns sky direction as function of an instrument direction

Definition at line 293 of file GCTAPointing.cpp.

References gammalib::atan2(), GSkyDir::celvector(), cos(), GCTAInstDir::detx(), GCTAInstDir::dety(), m_Rback, sin(), sqrt(), and update().

Referenced by GCTAModelIrfBackground::mc(), and GCTAModelRadialAcceptance::mc().

void GCTAPointing::update ( void  ) const
protected

Update coordinate transformation cache.

Definition at line 501 of file GCTAPointing.cpp.

References GSkyDir::dec_deg(), GMatrix::eulery(), GMatrix::eulerz(), m_dir, m_has_cache, m_Rback, and GSkyDir::ra_deg().

Referenced by instdir(), rot(), and skydir().

void GCTAPointing::write ( GXmlElement xml) const

Write pointing information into XML element.

Parameters
[in]xmlXML element.

Writes pointing parameter into an XML element. The format of the pointing parameter is

<parameter name="Pointing" ra="83.0" dec="22.1"/>

Definition at line 398 of file GCTAPointing.cpp.

References GXmlElement::attribute(), GSkyDir::dec_deg(), G_WRITE_XML, m_dir, GSkyDir::ra_deg(), gammalib::str(), and gammalib::xml_need_par().

Referenced by GCTAObservation::write().

void GCTAPointing::zenith ( const double &  zenith)
inline

assign zenith angle

Parameters
[in]zenithThe zenith angle (deg).

Definition at line 157 of file GCTAPointing.hpp.

References m_zenith, and zenith().

Member Data Documentation

double GCTAPointing::m_azimuth
protected

Pointing azimuth angle (deg)

Definition at line 96 of file GCTAPointing.hpp.

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

GSkyDir GCTAPointing::m_dir
protected

Pointing direction in sky coordinates.

Definition at line 93 of file GCTAPointing.hpp.

Referenced by copy_members(), dir(), init_members(), instdir(), read(), update(), and write().

bool GCTAPointing::m_has_cache
mutableprotected

Has transformation cache.

Definition at line 99 of file GCTAPointing.hpp.

Referenced by copy_members(), dir(), init_members(), and update().

GMatrix GCTAPointing::m_Rback
mutableprotected

Rotation matrix.

Definition at line 100 of file GCTAPointing.hpp.

Referenced by copy_members(), init_members(), instdir(), rot(), skydir(), and update().

bool GCTAPointing::m_valid
protected

Validity flag.

Definition at line 94 of file GCTAPointing.hpp.

Referenced by copy_members(), dir(), init_members(), is_valid(), and read().

double GCTAPointing::m_zenith
protected

Pointing zenith angle (deg)

Definition at line 95 of file GCTAPointing.hpp.

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


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