40#define G_READ_XML "GCTAPointing::read(GXmlElement&)"
41#define G_WRITE_XML "GCTAPointing::write(GXmlElement&)"
241 #if defined(G_USE_VECTORS)
256 double theta = std::acos(inst[2]);
260 double phi = std::asin(inst[1] / std::sin(theta));
261 detx = theta * std::cos(phi);
262 dety = theta * std::sin(phi);
270 detx = theta * std::cos(phi);
271 dety = theta * std::sin(phi);
277 inst_direction.
detx(detx);
278 inst_direction.
dety(dety);
281 return inst_direction;
303 double theta = std::sqrt(inst_x * inst_x + inst_y * inst_y);
304 double phi = std::atan2(inst_y, inst_x);
305 double sin_phi = std::sin(phi);
306 double cos_phi = std::cos(phi);
307 double sin_theta = std::sin(theta);
308 double cos_theta = std::cos(theta);
311 GVector native(-cos_phi*sin_theta, sin_phi*sin_theta, cos_theta);
373 std::string msg =
"Attributes \"ra\" and \"dec\" or \"lon\" and"
374 " \"lat\"not found in XML parameter \"Pointing\"."
375 " Please verify the XML format.";
427 result.append(
"=== GCTAPointing ===");
513 m_Rback = (Ry * Rz).transpose();
CTA instrument direction class interface definition.
CTA pointing class interface definition.
Filename class interface definition.
Generic matrix class definition.
Sky direction class interface definition.
XML element node class interface definition.
CTA instrument direction class.
void dety(const double &y)
Set DETY coordinate (in radians)
void detx(const double &x)
Set DETX coordinate (in radians)
virtual ~GCTAPointing(void)
Destructor.
void free_members(void)
Delete class members.
double m_zenith
Pointing zenith angle (deg)
GSkyDir m_dir
Pointing direction in sky coordinates.
std::string print(const GChatter &chatter=NORMAL) const
Print CTA pointing information.
const GMatrix & rot(void) const
Return rotation matrix.
void read(const GXmlElement &xml)
Read pointing from XML element.
GCTAInstDir instdir(const GSkyDir &skydir) const
Get instrument direction from sky direction.
bool m_has_cache
Has transformation cache.
double m_azimuth
Pointing azimuth angle (deg)
const GSkyDir & dir(void) const
Return pointing sky direction.
void update(void) const
Update coordinate transformation cache.
GCTAPointing * clone(void) const
Clone CTA pointing.
GCTAPointing(void)
Void constructor.
bool m_valid
Validity flag.
virtual GCTAPointing & operator=(const GCTAPointing &pnt)
Assignment operator.
void copy_members(const GCTAPointing &pnt)
Copy class members.
GSkyDir skydir(const GCTAInstDir &instdir) const
Get sky direction direction from instrument direction.
void clear(void)
Clear CTA pointing.
void init_members(void)
Initialise class members.
GMatrix m_Rback
Rotation matrix.
void write(GXmlElement &xml) const
Write pointing information into XML element.
Generic matrix class definition.
GMatrix transpose(void) const
Return transposed matrix.
void eulerz(const double &angle)
Set Euler rotation matrix around z axis.
void eulery(const double &angle)
Set Euler rotation matrix around y axis.
virtual void clear(void)
Clear matrix.
void lb_deg(const double &l, const double &b)
Set galactic sky direction (degrees)
double dec_deg(void) const
Returns Declination in degrees.
double ra_deg(void) const
Returns Right Ascension in degrees.
void radec_deg(const double &ra, const double &dec)
Set equatorial sky direction (degrees)
void clear(void)
Clear sky direction.
double dist(const GSkyDir &dir) const
Compute angular distance between sky directions in radians.
void celvector(const GVector &vector)
Set sky direction from 3D vector in celestial coordinates.
double posang(const GSkyDir &dir, const std::string &coordsys="CEL") const
Compute position angle between sky directions in radians.
const GXmlAttribute * attribute(const int &index) const
Return attribute.
bool has_attribute(const std::string &name) const
Check if element has a given attribute.
std::string parformat(const std::string &s, const int &indent=0)
Convert string in parameter format.
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.
const GXmlElement * xml_get_par(const std::string &origin, const GXmlElement &xml, const std::string &name)
Return pointer to parameter with given name in XML element.
double todouble(const std::string &arg)
Convert string into double precision value.
GXmlElement * xml_need_par(const std::string &origin, GXmlElement &xml, const std::string &name)
Return pointer to parameter with given name in XML element.