GammaLib 2.2.0.dev
Loading...
Searching...
No Matches
GCOSEventList.cpp
Go to the documentation of this file.
1/***************************************************************************
2 * GCOSEventList.cpp - COSI event list class *
3 * ----------------------------------------------------------------------- *
4 * copyright (C) 2026 by Juergen Knoedlseder *
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 GCOSEventList.hpp
23 * @brief COSI event list class implementation
24 * @author Juergen Knoedlseder
25 */
26
27/* __ Includes ___________________________________________________________ */
28#ifdef HAVE_CONFIG_H
29#include <config.h>
30#endif
31#include <algorithm> // std::sort
32#include <typeinfo>
33#include "GFits.hpp"
34#include "GException.hpp"
35#include "GFitsBinTable.hpp"
37#include "GCOSTools.hpp"
38#include "GCOSEventList.hpp"
39
40/* __ Method name definitions ____________________________________________ */
41#define G_OPERATOR "GCOSEventList::operator[](int&)"
42#define G_READ "GCOSEventList::read(GFits&)"
43#define G_ROI "GCOSEventList::roi(GRoi&)"
44
45/* __ Macros _____________________________________________________________ */
46
47/* __ Coding definitions _________________________________________________ */
48
49/* __ Debug definitions __________________________________________________ */
50
51
52/*==========================================================================
53 = =
54 = Constructors/destructors =
55 = =
56 ==========================================================================*/
57
58/***********************************************************************//**
59 * @brief Void constructor
60 *
61 * Creates an empty COSI event list.
62 ***************************************************************************/
64{
65 // Initialise class members for clean destruction
67
68 // Return
69 return;
70}
71
72
73/***********************************************************************//**
74 * @brief File name constructor
75 *
76 * @param[in] filename COSI event list filename.
77 *
78 * Construct COSI event list object by loading the events from a
79 * FITS file.
80 ***************************************************************************/
82{
83 // Initialise members
85
86 // Load event list
87 load(filename);
88
89 // Return
90 return;
91}
92
93
94/***********************************************************************//**
95 * @brief Copy constructor
96 *
97 * @param[in] list COSI event list.
98 ***************************************************************************/
100{
101 // Initialise members
102 init_members();
103
104 // Copy members
105 copy_members(list);
106
107 // Return
108 return;
109}
110
111
112/***********************************************************************//**
113 * @brief Destructor
114 ***************************************************************************/
116{
117 // Free members
118 free_members();
119
120 // Return
121 return;
122}
123
124
125/*==========================================================================
126 = =
127 = Operators =
128 = =
129 ==========================================================================*/
130
131/***********************************************************************//**
132 * @brief Assignment operator
133 *
134 * @param[in] list COSI event list.
135 * @return COSI event list.
136 ***************************************************************************/
138{
139 // Execute only if object is not identical
140 if (this != &list) {
141
142 // Copy base class members
143 this->GEventList::operator=(list);
144
145 // Free members
146 free_members();
147
148 // Initialise members
149 init_members();
150
151 // Copy members
152 copy_members(list);
153
154 } // endif: object was not identical
155
156 // Return this object
157 return *this;
158}
159
160
161/***********************************************************************//**
162 * @brief COSI event atom access operator
163 *
164 * @param[in] index Event index [0,...,size()-1].
165 * @return Pointer to COSI event atom.
166 *
167 * @exception GException::out_of_range
168 * Event index outside valid range.
169 *
170 * Returns pointer to a COSI event atom.
171 ***************************************************************************/
173{
174 // Optionally check if the index is valid
175 #if defined(G_RANGE_CHECK)
176 if (index < 0 || index >= size()) {
177 throw GException::out_of_range(G_OPERATOR, "Event index", index, size());
178 }
179 #endif
180
181 // Return pointer
182 return (&(m_events[index]));
183}
184
185
186/***********************************************************************//**
187 * @brief COSI event atom access operator
188 *
189 * @param[in] index Event index [0,...,size()-1].
190 * @return Pointer to COSI event atom.
191 *
192 * @exception GException::out_of_range
193 * Event index outside valid range.
194 *
195 * Returns pointer to a COSI event atom.
196 ***************************************************************************/
197const GCOSEventAtom* GCOSEventList::operator[](const int& index) const
198{
199 // Optionally check if the index is valid
200 #if defined(G_RANGE_CHECK)
201 if (index < 0 || index >= size()) {
202 throw GException::out_of_range(G_OPERATOR, "Event index", index, size());
203 }
204 #endif
205
206 // Return pointer
207 return (&(m_events[index]));
208}
209
210
211/*==========================================================================
212 = =
213 = Public methods =
214 = =
215 ==========================================================================*/
216
217/***********************************************************************//**
218 * @brief Clear COSI event list
219 *
220 * Clears COSI event list by resetting all class members to an
221 * initial state. Any information that was present before will be lost.
222 ***************************************************************************/
224{
225 // Free class members (base and derived classes, derived class first)
226 free_members();
228 this->GEvents::free_members();
229
230 // Initialise members
231 this->GEvents::init_members();
233 init_members();
234
235 // Return
236 return;
237}
238
239
240/***********************************************************************//**
241 * @brief Clone event list
242 *
243 * @return Pointer to deep copy of COSI event list.
244 ***************************************************************************/
246{
247 return new GCOSEventList(*this);
248}
249
250
251/***********************************************************************//**
252 * @brief Load COSI events from FITS file
253 *
254 * @param[in] filename COSI event list FITS file name.
255 *
256 * Loads COSI events from a FITS file into the event list.
257 ***************************************************************************/
258void GCOSEventList::load(const GFilename& filename)
259{
260 // Open FITS file
261 GFits fits(filename);
262
263 // Read event list from FITS file
264 read(fits);
265
266 // Close FITS file
267 fits.close();
268
269 // Return
270 return;
271}
272
273
274/***********************************************************************//**
275 * @brief Save COSI events
276 *
277 * @param[in] filename COSI event list FITS file name.
278 * @param[in] clobber Overwrite existing FITS file?
279 *
280 * Save COSI events into a FITS file.
281 ***************************************************************************/
282void GCOSEventList::save(const GFilename& filename,
283 const bool& clobber) const
284{
285 // Open FITS file
286 GFits fits;
287
288 // Write events
289 write(fits);
290
291 // Save events
292 fits.saveto(filename, clobber);
293
294 // Close FITS file
295 fits.close();
296
297 // Return
298 return;
299}
300
301
302/***********************************************************************//**
303 * @brief Read COSI events from FITS file.
304 *
305 * @param[in] fits FITS file.
306 *
307 * @exception GException::invalid_value
308 * Invalid data space keyword formatting encountered
309 *
310 * Read the COSI event list from a FITS file object.
311 ***************************************************************************/
312void GCOSEventList::read(const GFits& fits)
313{
314 // Clear object
315 clear();
316
317 // Initialise energy boundaries and RoI radius
320 double radius = 180.0;
321
322 // Get reference to event table
323 const GFitsTable& table = *fits.table(1);
324
325 // Extract number of events in FITS file
326 int num = table.nrows();
327
328 // If there are events then read them
329 if (num > 0) {
330
331 // Initialise boundaries
332 double phi_min = 0.0;
333 double phi_max = 0.0;
334
335 // Reserve data
336 m_events.reserve(num);
337
338 // Get column pointers
339 const GFitsTableCol* ptr_energies = table["Energies"]; // keV
340 const GFitsTableCol* ptr_time = table["TimeTags"]; // sec
341 const GFitsTableCol* ptr_phi = table["Phi"]; // rad
342 const GFitsTableCol* ptr_chi_local = table["Chi local"]; // rad
343 const GFitsTableCol* ptr_psi_local = table["Psi local"]; // rad
344 const GFitsTableCol* ptr_chi_gal = table["Chi galactic"]; // deg
345 const GFitsTableCol* ptr_psi_gal = table["Psi galactic"]; // deg
346
347 // Copy data from columns into GCOSEventAtom objects
348 for (int i = 0; i < num; ++i) {
349
350 // Set instrument direction
351 GSkyDir dir_gal; // Chi,Psi in galactic coordinates
352 GSkyDir dir_local; // Chi,Psi in spacecraft coordinates
353 double phi = ptr_phi->real(i) * gammalib::rad2deg;
354 dir_gal.lb_deg(ptr_chi_gal->real(i), ptr_psi_gal->real(i));
355 dir_local.radec(ptr_chi_local->real(i), ptr_psi_local->real(i));
356 GCOSInstDir dir(dir_gal, dir_local, phi);
357
358 // Set energy
359 GEnergy energy;
360 energy.keV(ptr_energies->real(i));
361
362 // Set time
363 GTime time(gammalib::cos_time(ptr_time->real(i)));
364
365 // Allocate event
366 GCOSEventAtom event(dir, energy, time);
367
368 // Append event
369 m_events.push_back(event);
370
371 // Update boundaries
372 if (i == 0) {
373 emin = energy;
374 emax = energy;
375 phi_min = phi;
376 phi_max = phi;
377 }
378 else {
379 if (energy < emin) {
380 emin = energy;
381 }
382 if (energy > emax) {
383 emax = energy;
384 }
385 if (phi < phi_min) {
386 phi_min = phi;
387 }
388 if (phi > phi_max) {
389 phi_max = phi;
390 }
391 }
392
393 } // endfor: looped over all events
394
395 } // endif: there were events
396
397 // If energy selection keywords are present then read energy boundaries
398 // from keywords
399 if (table.has_card("DSUNI2") && table.has_card("DSVAL2")) {
400 std::string unit = table.string("DSUNI2");
401 std::string dsval = table.string("DSVAL2");
402 std::vector<std::string> energy = gammalib::split(dsval, ":");
403 if (energy.size() != 2) {
404 std::string msg = "Invalid data selecetion value string DSVAL2="+
405 dsval+". Please specify a FITS file with a "
406 "correct formatting.";
408 }
409 emin = GEnergy(gammalib::todouble(energy[0]), unit);
410 emax = GEnergy(gammalib::todouble(energy[1]), unit);
411 }
412
413 // Set energy boundaries
415
416 // If GTI extension is present in FITS file then read Good Time Intervals
417 // from that extension
420 m_gti.read(gti);
421 }
422
423 // If RoI keywords are present then read radius from keywords
424 if (table.has_card("DSVAL3")) {
425 std::string dsval = table.string("DSVAL3");
426 dsval = gammalib::replace_segment(dsval, "CIRCLE(", "");
427 dsval = gammalib::rstrip_chars(dsval, ")");
428 std::vector<std::string> angles = gammalib::split(dsval, ",");
429 if (angles.size() != 3) {
430 std::string msg = "Invalid data selecetion value string DSVAL3="+
431 dsval+". Please specify a FITS file with a "
432 "correct formatting.";
434 }
435 radius = gammalib::todouble(angles[2]);
436 }
437
438 // Set RoI radius
439 m_roi.radius(radius);
440
441
442 // Return
443 return;
444}
445
446
447/***********************************************************************//**
448 * @brief Write COSI event list into FITS file.
449 *
450 * @param[in] fits FITS file.
451 *
452 * Write the COSI event list into FITS file.
453 ***************************************************************************/
455{
456 // Allocate empty FITS binary table
457 GFitsBinTable table;
458
459 // Set FITS extension name
460 table.extname("EVENT LIST");
461
462 // Allocate columns
463 GFitsTableDoubleCol col_energies("Energies", size());
464 GFitsTableDoubleCol col_time("TimeTags", size());
465 GFitsTableDoubleCol col_phi("Phi", size());
466 GFitsTableDoubleCol col_chi_local("Chi local", size());
467 GFitsTableDoubleCol col_psi_local("Psi local", size());
468 GFitsTableDoubleCol col_chi_gal("Chi galactic", size());
469 GFitsTableDoubleCol col_psi_gal("Psi galactic", size());
470
471 // Set units of columns
472 // (see http://fits.gsfc.nasa.gov/standard30/fits_standard30aa.pdf)
473 col_energies.unit("keV");
474 col_time.unit("s");
475 col_phi.unit("rad");
476 col_chi_local.unit("rad");
477 col_psi_local.unit("rad");
478 col_chi_gal.unit("deg");
479 col_psi_gal.unit("deg");
480
481 // Fill columns
482 for (int i = 0; i < size(); ++i) {
483 col_energies(i) = m_events[i].energy().keV();
484 col_time(i) = gammalib::cos_seconds(m_events[i].time());
485 col_phi(i) = m_events[i].dir().phi() * gammalib::deg2rad;
486 col_chi_local(i) = m_events[i].dir().dir_local().ra();
487 col_psi_local(i) = m_events[i].dir().dir_local().dec();
488 col_chi_gal(i) = m_events[i].dir().dir().l_deg();
489 col_psi_gal(i) = m_events[i].dir().dir().b_deg();
490 }
491
492 // Append columns to table
493 table.append(col_energies);
494 table.append(col_time);
495 table.append(col_phi);
496 table.append(col_chi_local);
497 table.append(col_psi_local);
498 table.append(col_chi_gal);
499 table.append(col_psi_gal);
500
501 // Set data selection strings
502 std::string dsref1 = ":"+gammalib::extname_gti;
503 std::string dsval2 = gammalib::str(emin().keV()) + ":" + gammalib::str(emax().keV());
504 std::string dsval3 = "CIRCLE(0,0," + gammalib::str(m_roi.radius()) + ")";
505
506 // Write data selection strings
507 table.card("DSTYP1", "TIME", "Data sub-space type");
508 table.card("DSUNI1", "s", "Data sub-space unit");
509 table.card("DSVAL1", "TABLE", "Data sub-space value");
510 table.card("DSREF1", dsref1, "Data sub-space reference");
511 table.card("DSTYP2", "ENERGY", "Data sub-space type");
512 table.card("DSUNI2", "keV", "Data sub-space unit");
513 table.card("DSVAL2", dsval2, "Data sub-space value");
514 table.card("DSTYP3", "POS(RA,DEC)", "Data sub-space type");
515 table.card("DSUNI3", "deg", "Data sub-space unit");
516 table.card("DSVAL3", dsval3, "Data sub-space value");
517 table.card("NDSKEYS", 3, "Number of data sub-space keys");
518
519 // Append event table to FITS file
520 fits.append(table);
521
522 // Write GTI extension
524
525 // Return
526 return;
527}
528
529
530/***********************************************************************//**
531 * @brief Set region of interest
532 *
533 * @param[in] roi Region of interest.
534 *
535 * @exception GException::invalid_argument
536 * Specified RoI is not a COSI RoI.
537 *
538 * Sets the region of interest for the observation.
539 ***************************************************************************/
540void GCOSEventList::roi(const GRoi& roi)
541{
542 // Get pointer on COSI region of interest
543 const GCOSRoi* cosroi = dynamic_cast<const GCOSRoi*>(&roi);
544 if (cosroi == NULL) {
545 std::string cls = std::string(typeid(&roi).name());
546 std::string msg = "Region of interest of type \""+cls+"\" is "
547 "not a COSI RoI. Please specify a "
548 "COSI RoI as argument.";
550 }
551
552 // Set RoI
553 m_roi = *cosroi;
554
555 // Return
556 return;
557}
558
559
560/***********************************************************************//**
561 * @brief Append event to event list
562 *
563 * @param[in] event Event.
564 *
565 * Appends an event to the end of the event list.
566 ***************************************************************************/
568{
569 // Append event
570 m_events.push_back(event);
571
572 // Return
573 return;
574}
575
576
577/***********************************************************************//**
578 * @brief Extend event list with another event list
579 *
580 * @param[in] list Event list.
581 *
582 * Extend event list with another event list. All events of @p list are
583 * appended after the existing events. If a sorted event list is required
584 * then call the sort() method after this method.
585 ***************************************************************************/
587{
588 // Get number of events in specified event list
589 int num = list.size();
590
591 // Continue only if there are elements in the event list
592 if (num > 0) {
593
594 // Reserve enough space
595 reserve(size() + num);
596
597 // Append events
598 for (int i = 0; i < num; ++i) {
599 m_events.push_back(*(list[i]));
600 }
601
602 } // endif: event list was empty
603
604 // Return
605 return;
606}
607
608
609/***********************************************************************//**
610 * @brief Remove events from event list
611 *
612 * @param[in] index Index from which on events should be removed.
613 * @param[in] number Number of event to remove (default: 1).
614 *
615 * Removes events from the event list. This method does nothing if @p index
616 * points beyond the event list. The method does also gently accept
617 * @p number arguments where @p index + @p number reach beyond the event
618 * list. In that case, all events from event @p index on will be removed.
619 ***************************************************************************/
620void GCOSEventList::remove(const int& index, const int& number)
621{
622 // Continue only if index is valid
623 if (index < size()) {
624
625 // Determine number of elements to remove
626 int n_remove = (index + number > size()) ? size() - index : number;
627
628 // Remove events
629 m_events.erase(m_events.begin() + index,
630 m_events.begin() + index + n_remove);
631
632 } // endif: index was valid
633
634 // Return
635 return;
636}
637
638
639/***********************************************************************//**
640 * @brief Sort events by increasing time
641 *
642 * Sorts the events in the event list by increasing time value.
643 ***************************************************************************/
645{
646 // Sort events in event list
647 std::sort(m_events.begin(), m_events.end());
648
649 // Return
650 return;
651}
652
653
654/***********************************************************************//**
655 * @brief Print COSI event list information
656 *
657 * @param[in] chatter Chattiness.
658 * @return String containing COSI event list information.
659 ***************************************************************************/
660std::string GCOSEventList::print(const GChatter& chatter) const
661{
662 // Initialise result string
663 std::string result;
664
665 // Continue only if chatter is not silent
666 if (chatter != SILENT) {
667
668 // Append header
669 result.append("=== GCOSEventList ===");
670
671 // Append information
672 result.append("\n"+gammalib::parformat("Number of events") +
674
675 // Append time information
676 if (gti().size() > 0) {
677 result.append("\n"+gammalib::parformat("MJD interval"));
678 result.append(gammalib::str(tstart().mjd())+" - ");
679 result.append(gammalib::str(tstop().mjd())+" days");
680 result.append("\n"+gammalib::parformat("UTC interval"));
681 result.append(tstart().utc()+" - ");
682 result.append(tstop().utc());
683 }
684 else {
685 result.append("\n"+gammalib::parformat("MJD interval"));
686 result.append("not defined");
687 }
688
689 // Append energy information
690 result.append("\n"+gammalib::parformat("Energy interval"));
691 if (ebounds().size() > 0) {
692 result.append(gammalib::str(ebounds().emin().MeV()));
693 result.append(" - ");
694 result.append(gammalib::str(ebounds().emax().MeV())+" MeV");
695 }
696 else {
697 result.append("not defined");
698 }
699
700 } // endif: chatter was not silent
701
702 // Return result
703 return result;
704}
705
706
707/*==========================================================================
708 = =
709 = Private methods =
710 = =
711 ==========================================================================*/
712
713/***********************************************************************//**
714 * @brief Initialise class members
715 ***************************************************************************/
717{
718 // Initialise members
719 m_roi.clear();
720 m_events.clear();
721
722 // Return
723 return;
724}
725
726
727/***********************************************************************//**
728 * @brief Copy class members
729 *
730 * @param[in] list COSI event list.
731 ***************************************************************************/
733{
734 // Copy members
735 m_roi = list.m_roi;
736 m_events = list.m_events;
737
738 // Return
739 return;
740}
741
742
743/***********************************************************************//**
744 * @brief Delete class members
745 ***************************************************************************/
747{
748 // Return
749 return;
750}
#define G_READ
#define G_ROI
COSI event list class definition.
Definition of COSI tools.
Exception handler interface definition.
FITS binary table class definition.
FITS table double column class interface definition.
FITS file class interface definition.
GChatter
Definition GTypemaps.hpp:33
@ SILENT
Definition GTypemaps.hpp:34
#define G_OPERATOR
COSI event atom class.
COSI event list class.
virtual GCOSEventList & operator=(const GCOSEventList &list)
Assignment operator.
void remove(const int &index, const int &number=1)
Remove events from event list.
virtual void read(const GFits &fits)
Read COSI events from FITS file.
virtual void load(const GFilename &filename)
Load COSI events from FITS file.
void reserve(const int &number)
Reserves space for events.
void extend(const GCOSEventList &list)
Extend event list with another event list.
virtual void save(const GFilename &filename, const bool &clobber=false) const
Save COSI events.
virtual const GCOSRoi & roi(void) const
Return Region of Interest.
virtual ~GCOSEventList(void)
Destructor.
GCOSRoi m_roi
Region of interest.
void copy_members(const GCOSEventList &list)
Copy class members.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print COSI event list information.
void sort(void)
Sort events by increasing time.
void free_members(void)
Delete class members.
virtual int size(void) const
Return number of events in list.
virtual GCOSEventList * clone(void) const
Clone event list.
void append(const GCOSEventAtom &event)
Append event to event list.
virtual GCOSEventAtom * operator[](const int &index)
COSI event atom access operator.
void init_members(void)
Initialise class members.
std::vector< GCOSEventAtom > m_events
Events.
GCOSEventList(void)
Void constructor.
virtual void clear(void)
Clear COSI event list.
virtual void write(GFits &fits) const
Write COSI event list into FITS file.
virtual double number(void) const
Return number of events in list.
COSI instrument direction class.
COSI region of interest class.
Definition GCOSRoi.hpp:50
const double & radius(void) const
Returns region of interest radius.
Definition GCOSRoi.hpp:104
virtual void clear(void)
Clear region of interest.
Definition GCOSRoi.cpp:159
Energy boundaries container class.
Definition GEbounds.hpp:60
Class that handles energies in a unit independent way.
Definition GEnergy.hpp:48
double keV(void) const
Return energy in keV.
Definition GEnergy.cpp:327
Abstract event atom container class.
virtual GEventList & operator=(const GEventList &list)
Assignment operator.
void init_members(void)
Initialise class members.
void free_members(void)
Delete class members.
void free_members(void)
Delete class members.
Definition GEvents.cpp:206
GGti m_gti
Good time intervals covered by events.
Definition GEvents.hpp:112
const GTime & tstart(void) const
Return start time.
Definition GEvents.hpp:146
GEbounds m_ebounds
Energy boundaries covered by events.
Definition GEvents.hpp:111
const GGti & gti(void) const
Return Good Time Intervals.
Definition GEvents.hpp:134
void init_members(void)
Initialise class members.
Definition GEvents.cpp:176
const GTime & tstop(void) const
Return stop time.
Definition GEvents.hpp:158
const GEbounds & ebounds(void) const
Return energy boundaries.
Definition GEvents.hpp:122
const GEnergy & emax(void) const
Return maximum energy.
Definition GEvents.hpp:182
const GEnergy & emin(void) const
Return minimum energy.
Definition GEvents.hpp:170
Filename class.
Definition GFilename.hpp:62
FITS binary table class.
bool has_card(const int &cardno) const
Check existence of header card.
Definition GFitsHDU.hpp:233
const std::string & extname(void) const
Return extension name.
Definition GFitsHDU.hpp:162
std::string string(const std::string &keyname) const
Return card value as string.
Definition GFitsHDU.hpp:410
GFitsHeaderCard & card(const int &cardno)
Return header card.
Definition GFitsHDU.hpp:259
Abstract interface for FITS table column.
virtual double real(const int &row, const int &inx=0) const =0
void unit(const std::string &unit)
Set column unit.
FITS table double column.
Abstract interface for FITS table.
GFitsTableCol * append(const GFitsTableCol &column)
Append column to the table.
const int & nrows(void) const
Return number of rows in table.
FITS file class.
Definition GFits.hpp:63
void saveto(const GFilename &filename, const bool &clobber=false)
Saves to specified FITS file.
Definition GFits.cpp:1293
bool contains(const int &extno) const
Check if HDU exists in FITS file.
Definition GFits.hpp:282
GFitsHDU * append(const GFitsHDU &hdu)
Append HDU to FITS file.
Definition GFits.cpp:678
void close(void)
Close FITS file.
Definition GFits.cpp:1342
GFitsTable * table(const int &extno)
Get pointer to table HDU.
Definition GFits.cpp:482
void write(GFits &fits, const std::string &extname=gammalib::extname_gti) const
Write Good Time Intervals and time reference into FITS object.
Definition GGti.cpp:815
void read(const GFitsTable &table)
Read Good Time Intervals and time reference from FITS table.
Definition GGti.cpp:772
Interface for the region of interest classes.
Definition GRoi.hpp:48
Sky direction class.
Definition GSkyDir.hpp:62
void radec(const double &ra, const double &dec)
Set equatorial sky direction (radians)
Definition GSkyDir.cpp:219
void lb_deg(const double &l, const double &b)
Set galactic sky direction (degrees)
Definition GSkyDir.cpp:300
Time class.
Definition GTime.hpp:55
std::string parformat(const std::string &s, const int &indent=0)
Convert string in parameter format.
Definition GTools.cpp:1136
double cos_seconds(const GTime &time)
Convert GammaLib time to COSI seconds.
Definition GCOSTools.cpp:71
GTime cos_time(const double &seconds)
Convert COSI seconds to GammaLib time.
Definition GCOSTools.cpp:49
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.
Definition GTools.cpp:508
double todouble(const std::string &arg)
Convert string into double precision value.
Definition GTools.cpp:919
std::string replace_segment(const std::string &arg, const std::string &segment, const std::string &replacement)
Replace string segment in string.
Definition GTools.cpp:187
std::string rstrip_chars(const std::string &arg, const std::string &chars)
Strip trailing character from string.
Definition GTools.cpp:150
const double deg2rad
Definition GMath.hpp:43
const std::string extname_gti
Definition GGti.hpp:45
std::vector< std::string > split(const std::string &s, const std::string &sep)
Split string.
Definition GTools.cpp:976
const double rad2deg
Definition GMath.hpp:44