Commit 96e3bdf77e9a711b66d8b3f9dcb321550759628b
1 parent
cb9c2eb4
Extract EHORA information from OAD files
Showing
5 changed files
with
48 additions
and
5 deletions
inst/com/include/GCOMOad.hpp
1 | 1 | /*************************************************************************** |
2 | 2 | * GCOMOad.hpp - COMPTEL Orbit Aspect Data class * |
3 | 3 | * ----------------------------------------------------------------------- * |
4 | - * copyright (C) 2017-2022 by Juergen Knodlseder * | |
4 | + * copyright (C) 2017-2023 by Juergen Knodlseder * | |
5 | 5 | * ----------------------------------------------------------------------- * |
6 | 6 | * * |
7 | 7 | * This program is free software: you can redistribute it and/or modify * |
... | ... | @@ -78,6 +78,8 @@ public: |
78 | 78 | void gcel(const float& gcel); |
79 | 79 | const float& georad(void) const; |
80 | 80 | void georad(const float& georad); |
81 | + const float& ehora(void) const; | |
82 | + void ehora(const float& ehora); | |
81 | 83 | const GSkyDir& zaxis(void) const; |
82 | 84 | void zaxis(const GSkyDir& zaxis); |
83 | 85 | const GSkyDir& xaxis(void) const; |
... | ... | @@ -103,6 +105,7 @@ protected: |
103 | 105 | float m_gcaz; //!< Geocentre azimuth angle (deg) |
104 | 106 | float m_gcel; //!< Geocentre zenith angle (deg) |
105 | 107 | float m_georad; //!< Apparent radius of Earth (deg) |
108 | + float m_ehora; //!< Earth Horizon Angle of telescope pointing (deg) | |
106 | 109 | GVector m_pos; //!< Position vector (km) |
107 | 110 | |
108 | 111 | // Precomputation cache |
... | ... | @@ -328,6 +331,35 @@ void GCOMOad::georad(const float& georad) |
328 | 331 | |
329 | 332 | |
330 | 333 | /***********************************************************************//** |
334 | + * @brief Return Earth Horizon Angle of telescope pointing axis | |
335 | + * | |
336 | + * @return Earth Horizon Angle of telescope pointing axis (deg). | |
337 | + * | |
338 | + * Returns the Earth Horizon Angle of telescope pointing axis in degrees. | |
339 | + ***************************************************************************/ | |
340 | +inline | |
341 | +const float& GCOMOad::ehora(void) const | |
342 | +{ | |
343 | + return (m_ehora); | |
344 | +} | |
345 | + | |
346 | + | |
347 | +/***********************************************************************//** | |
348 | + * @brief Set Earth Horizon Angle of telescope pointing axis | |
349 | + * | |
350 | + * @param[in] ehora Earth Horizon Angle of telescope pointing axis (deg). | |
351 | + * | |
352 | + * Set the Earth Horizon Angle of telescope pointing axis. | |
353 | + ***************************************************************************/ | |
354 | +inline | |
355 | +void GCOMOad::ehora(const float& ehora) | |
356 | +{ | |
357 | + m_ehora = ehora; | |
358 | + return; | |
359 | +} | |
360 | + | |
361 | + | |
362 | +/***********************************************************************//** | |
331 | 363 | * @brief Return telescope Z-axis |
332 | 364 | * |
333 | 365 | * @return Telescope Z-axis. | ... | ... |
inst/com/pyext/GCOMOad.i
1 | 1 | /*************************************************************************** |
2 | 2 | * GCOMOad.i - COMPTEL Orbit Aspect Data class * |
3 | 3 | * ----------------------------------------------------------------------- * |
4 | - * copyright (C) 2017-2022 by Juergen Knodlseder * | |
4 | + * copyright (C) 2017-2023 by Juergen Knodlseder * | |
5 | 5 | * ----------------------------------------------------------------------- * |
6 | 6 | * * |
7 | 7 | * This program is free software: you can redistribute it and/or modify * |
... | ... | @@ -62,6 +62,8 @@ public: |
62 | 62 | void gcel(const float& gcel); |
63 | 63 | const float& georad(void) const; |
64 | 64 | void georad(const float& georad); |
65 | + const float& ehora(void) const; | |
66 | + void ehora(const float& ehora); | |
65 | 67 | const GSkyDir& zaxis(void) const; |
66 | 68 | void zaxis(const GSkyDir& zaxis); |
67 | 69 | const GSkyDir& xaxis(void) const; |
... | ... | @@ -84,7 +86,7 @@ public: |
84 | 86 | def __getstate__(self): |
85 | 87 | state = (self.tstart(), self.tstop(), self.zaxis(), self.xaxis(), |
86 | 88 | self.tjd(), self.tics(), self.gcaz(), self.gcel(), |
87 | - self.pos(), self.georad()) | |
89 | + self.pos(), self.georad(), self.ehora()) | |
88 | 90 | return state |
89 | 91 | def __setstate__(self, state): |
90 | 92 | self.__init__() |
... | ... | @@ -98,5 +100,6 @@ public: |
98 | 100 | self.gcel(state[7]) |
99 | 101 | self.pos(state[8]) |
100 | 102 | self.georad(state[9]) |
103 | + self.ehora(state[10]) | |
101 | 104 | } |
102 | 105 | }; | ... | ... |
inst/com/src/GCOMOad.cpp
1 | 1 | /*************************************************************************** |
2 | 2 | * GCOMOad.cpp - COMPTEL Orbit Aspect Data class * |
3 | 3 | * ----------------------------------------------------------------------- * |
4 | - * copyright (C) 2017-2022 by Juergen Knodlseder * | |
4 | + * copyright (C) 2017-2023 by Juergen Knodlseder * | |
5 | 5 | * ----------------------------------------------------------------------- * |
6 | 6 | * * |
7 | 7 | * This program is free software: you can redistribute it and/or modify * |
... | ... | @@ -217,6 +217,7 @@ void GCOMOad::init_members(void) |
217 | 217 | m_gcaz = 0.0; |
218 | 218 | m_gcel = 0.0; |
219 | 219 | m_georad = 0.0; |
220 | + m_ehora = 0.0; | |
220 | 221 | m_pos = GVector(3); |
221 | 222 | m_posang = 1.0e30; |
222 | 223 | |
... | ... | @@ -242,6 +243,7 @@ void GCOMOad::copy_members(const GCOMOad& oad) |
242 | 243 | m_gcaz = oad.m_gcaz; |
243 | 244 | m_gcel = oad.m_gcel; |
244 | 245 | m_georad = oad.m_georad; |
246 | + m_ehora = oad.m_ehora; | |
245 | 247 | m_pos = oad.m_pos; |
246 | 248 | m_posang = oad.m_posang; |
247 | 249 | ... | ... |
inst/com/src/GCOMOads.cpp
1 | 1 | /*************************************************************************** |
2 | 2 | * GCOMOads.cpp - COMPTEL Orbit Aspect Data container class * |
3 | 3 | * ----------------------------------------------------------------------- * |
4 | - * copyright (C) 2017-2021 by Juergen Knodlseder * | |
4 | + * copyright (C) 2017-2023 by Juergen Knodlseder * | |
5 | 5 | * ----------------------------------------------------------------------- * |
6 | 6 | * * |
7 | 7 | * This program is free software: you can redistribute it and/or modify * |
... | ... | @@ -418,6 +418,7 @@ void GCOMOads::read(const GFitsTable& table) |
418 | 418 | const GFitsTableCol* ptr_zdecl = table["ZDECL"]; // rad |
419 | 419 | const GFitsTableCol* ptr_xrasc = table["XRASC"]; // rad |
420 | 420 | const GFitsTableCol* ptr_xdecl = table["XDECL"]; // rad |
421 | + const GFitsTableCol* ptr_ehora = table["EHORA"]; // rad | |
421 | 422 | |
422 | 423 | // Initialise Earth radius angle |
423 | 424 | double georad = 73.5; |
... | ... | @@ -475,6 +476,9 @@ void GCOMOads::read(const GFitsTable& table) |
475 | 476 | #endif |
476 | 477 | oad.georad(georad); |
477 | 478 | |
479 | + // Set Earth Horizon Angle in deg | |
480 | + oad.ehora(ptr_ehora->real(i) * gammalib::rad2deg); | |
481 | + | |
478 | 482 | // Append record |
479 | 483 | m_oads.push_back(oad); |
480 | 484 | ... | ... |
inst/com/test/test_COM.cpp
... | ... | @@ -217,6 +217,7 @@ void TestGCOM::test_oad_class(void) |
217 | 217 | oad.gcaz(123.45); |
218 | 218 | oad.gcel(67.89); |
219 | 219 | oad.georad(76.54); |
220 | + oad.ehora(31.57); | |
220 | 221 | |
221 | 222 | // Check object |
222 | 223 | test_value(oad.tstart().secs(), gammalib::com_time(8392, 624010000).secs(), |
... | ... | @@ -228,6 +229,7 @@ void TestGCOM::test_oad_class(void) |
228 | 229 | test_value(oad.gcaz(), 123.45, "Check gcaz"); |
229 | 230 | test_value(oad.gcel(), 67.89, "Check gcel"); |
230 | 231 | test_value(oad.georad(), 76.54, "Check georad"); |
232 | + test_value(oad.ehora(), 31.57, "Check ehora"); | |
231 | 233 | |
232 | 234 | // Return |
233 | 235 | return; | ... | ... |