GammaLib 2.0.0
Loading...
Searching...
No Matches
GCTAPointing Class Reference

CTA pointing class. More...

#include <GCTAPointing.hpp>

Inheritance diagram for GCTAPointing:
GBase

Public Member Functions

 GCTAPointing (void)
 Void constructor.
 
 GCTAPointing (const GSkyDir &dir)
 Sky direction constructor.
 
 GCTAPointing (const GXmlElement &xml)
 XML constructor.
 
 GCTAPointing (const GCTAPointing &pnt)
 Copy constructor.
 
virtual ~GCTAPointing (void)
 Destructor.
 
virtual GCTAPointingoperator= (const GCTAPointing &pnt)
 Assignment operator.
 
void clear (void)
 Clear CTA pointing.
 
GCTAPointingclone (void) const
 Clone CTA pointing.
 
std::string classname (void) const
 Return class name.
 
const bool & is_valid (void) const
 Checks if pointing is valid.
 
const GSkyDirdir (void) const
 Return pointing sky direction.
 
void dir (const GSkyDir &dir)
 Set pointing direction.
 
GCTAInstDir instdir (const GSkyDir &skydir) const
 Get instrument direction from sky direction.
 
GSkyDir skydir (const GCTAInstDir &instdir) const
 Get sky direction direction from instrument direction.
 
const GMatrixrot (void) const
 Return rotation matrix.
 
const double & zenith (void) const
 Return pointing zenith angle.
 
const double & azimuth (void) const
 Return pointing azimuth angle.
 
void zenith (const double &zenith)
 assign zenith angle
 
void azimuth (const double &azimuth)
 assign azimuth angle
 
void read (const GXmlElement &xml)
 Read pointing from XML element.
 
void write (GXmlElement &xml) const
 Write pointing information into XML element.
 
std::string print (const GChatter &chatter=NORMAL) const
 Print CTA pointing information.
 
- Public Member Functions inherited from GBase
virtual ~GBase (void)
 Destructor.
 

Protected Member Functions

void init_members (void)
 Initialise class members.
 
void copy_members (const GCTAPointing &pnt)
 Copy class members.
 
void free_members (void)
 Delete class members.
 
void update (void) const
 Update coordinate transformation cache.
 

Protected Attributes

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

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() [1/4]

GCTAPointing::GCTAPointing ( void )

Void constructor.

Definition at line 61 of file GCTAPointing.cpp.

References init_members().

Referenced by clone().

◆ GCTAPointing() [2/4]

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() [3/4]

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() [4/4]

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::~GCTAPointing ( void )
virtual

Destructor.

Definition at line 132 of file GCTAPointing.cpp.

References free_members().

Member Function Documentation

◆ azimuth() [1/2]

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.

◆ azimuth() [2/2]

◆ classname()

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.

◆ clear()

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().

◆ clone()

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().

◆ copy_members()

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=().

◆ dir() [1/2]

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.

◆ dir() [2/2]

◆ free_members()

void GCTAPointing::free_members ( void )
protected

Delete class members.

Definition at line 491 of file GCTAPointing.cpp.

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

◆ init_members()

void GCTAPointing::init_members ( void )
protected

Initialise class members.

Definition at line 449 of file GCTAPointing.cpp.

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

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

◆ instdir()

◆ is_valid()

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.

◆ operator=()

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().

◆ print()

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(), print(), and SILENT.

Referenced by print().

◆ read()

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().

◆ rot()

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().

◆ skydir()

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 GSkyDir::celvector(), GCTAInstDir::detx(), GCTAInstDir::dety(), instdir(), m_Rback, and update().

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

◆ update()

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().

◆ write()

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().

◆ zenith() [1/2]

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().

◆ zenith() [2/2]

Member Data Documentation

◆ m_azimuth

double GCTAPointing::m_azimuth
protected

Pointing azimuth angle (deg)

Definition at line 96 of file GCTAPointing.hpp.

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

◆ m_dir

GSkyDir GCTAPointing::m_dir
protected

Pointing direction in sky coordinates.

Definition at line 93 of file GCTAPointing.hpp.

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

◆ m_has_cache

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().

◆ m_Rback

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().

◆ m_valid

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().

◆ m_zenith

double GCTAPointing::m_zenith
protected

Pointing zenith angle (deg)

Definition at line 95 of file GCTAPointing.hpp.

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


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