GammaLib
2.0.0
|
CTA pointing class. More...
#include <GCTAPointing.hpp>
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 GCTAPointing & | operator= (const GCTAPointing &pnt) |
Assignment operator. More... | |
void | clear (void) |
Clear CTA pointing. More... | |
GCTAPointing * | clone (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 GSkyDir & | dir (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 GMatrix & | rot (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... | |
CTA pointing class.
This class implements a CTA pointing. For the time being it is assumed that the pointing direction is time-independent.
Definition at line 54 of file GCTAPointing.hpp.
GCTAPointing::GCTAPointing | ( | void | ) |
Void constructor.
Definition at line 61 of file GCTAPointing.cpp.
References init_members().
Referenced by clone().
|
explicit |
Sky direction constructor.
[in] | dir | Sky direction. |
Construct CTA pointing from sky direction.
Definition at line 78 of file GCTAPointing.cpp.
References dir(), and init_members().
|
explicit |
XML constructor.
[in] | xml | XML 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.
[in] | pnt | CTA pointing. |
Definition at line 116 of file GCTAPointing.cpp.
References copy_members(), and init_members().
|
virtual |
|
inline |
Return pointing azimuth angle.
Definition at line 146 of file GCTAPointing.hpp.
References m_azimuth.
Referenced by azimuth(), GCTAOnOffObservation::compute_arf_cut(), GCTAOnOffObservation::compute_rmf(), GCTAModelAeffBackground::eval(), GCTAResponseIrf::irf(), GCTAResponseIrf::irf_diffuse(), GCTAResponseIrf::irf_elliptical(), GCTAResponseIrf::irf_radial(), GCTAModelAeffBackground::mc(), GCTAResponseIrf::mc(), GCTAResponseIrf::nirf(), GCTAResponseIrf::npsf(), GCTAResponseIrf::nroi_diffuse(), GCTAResponseIrf::nroi_elliptical(), GCTAResponseIrf::nroi_radial(), GCTAObservation::read_attributes(), and GCTAObservation::write_attributes().
|
inline |
assign azimuth angle
[in] | azimuth | The azimuth angle (deg). |
Definition at line 169 of file GCTAPointing.hpp.
|
inlinevirtual |
Return class name.
Implements GBase.
Definition at line 110 of file GCTAPointing.hpp.
|
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().
|
virtual |
Clone CTA pointing.
Implements GBase.
Definition at line 202 of file GCTAPointing.cpp.
References GCTAPointing().
|
protected |
Copy class members.
[in] | pnt | CTA 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=().
|
inline |
Return pointing sky direction.
Definition at line 122 of file GCTAPointing.hpp.
References m_dir.
Referenced by GCTAOnOffObservation::compute_arf_cut(), GCTAOnOffObservation::compute_rmf(), dir(), GCTAModelRadialAcceptance::eval(), GCTAPointing(), GCTAResponseIrf::irf(), GCTAResponseIrf::irf_diffuse(), GCTAResponseIrf::irf_elliptical(), GCTAResponseIrf::irf_radial(), GCTAModelAeffBackground::mc(), GCTAModelRadialAcceptance::mc(), GCTAResponseIrf::mc(), GCTAResponseIrf::nirf(), GCTAModelRadialAcceptance::npred(), GCTAResponseIrf::npsf(), print(), GCTAEventCube::print(), GCTAEventList::read(), GCTAObservation::read_attributes(), GCTAEventCube::read_cntmap(), GCTAEventList::write(), and GCTAObservation::write_attributes().
void GCTAPointing::dir | ( | const GSkyDir & | dir | ) |
Set pointing direction.
[in] | dir | Sky 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.
|
protected |
Delete class members.
Definition at line 491 of file GCTAPointing.cpp.
Referenced by clear(), operator=(), and ~GCTAPointing().
|
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=().
GCTAInstDir GCTAPointing::instdir | ( | const GSkyDir & | skydir | ) | const |
Get instrument direction from sky direction.
[in] | skydir | Sky direction. |
Returns instrument direction as function of a sky direction
Definition at line 239 of file GCTAPointing.cpp.
References gammalib::acos(), asin(), GSkyDir::celvector(), cos(), GCTAInstDir::detx(), GCTAInstDir::dety(), GSkyDir::dist(), m_dir, m_Rback, GSkyDir::posang(), sin(), GMatrix::transpose(), and update().
Referenced by GCTAModelAeffBackground::aeff_integral(), GCTAOnOffObservation::compute_alpha(), GCTAOnOffObservation::compute_bgd(), GCTAModelIrfBackground::eval(), GCTAModelAeffBackground::eval(), GCTAModelAeffBackground::mc(), GCTAResponseIrf::mc(), GCTAModelIrfBackground::npred(), GCTAModelSpatial::npred(), gammalib::read_ds_roi(), GCTAEventList::read_events(), and GCTAEventCube::set_detxy().
|
inline |
Checks if pointing is valid.
Definition at line 181 of file GCTAPointing.hpp.
References m_valid.
|
virtual |
Assignment operator.
[in] | pnt | CTA pointing. |
Definition at line 154 of file GCTAPointing.cpp.
References copy_members(), free_members(), and init_members().
Print CTA pointing information.
[in] | chatter | Chattiness. |
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.
[in] | xml | XML element. |
GException::invalid_value | Invalid 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 |
GSkyDir GCTAPointing::skydir | ( | const GCTAInstDir & | instdir | ) | const |
Get sky direction direction from instrument direction.
[in] | instdir | Instrument 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().
|
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().
void GCTAPointing::write | ( | GXmlElement & | xml | ) | const |
Write pointing information into XML element.
[in] | xml | XML 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().
|
inline |
Return pointing zenith angle.
Definition at line 134 of file GCTAPointing.hpp.
References m_zenith.
Referenced by GCTAOnOffObservation::compute_arf_cut(), GCTAOnOffObservation::compute_rmf(), GCTAModelAeffBackground::eval(), GCTAResponseIrf::irf(), GCTAResponseIrf::irf_diffuse(), GCTAResponseIrf::irf_elliptical(), GCTAResponseIrf::irf_radial(), GCTAModelAeffBackground::mc(), GCTAResponseIrf::mc(), GCTAResponseIrf::nirf(), GCTAResponseIrf::npsf(), GCTAResponseIrf::nroi_diffuse(), GCTAResponseIrf::nroi_elliptical(), GCTAResponseIrf::nroi_radial(), GCTAObservation::read_attributes(), GCTAObservation::write_attributes(), and zenith().
|
inline |
assign zenith angle
[in] | zenith | The zenith angle (deg). |
Definition at line 157 of file GCTAPointing.hpp.
|
protected |
Pointing azimuth angle (deg)
Definition at line 96 of file GCTAPointing.hpp.
Referenced by azimuth(), copy_members(), and init_members().
|
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().
|
mutableprotected |
Has transformation cache.
Definition at line 99 of file GCTAPointing.hpp.
Referenced by copy_members(), dir(), init_members(), and update().
|
mutableprotected |
Rotation matrix.
Definition at line 100 of file GCTAPointing.hpp.
Referenced by copy_members(), init_members(), instdir(), rot(), skydir(), and update().
|
protected |
Validity flag.
Definition at line 94 of file GCTAPointing.hpp.
Referenced by copy_members(), dir(), init_members(), is_valid(), and read().
|
protected |
Pointing zenith angle (deg)
Definition at line 95 of file GCTAPointing.hpp.
Referenced by copy_members(), init_members(), and zenith().