GammaLib  2.1.0.dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GCOMHkds.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  * GCOMHkds.cpp - COMPTEL Housekeeping Data collection class *
3  * ----------------------------------------------------------------------- *
4  * copyright (C) 2023 by Juergen Knodlseder *
5  * ----------------------------------------------------------------------- *
6  * *
7  * This program is free software: you can redistribute it and/or modify *
8  * it under the terms of the GNU General Public License as published by *
9  * the Free Software Foundation, either version 3 of the License, or *
10  * (at your option) any later version. *
11  * *
12  * This program is distributed in the hope that it will be useful, *
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15  * GNU General Public License for more details. *
16  * *
17  * You should have received a copy of the GNU General Public License *
18  * along with this program. If not, see <http://www.gnu.org/licenses/>. *
19  * *
20  ***************************************************************************/
21 /**
22  * @file GCOMHkds.hpp
23  * @brief COMPTEL Housekeeping Data collection class implementation
24  * @author Juergen Knodlseder
25  */
26 
27 /* __ Includes ___________________________________________________________ */
28 #ifdef HAVE_CONFIG_H
29 #include <config.h>
30 #endif
31 #include "GException.hpp"
32 #include "GMath.hpp"
33 #include "GFits.hpp"
34 #include "GFitsTable.hpp"
35 #include "GCOMTools.hpp"
36 #include "GCOMSupport.hpp"
37 #include "GCOMHkds.hpp"
38 
39 /* __ Method name definitions ____________________________________________ */
40 #define G_ACCESS "GCOMHkds::operator[](std::string&)"
41 #define G_AT "GCOMHkds::at(int&)"
42 #define G_SET1 "GCOMHkds::set(int&, GCOMHkd&)"
43 #define G_SET2 "GCOMHkds::set(std::string&, GCOMHkd&)"
44 #define G_INSERT "GCOMHkds::insert(int&, GCOMHkd&)"
45 #define G_REMOVE "GCOMHkds::remove(int&)"
46 #define G_READ "GCOMHkds::read(GFitsTable&)"
47 
48 /* __ Macros _____________________________________________________________ */
49 
50 /* __ Coding definitions _________________________________________________ */
51 
52 /* __ Debug definitions __________________________________________________ */
53 
54 
55 /*==========================================================================
56  = =
57  = Constructors/destructors =
58  = =
59  ==========================================================================*/
60 
61 /***********************************************************************//**
62  * @brief Void constructor
63  *
64  * Constructs an empty Housekeeping Data collection.
65  ***************************************************************************/
67 {
68  // Initialise class members
69  init_members();
70 
71  // Return
72  return;
73 }
74 
75 
76 /***********************************************************************//**
77  * @brief Filename constructor
78  *
79  * @param[in] filename Housekeeping Data FITS file.
80  *
81  * Constructs a Housekeeping Data collection from a HKD FITS file.
82  ***************************************************************************/
83 GCOMHkds::GCOMHkds(const GFilename& filename)
84 {
85  // Initialise class members
86  init_members();
87 
88  // Load data
89  load(filename);
90 
91  // Return
92  return;
93 }
94 
95 
96 /***********************************************************************//**
97  * @brief Copy constructor
98  *
99  * @param[in] hkds Housekeeping Data collection.
100  ***************************************************************************/
102 {
103  // Initialise class members
104  init_members();
105 
106  // Copy members
107  copy_members(hkds);
108 
109  // Return
110  return;
111 }
112 
113 
114 /***********************************************************************//**
115  * @brief Destructor
116  ***************************************************************************/
118 {
119  // Free members
120  free_members();
121 
122  // Return
123  return;
124 }
125 
126 
127 /*==========================================================================
128  = =
129  = Operators =
130  = =
131  ==========================================================================*/
132 
133 /***********************************************************************//**
134  * @brief Assignment operator
135  *
136  * @param[in] hkds Housekeeping Data collection.
137  * @return Housekeeping Data collection.
138  ***************************************************************************/
140 {
141  // Execute only if object is not identical
142  if (this != &hkds) {
143 
144  // Free members
145  free_members();
146 
147  // Initialise private members
148  init_members();
149 
150  // Copy members
151  copy_members(hkds);
152 
153  } // endif: object was not identical
154 
155  // Return this object
156  return *this;
157 }
158 
159 
160 /***********************************************************************//**
161  * @brief Return reference to Housekeeping Data container
162  *
163  * @param[in] name Housekeeping parameter name.
164  * @return Reference to Housekeeping Data container.
165  *
166  * @exception GException::invalid_argument
167  * Housekeeping parameter with specified @p name not found in
168  * collection.
169  *
170  * Returns a reference to the Housekeeping Data container with the specified
171  * @p name. An exception is thrown if the specified @p name is not found
172  * in the collection.
173  ***************************************************************************/
174 GCOMHkd& GCOMHkds::operator[](const std::string& name)
175 {
176  // Get model index
177  int index = get_index(name);
178 
179  // Throw exception if model name was not found
180  if (index == -1) {
181  std::string msg = "Housekeeping parameter \""+name+"\" not found in "
182  "Housekeeping Data collection. Please specify a "
183  "valid housekeeping parameter name.";
185  }
186 
187  // Return reference
188  return m_hkds[index];
189 }
190 
191 
192 /***********************************************************************//**
193  * @brief Return reference to Housekeeping Data container (const version)
194  *
195  * @param[in] name Housekeeping parameter name.
196  * @return Reference to Housekeeping Data container.
197  *
198  * @exception GException::invalid_argument
199  * Housekeeping parameter with specified @p name not found in
200  * collection.
201  *
202  * Returns a reference to the Housekeeping Data container with the specified
203  * @p name. An exception is thrown if the specified @p name is not found
204  * in the collection.
205  ***************************************************************************/
206 const GCOMHkd& GCOMHkds::operator[](const std::string& name) const
207 {
208  // Get model index
209  int index = get_index(name);
210 
211  // Throw exception if model name was not found
212  if (index == -1) {
213  std::string msg = "Housekeeping parameter \""+name+"\" not found in "
214  "Housekeeping Data collection. Please specify a "
215  "valid housekeeping parameter name.";
217  }
218 
219  // Return reference
220  return m_hkds[index];
221 }
222 
223 
224 /*==========================================================================
225  = =
226  = Public methods =
227  = =
228  ==========================================================================*/
229 
230 /***********************************************************************//**
231  * @brief Clear Housekeeping Data collection
232  ***************************************************************************/
233 void GCOMHkds::clear(void)
234 {
235  // Free members
236  free_members();
237 
238  // Initialise private members
239  init_members();
240 
241  // Return
242  return;
243 }
244 
245 
246 /***********************************************************************//**
247  * @brief Clone Housekeeping Data collection
248  *
249  * @return Pointer to deep copy of Housekeeping Data collection.
250  ***************************************************************************/
252 {
253  return new GCOMHkds(*this);
254 }
255 
256 
257 /***********************************************************************//**
258  * @brief Return reference to Housekeeping Data container
259  *
260  * @param[in] index Housekeeping Data index [0,...,size()-1].
261  * @return Reference to Housekeeping Data container.
262  *
263  * @exception GException::out_of_range
264  * Housekeeping Data container @p index is out of range.
265  *
266  * Returns a reference to the Housekeeping Data container with the specified
267  * @p index.
268  ***************************************************************************/
269 GCOMHkd& GCOMHkds::at(const int& index)
270 {
271  // Raise exception if index is out of range
272  if (index < 0 || index >= size()) {
273  std::string msg = "Housekeeping Data container index";
274  throw GException::out_of_range(G_AT, msg, index, size());
275  }
276 
277  // Return reference
278  return m_hkds[index];
279 }
280 
281 
282 /***********************************************************************//**
283  * @brief Return reference to Housekeeping Data container (const version)
284  *
285  * @param[in] index Housekeeping Data index [0,...,size()-1].
286  * @return Reference to Housekeeping Data container.
287  *
288  * @exception GException::out_of_range
289  * Housekeeping Data container @p index is out of range.
290  *
291  * Returns a reference to the Housekeeping Data container with the specified
292  * @p index.
293  ***************************************************************************/
294 const GCOMHkd& GCOMHkds::at(const int& index) const
295 {
296  // Raise exception if index is out of range
297  if (index < 0 || index >= size()) {
298  std::string msg = "Housekeeping Data container index";
299  throw GException::out_of_range(G_AT, msg, index, size());
300  }
301 
302  // Return reference
303  return m_hkds[index];
304 }
305 
306 
307 /***********************************************************************//**
308  * @brief Set Housekeeping Data container in collection
309  *
310  * @param[in] index Housekeeping Data container index [0,...,size()[.
311  * @param[in] hkd Housekeeping Data container.
312  * @return Reference to deep copy of Housekeeping Data container.
313  *
314  * @exception GException::out_of_range
315  * Housekeeping Data container @p index is out of range.
316  * @exception GException::invalid_value
317  * Housekeeping parameter exists already in collection at other
318  * index.
319  *
320  * Set Housekeeping Data container in the collection. Note that each
321  * housekeeping parameter can only exist once in an collection, hence an
322  * exception will be thrown if the same housekeeping parameter exists already
323  * at another index. A deep copy of the Housekeeping Data container will be
324  * made.
325  ***************************************************************************/
326 GCOMHkd& GCOMHkds::set(const int& index, const GCOMHkd& hkd)
327 {
328  // Compile option: raise exception if index is out of range
329  #if defined(G_RANGE_CHECK)
330  if (index < 0 || index >= size()) {
331  std::string msg = "Housekeeping Data container index";
332  throw GException::out_of_range(G_SET1, msg, index, size());
333  }
334  #endif
335 
336  // Check if a container with specified name does not yet exist
337  int inx = get_index(hkd.name());
338  if (inx != -1 && inx != index) {
339  std::string msg =
340  "Attempt to set Housekeeping Data container with name \""+
341  hkd.name()+"\" in collection at index "+gammalib::str(index)+
342  ", but a Housekeeping Data container with the same name exists "
343  "already at index "+gammalib::str(inx)+" in the collection. "
344  "Every Housekeeping Data container in the collection needs a "
345  "unique name.";
346  throw GException::invalid_value(G_SET1, msg);
347  }
348 
349  // Assign Housekeeping Data container
350  m_hkds[index] = hkd;
351 
352  // Return reference to Housekeeping Data container
353  return m_hkds[index];
354 }
355 
356 
357 /***********************************************************************//**
358  * @brief Set Housekeeping Data container in collection
359  *
360  * @param[in] name Housekeeping parameter name.
361  * @param[in] hkd Housekeeping Data container.
362  * @return Reference to deep copy of Housekeeping Data container.
363  *
364  * @exception GException::invalid_argument
365  * Housekeeping parameter with specified @p name not found in
366  * collection.
367  * @exception GException::invalid_value
368  * Name of Housekeeping parameter exists already in collection.
369  *
370  * Set Housekeeping Data container in the collection replacing the container
371  * with the specified Housekeeping parameter @p name. Note that each
372  * housekeeping parameter can only exist once in an collection, hence an
373  * exception will be thrown if the same housekeeping parameter exists already
374  * at another index. A deep copy of the Housekeeping Data container will be
375  * made.
376  ***************************************************************************/
377 GCOMHkd& GCOMHkds::set(const std::string& name, const GCOMHkd& hkd)
378 {
379  // Get parameter index
380  int index = get_index(name);
381 
382  // Throw exception if parameter name was not found
383  if (index == -1) {
384  std::string msg = "Housekeeping parameter \""+name+"\" not found in "
385  "Housekeeping Data collection. Please specify a "
386  "Housekeeping parameter name that exists in the "
387  "collection.";
389  }
390 
391  // Check if a container with specified name does not yet exist
392  int inx = get_index(hkd.name());
393  if (inx != -1 && inx != index) {
394  std::string msg =
395  "Attempt to set Housekeeping Data container with name \""+
396  hkd.name()+"\" in collection at index "+gammalib::str(index)+
397  ", but a Housekeeping Data container with the same name exists "
398  "already at index "+gammalib::str(inx)+" in the collection. "
399  "Every Housekeeping Data container in the collection needs a "
400  "unique name.";
401  throw GException::invalid_value(G_SET2, msg);
402  }
403 
404  // Assign Housekeeping Data container
405  m_hkds[index] = hkd;
406 
407  // Return reference to Housekeeping Data container
408  return m_hkds[index];
409 }
410 
411 
412 /***********************************************************************//**
413  * @brief Append Housekeeping Data container to collection
414  *
415  * @param[in] hkd Housekeeping Data container.
416  * @return Reference to appended Housekeeping Data container.
417  *
418  * Appends Housekeeping Data container to the collection by making a deep
419  * copy of specified container.
420  ***************************************************************************/
422 {
423  // Append housekeeping data container to list
424  m_hkds.push_back(hkd);
425 
426  // Return reference
427  return m_hkds[size()-1];
428 }
429 
430 
431 /***********************************************************************//**
432  * @brief Insert Housekeeping Data container into collection
433  *
434  * @param[in] index Housekeeping Data container index (0,...,size()-1).
435  * @param[in] hkd Housekeeping Data container.
436  * @return Reference to inserted Housekeeping Data container.
437  *
438  * @exception GException::out_of_range
439  * Housekeeping Data container index is out of range.
440  *
441  * Inserts an @p Housekeeping Data container into the collection before the
442  * Housekeeping Data container with the specified @p index.
443  ***************************************************************************/
444 GCOMHkd& GCOMHkds::insert(const int& index, const GCOMHkd& hkd)
445 {
446  // Compile option: raise exception if index is out of range
447  #if defined(G_RANGE_CHECK)
448  if (is_empty()) {
449  if (index > 0) {
450  std::string msg = "Housekeeping Data container index";
451  throw GException::out_of_range(G_INSERT, msg, index, size());
452  }
453  }
454  else {
455  if (index < 0 || index >= size()) {
456  std::string msg = "Housekeeping Data container index";
457  throw GException::out_of_range(G_INSERT, msg, index, size());
458  }
459  }
460  #endif
461 
462  // Inserts Housekeeping Data container into collection
463  m_hkds.insert(m_hkds.begin()+index, hkd);
464 
465  // Return reference
466  return m_hkds[index];
467 }
468 
469 
470 /***********************************************************************//**
471  * @brief Remove Housekeeping Data container from collection
472  *
473  * @param[in] index Housekeeping Data container index (0,...,size()-1).
474  *
475  * @exception GException::out_of_range
476  * Housekeeping Data container index is out of range.
477  *
478  * Remove Housekeeping Data container of specified @p index from collection.
479  ***************************************************************************/
480 void GCOMHkds::remove(const int& index)
481 {
482  // Compile option: raise exception if index is out of range
483  #if defined(G_RANGE_CHECK)
484  if (index < 0 || index >= size()) {
485  std::string msg = "Housekeeping Data container index";
486  throw GException::out_of_range(G_REMOVE, msg, index, size());
487  }
488  #endif
489 
490  // Erase Housekeeping Data container from collection
491  m_hkds.erase(m_hkds.begin() + index);
492 
493  // Return
494  return;
495 }
496 
497 
498 /***********************************************************************//**
499  * @brief Signals if Housekeeping parameter exists in collection
500  *
501  * @param[in] name Housekeeping parameter name.
502  * @return True if Housekeeping parameter with specified @p name exists.
503  *
504  * Searches the collection for a given Housekeeping parameter @p name. The
505  * method returns @c true if the specified @p name was found.
506  ***************************************************************************/
507 bool GCOMHkds::contains(const std::string& name) const
508 {
509  // Get model index
510  int index = get_index(name);
511 
512  // Return
513  return (index != -1);
514 }
515 
516 
517 /***********************************************************************//**
518  * @brief Extend Housekeeping Data collection
519  *
520  * @param[in] hkds Housekeeping Data collection.
521  *
522  * Extend Housekeeping Data collection by extending the container for each
523  * Housekeeping parameter.
524  ***************************************************************************/
525 void GCOMHkds::extend(const GCOMHkds& hkds)
526 {
527  // Continue only if specified Housekeeping Data collection is not empty
528  if (!hkds.is_empty()) {
529 
530  // Loop over all housekeeping parameters
531  for (int i = 0; i < hkds.size(); ++i) {
532 
533  // If parameter exists already in collection then extend the
534  // corresponding container
535  if (contains(hkds[i].name())) {
536  m_hkds[i].extend(hkds[i]);
537  }
538 
539  // ... otherwise append container to collection
540  else {
541  append(hkds[i]);
542  }
543 
544  } // endfor: looped over housekeeping parameters
545 
546  } // endif: Specified Housekeeping Data collection was not empty
547 
548  // Return
549  return;
550 }
551 
552 
553 /***********************************************************************//**
554  * @brief Load Housekeeping Data collection from FITS file
555  *
556  * @param[in] filename COMPTEL HKD FITS file name.
557  *
558  * Load a Housekeeping Data collection from a HKD FITS file into the
559  * collection.
560  ***************************************************************************/
561 void GCOMHkds::load(const GFilename& filename)
562 {
563  // Open FITS file
564  GFits fits(filename);
565 
566  // Get HDU (pointer is always valid)
567  const GFitsTable& hdu = *fits.table(1);
568 
569  // Read Housekeeping Data FITS table
570  read(hdu);
571 
572  // Close FITS file
573  fits.close();
574 
575  // Return
576  return;
577 }
578 
579 
580 /***********************************************************************//**
581  * @brief Read Housekeeping Data collection from FITS table
582  *
583  * @param[in] table COMPTEL HKD FITS table.
584  *
585  * Reads a Housekeeping Data collection from a FITS table into the
586  * collection.
587  ***************************************************************************/
588 void GCOMHkds::read(const GFitsTable& table)
589 {
590  // Clear
591  clear();
592 
593  // Extract number of records in FITS table
594  int num = table.nrows();
595 
596  // If there are records in FITS table then extract housekeeping data
597  if (num > 0) {
598 
599  // Get column pointers
600  const GFitsTableCol* ptr_tjd = table["TJD"]; // days
601  const GFitsTableCol* ptr_tics = table["TICS"]; // ticks
602  const GFitsTableCol* ptr_parameter = table["PARAMETER"];
603  const GFitsTableCol* ptr_value = table["VALUE"];
604 
605  // Loop over HKD records
606  for (int i = 0; i < num; ++i) {
607 
608  // Get reference to Housekeeping Data container by either
609  // returning an existing reference or by appending a new
610  // housekeeping parameter to the collection
611  GCOMHkd* hkd;
612  int index = get_index(ptr_parameter->string(i));
613  if (index == -1) {
614  hkd = &(append(GCOMHkd(ptr_parameter->string(i))));
615  }
616  else {
617  hkd = &((*this)[index]);
618  }
619 
620  // Append time and value to Housekeeping Data container
621  hkd->append(gammalib::com_time(ptr_tjd->integer(i), ptr_tics->integer(i)),
622  ptr_value->real(i));
623 
624  } // endfor: looped over HKD records
625 
626  } // endif: there were records in FITS table
627 
628  // Return
629  return;
630 }
631 
632 
633 /***********************************************************************//**
634  * @brief Print Housekeeping Data collection
635  *
636  * @param[in] chatter Chattiness.
637  * @return String containing Housekeeping Data collection information.
638  ***************************************************************************/
639 std::string GCOMHkds::print(const GChatter& chatter) const
640 {
641  // Initialise result string
642  std::string result;
643 
644  // Continue only if chatter is not silent
645  if (chatter != SILENT) {
646 
647  // Append header
648  result.append("=== GCOMHkds ===");
649 
650  // Append container information
651  result.append("\n"+gammalib::parformat("Parameters"));
652  result.append(gammalib::str(size()));
653 
654  // Append information on housekeeping parameters
655  for (int i = 0; i < size(); ++i) {
656  result.append("\n"+gammalib::parformat((*this)[i].name()));
657  result.append(gammalib::str((*this)[i].size()));
658  }
659 
660  } // endif: chatter was not silent
661 
662  // Return result
663  return result;
664 }
665 
666 
667 /*==========================================================================
668  = =
669  = Private methods =
670  = =
671  ==========================================================================*/
672 
673 /***********************************************************************//**
674  * @brief Initialise class members
675  ***************************************************************************/
677 {
678  // Initialise members
679  m_hkds.clear();
680 
681  // Return
682  return;
683 }
684 
685 
686 /***********************************************************************//**
687  * @brief Copy class members
688  *
689  * @param[in] hkds Housekeeping Data collection.
690  ***************************************************************************/
692 {
693  // Copy members
694  m_hkds = hkds.m_hkds;
695 
696  // Return
697  return;
698 }
699 
700 
701 /***********************************************************************//**
702  * @brief Delete class members
703  ***************************************************************************/
705 {
706  // Return
707  return;
708 }
709 
710 
711 /***********************************************************************//**
712  * @brief Return Housekeeping Data container index by parameter name
713  *
714  * @param[in] name Housekeeping parameter name.
715  * @return Housekeeping parameter index (-1 if Housekeeping parameter name
716  * has not been found)
717  *
718  * Returns Housekeeping Data container index based on the specified
719  * housekeeping parameter @p name. If no Housekeeping Data container with the
720  * specified @p name is found the method returns -1.
721  ***************************************************************************/
722 int GCOMHkds::get_index(const std::string& name) const
723 {
724  // Initialise index
725  int index = -1;
726 
727  // Search Housekeeping Data with specified name
728  for (int i = 0; i < size(); ++i) {
729  if (m_hkds[i].name() == name) {
730  index = i;
731  break;
732  }
733  }
734 
735  // Return index
736  return index;
737 }
void load(const GFilename &filename)
Load Housekeeping Data collection from FITS file.
Definition: GCOMHkds.cpp:561
GFitsTable * table(const int &extno)
Get pointer to table HDU.
Definition: GFits.cpp:482
#define G_INSERT
Definition: GCOMHkds.cpp:44
GCOMHkd & append(const GCOMHkd &hkd)
Append Housekeeping Data container to collection.
Definition: GCOMHkds.cpp:421
void remove(const int &index)
Remove Housekeeping Data container from collection.
Definition: GCOMHkds.cpp:480
Definition of COMPTEL tools.
GCOMHkd & at(const int &index)
Return reference to Housekeeping Data container.
Definition: GCOMHkds.cpp:269
GCOMHkds * clone(void) const
Clone Housekeeping Data collection.
Definition: GCOMHkds.cpp:251
#define G_SET2
Definition: GCOMHkds.cpp:43
FITS file class.
Definition: GFits.hpp:63
#define G_SET1
Definition: GCOMHkds.cpp:42
FITS file class interface definition.
GCOMHkd & insert(const int &index, const GCOMHkd &hkd)
Insert Housekeeping Data container into collection.
Definition: GCOMHkds.cpp:444
GTime com_time(const int &tjd, const int &tics)
Convert TJD and COMPTEL tics in GTime object.
Definition: GCOMTools.cpp:55
GCOMHkds & operator=(const GCOMHkds &hkds)
Assignment operator.
Definition: GCOMHkds.cpp:139
void init_members(void)
Initialise class members.
Definition: GCOMHkds.cpp:676
void clear(void)
Clear Housekeeping Data collection.
Definition: GCOMHkds.cpp:233
#define G_REMOVE
Definition: GCOMHkds.cpp:45
Implementation of support function used by COMPTEL classes.
void read(const GFitsTable &table)
Read Housekeeping Data collection from FITS table.
Definition: GCOMHkds.cpp:588
virtual std::string string(const int &row, const int &inx=0) const =0
void copy_members(const GCOMHkds &hkds)
Copy class members.
Definition: GCOMHkds.cpp:691
#define G_ACCESS
Definition: GCOMHkds.cpp:40
bool is_empty(void) const
Signals if there are no Housekeeping Data containers in collection.
Definition: GCOMHkds.hpp:166
std::vector< GCOMHkd > m_hkds
Housekeeping Data containers.
Definition: GCOMHkds.hpp:95
Filename class.
Definition: GFilename.hpp:62
Abstract interface for FITS table column.
COMPTEL Housekeeping Data collection class.
Definition: GCOMHkds.hpp:51
Abstract interface for FITS table.
Definition: GFitsTable.hpp:44
GChatter
Definition: GTypemaps.hpp:33
void extend(const GCOMHkds &hkds)
Extend Housekeeping Data collection.
Definition: GCOMHkds.cpp:525
std::string print(const GChatter &chatter=NORMAL) const
Print Housekeeping Data collection.
Definition: GCOMHkds.cpp:639
void free_members(void)
Delete class members.
Definition: GCOMHkds.cpp:704
const int & nrows(void) const
Return number of rows in table.
Definition: GFitsTable.hpp:119
COMPTEL Housekeeping Data container class.
Definition: GCOMHkd.hpp:49
virtual int integer(const int &row, const int &inx=0) const =0
int size(void) const
Return number of Housekeeping parameters in collection.
Definition: GCOMHkds.hpp:151
bool contains(const std::string &name) const
Signals if Housekeeping parameter exists in collection.
Definition: GCOMHkds.cpp:507
virtual double real(const int &row, const int &inx=0) const =0
int get_index(const std::string &name) const
Return Housekeeping Data container index by parameter name.
Definition: GCOMHkds.cpp:722
virtual ~GCOMHkds(void)
Destructor.
Definition: GCOMHkds.cpp:117
const std::string & name(void) const
Return Housekeeping Data name.
Definition: GCOMHkd.hpp:157
Exception handler interface definition.
#define G_AT
Definition: GCOMHkds.cpp:41
COMPTEL Housekeeping Data collection class definition.
GCOMHkds(void)
Void constructor.
Definition: GCOMHkds.cpp:66
std::string parformat(const std::string &s, const int &indent=0)
Convert string in parameter format.
Definition: GTools.cpp:1143
GCOMHkd & operator[](const int &index)
Return reference to Housekeeping Data container.
Definition: GCOMHkds.hpp:121
void close(void)
Close FITS file.
Definition: GFits.cpp:1342
void append(const GTime &time, const double &value)
Append Housekeeping Data to container.
Definition: GCOMHkd.cpp:194
GCOMHkd & set(const int &index, const GCOMHkd &hkd)
Set Housekeeping Data container in collection.
Definition: GCOMHkds.cpp:326
Mathematical function definitions.
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.
Definition: GTools.cpp:489
FITS table abstract base class interface definition.