GammaLib  2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GPha.hpp
Go to the documentation of this file.
1 /***************************************************************************
2  * GPha.hpp - XSPEC Pulse Height Analyzer class *
3  * ----------------------------------------------------------------------- *
4  * copyright (C) 2013-2018 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 GPha.hpp
23  * @brief XSPEC Pulse Height Analyzer class definition
24  * @author Juergen Knoedlseder
25  */
26 
27 #ifndef GPHA_HPP
28 #define GPHA_HPP
29 
30 /* __ Includes ___________________________________________________________ */
31 #include <string>
32 #include "GBase.hpp"
33 #include "GEbounds.hpp"
34 #include "GFilename.hpp"
35 #include "GNdarray.hpp"
36 #include "GFitsHeader.hpp"
37 
38 /* __ Forward declarations _______________________________________________ */
39 class GEnergy;
40 class GFits;
41 class GFitsTable;
42 
43 /* __ Constants __________________________________________________________ */
44 namespace gammalib {
45  const std::string extname_pha = "SPECTRUM";
46 }
47 
48 
49 /***********************************************************************//**
50  * @class GPha
51  *
52  * @brief Pulse Height Analyzer class
53  *
54  * This class implements a Pulse Height Analyzer (PHA) spectrum that is used
55  * as data container for an XSPEC analysis. A PHA spectrum is a vector that
56  * provides the number of measured counts as function of the channel number.
57  *
58  * As an extension to the PHA format, the GPha class may also store the
59  * energy boundaries for all PHA channels. If defined, the energy boundaries
60  * will be written as a EBOUNDS extension to the same file where the PHA
61  * spectrum resides. Upon loading, GPha will also load the energy boundaries
62  * from an EBOUNDS extension if they are present.
63  ***************************************************************************/
64 class GPha : public GBase {
65 
66  // Operator friends
67  friend GPha operator+(const GPha& a, const GPha& b);
68  friend GPha operator-(const GPha& a, const GPha& b);
69  friend GPha operator*(const GPha& pha, const double& scale);
70  friend GPha operator*(const double& scale, const GPha& pha);
71  friend GPha operator/(const GPha& pha, const double& scale);
72 
73 public:
74  // Constructors and destructors
75  GPha(void);
76  explicit GPha(const GFilename& filename);
77  explicit GPha(const GEbounds& ebds);
78  explicit GPha(const int& bins);
79  GPha(const GPha& pha);
80  virtual ~GPha(void);
81 
82  // Operators
83  GPha& operator=(const GPha& pha);
84  GPha& operator+=(const GPha& pha);
85  GPha& operator-=(const GPha& pha);
86  GPha& operator*=(const double& scale);
87  GPha& operator/=(const double& scale);
88  double& operator[](const int& index);
89  const double& operator[](const int& index) const;
90  double& operator()(const int& index, const int& col);
91  const double& operator()(const int& index, const int& col) const;
92 
93  // Additional column access operators
94  std::vector<double>& operator[](const std::string& colname);
95  const std::vector<double>& operator[](const std::string& colname) const;
96 
97  // Methods
98  void clear(void);
99  GPha* clone(void) const;
100  std::string classname(void) const;
101  int size(void) const;
102  int columns(void) const;
103  double& at(const int& index);
104  const double& at(const int& index) const;
105  double& at(const int& index, const int& col);
106  const double& at(const int& index, const int& col) const;
107  void append(const std::string& name,
108  const std::vector<double>& column);
109  const GEbounds& ebounds(void) const;
110  double counts(void) const;
111  GNdarray counts_spectrum(void) const;
112  void areascal(const int& index, const double& areascal);
113  const double& areascal(const int& index) const;
114  void backscal(const int& index, const double& backscal);
115  const double& backscal(const int& index) const;
116  GNdarray backscal_spectrum(void) const;
117  const double& underflow(void) const;
118  const double& overflow(void) const;
119  const double& outflow(void) const;
120  void exposure(const double& exposure);
121  const double& exposure(void) const;
122  void emin_obs(const GEnergy& emin_obs);
123  const GEnergy& emin_obs(void) const;
124  void emax_obs(const GEnergy& emax_obs);
125  const GEnergy& emax_obs(void) const;
126  void backfile(const std::string& backfile);
127  const std::string& backfile(void) const;
128  void corrfile(const std::string& corrfile);
129  const std::string& corrfile(void) const;
130  void respfile(const std::string& respfile);
131  const std::string& respfile(void) const;
132  void ancrfile(const std::string& ancrfile);
133  const std::string& ancrfile(void) const;
134  void fill(const GEnergy& energy, const double& value = 1.0);
135  void load(const GFilename& filename);
136  void save(const GFilename& filename,
137  const bool& clobber = false) const;
138  void read(const GFits& fits);
139  void read(const GFitsTable& table);
140  void write(GFits& fits) const;
141  const GFilename& filename(void) const;
142  const GFitsHeader& header(void) const;
143  void header(const GFitsHeader& header);
144  std::string print(const GChatter& chatter = NORMAL) const;
145 
146 protected:
147  // Protected methods
148  void init_members(void);
149  void copy_members(const GPha& pha);
150  void free_members(void);
151  void alloc(const int& size);
152  int column_index(const std::string& colname) const;
153 
154  // Protected members
155  mutable GFilename m_filename; //!< Filename of origin
156  std::vector<double> m_counts; //!< Counts data
157  std::vector<double> m_areascal; //!< Area scaling
158  std::vector<double> m_backscal; //!< Background scaling
159  std::vector<std::string> m_colnames; //!< Additional column names
160  std::vector<std::vector<double> > m_coldata; //!< Additional column data
161  GEnergy m_emin_obs; //!< Minimum energy of observation
162  GEnergy m_emax_obs; //!< Minimum energy of observation
163  double m_underflow; //!< Number of underflowing events
164  double m_overflow; //!< Number of overflowing events
165  double m_outflow; //!< Number of outflowing events
166  double m_exposure; //!< Deadtime corr. exp. time (sec)
167  GEbounds m_ebounds; //!< Energy boundaries
168  std::string m_backfile; //!< Background file
169  std::string m_corrfile; //!< Correction file
170  std::string m_respfile; //!< RMF file
171  std::string m_ancrfile; //!< ARF file
172  GFitsHeader m_header; //!< FITS header cards
173 };
174 
175 
176 /***********************************************************************//**
177  * @brief Return class name
178  *
179  * @return String containing the class name ("GPha").
180  ***************************************************************************/
181 inline
182 std::string GPha::classname(void) const
183 {
184  return ("GPha");
185 }
186 
187 
188 /***********************************************************************//**
189  * @brief Return content of spectral bin
190  *
191  * @param[in] index Bin index [0,...,size()-1].
192  *
193  * Returns reference to content of spectral bin with specified @p index.
194  ***************************************************************************/
195 inline
196 double& GPha::operator[](const int& index)
197 {
198  return (m_counts[index]);
199 }
200 
201 
202 /***********************************************************************//**
203  * @brief Return content of spectral bin (const version)
204  *
205  * @param[in] index Bin index [0,...,size()-1].
206  *
207  * Returns reference to content of spectral bin with specified @p index.
208  ***************************************************************************/
209 inline
210 const double& GPha::operator[](const int& index) const
211 {
212  return (m_counts[index]);
213 }
214 
215 
216 /***********************************************************************//**
217  * @brief Return content of additional columns
218  *
219  * @param[in] index Bin index [0,...,size()-1].
220  * @param[in] col Columns index [0,...,columns()-1].
221  *
222  * Returns reference to content of additional columns.
223  ***************************************************************************/
224 inline
225 double& GPha::operator()(const int& index, const int& col)
226 {
227  return (m_coldata[col][index]);
228 }
229 
230 
231 /***********************************************************************//**
232  * @brief Return content of additional columns (const version)
233  *
234  * @param[in] index Bin index [0,...,size()-1].
235  * @param[in] col Columns index [0,...,columns()-1].
236  *
237  * Returns reference to content of additional columns.
238  ***************************************************************************/
239 inline
240 const double& GPha::operator()(const int& index, const int& col) const
241 {
242  return (m_coldata[col][index]);
243 }
244 
245 
246 /***********************************************************************//**
247  * @brief Return number of bins in spectrum
248  *
249  * @return Number of bins in spectrum.
250  *
251  * Returns the number of bins in the spectrum.
252  ***************************************************************************/
253 inline
254 int GPha::size(void) const
255 {
256  return (int)m_counts.size();
257 }
258 
259 
260 /***********************************************************************//**
261  * @brief Return number of additional columns
262  *
263  * @return Number of additional columns.
264  *
265  * Returns the number of additional columns.
266  ***************************************************************************/
267 inline
268 int GPha::columns(void) const
269 {
270  return (int)m_colnames.size();
271 }
272 
273 
274 /***********************************************************************//**
275  * @brief Return energy boundaries
276  *
277  * @return Energy boundaries for all spectral bins.
278  *
279  * Returns the energy boundaries for all spectral bins.
280  ***************************************************************************/
281 inline
282 const GEbounds& GPha::ebounds(void) const
283 {
284  return (m_ebounds);
285 }
286 
287 
288 /***********************************************************************//**
289  * @brief Return number of underflow counts
290  *
291  * @return Number of counts with energies lower than the first energy bin.
292  *
293  * Returns the number of counts with energies lower than the first energy
294  * bin.
295  ***************************************************************************/
296 inline
297 const double& GPha::underflow(void) const
298 {
299  return (m_underflow);
300 }
301 
302 
303 /***********************************************************************//**
304  * @brief Return number of overflow counts
305  *
306  * @return Number of counts with energies larger than the last energy bin.
307  *
308  * Returns the number of counts with energies larger than the last energy
309  * bin.
310  ***************************************************************************/
311 inline
312 const double& GPha::overflow(void) const
313 {
314  return (m_overflow);
315 }
316 
317 
318 /***********************************************************************//**
319  * @brief Return number of outflow counts
320  *
321  * @return Number of counts with energies between energy bins.
322  *
323  * Returns the number of counts with energies between energy bins.
324  ***************************************************************************/
325 inline
326 const double& GPha::outflow(void) const
327 {
328  return (m_outflow);
329 }
330 
331 
332 /***********************************************************************//**
333  * @brief Set exposure time
334  *
335  * @param[in] exposure Exposure time (seconds).
336  *
337  * Set the exposure time in seconds.
338  ***************************************************************************/
339 inline
340 void GPha::exposure(const double& exposure)
341 {
343  return;
344 }
345 
346 
347 /***********************************************************************//**
348  * @brief Return exposure time
349  *
350  * @return Exposure time (seconds).
351  *
352  * Returns the exposure time in seconds.
353  ***************************************************************************/
354 inline
355 const double& GPha::exposure(void) const
356 {
357  return (m_exposure);
358 }
359 
360 
361 /***********************************************************************//**
362  * @brief Set minimum energy of observations
363  *
364  * @param[in] emin_obs Minimum energy of observation.
365  *
366  * Set the minimum energy of the observation.
367  ***************************************************************************/
368 inline
369 void GPha::emin_obs(const GEnergy& emin_obs)
370 {
372  return;
373 }
374 
375 
376 /***********************************************************************//**
377  * @brief Return minimum energy of observations
378  *
379  * @return Minimum energy of observation.
380  *
381  * Returns the minimum energy of the observation.
382  ***************************************************************************/
383 inline
384 const GEnergy& GPha::emin_obs(void) const
385 {
386  return (m_emin_obs);
387 }
388 
389 
390 /***********************************************************************//**
391  * @brief Set maximum energy of observations
392  *
393  * @param[in] emax_obs Maximum energy of observation.
394  *
395  * Set the maximum energy of the observation.
396  ***************************************************************************/
397 inline
398 void GPha::emax_obs(const GEnergy& emax_obs)
399 {
401  return;
402 }
403 
404 
405 /***********************************************************************//**
406  * @brief Return maximum energy of observations
407  *
408  * @return Maximum energy of observation.
409  *
410  * Returns the maximum energy of the observation.
411  ***************************************************************************/
412 inline
413 const GEnergy& GPha::emax_obs(void) const
414 {
415  return (m_emax_obs);
416 }
417 
418 
419 /***********************************************************************//**
420  * @brief Set background file name
421  *
422  * @param[in] backfile Background file name.
423  *
424  * Set the background file name.
425  ***************************************************************************/
426 inline
427 void GPha::backfile(const std::string& backfile)
428 {
430  return;
431 }
432 
433 
434 /***********************************************************************//**
435  * @brief Return background file name
436  *
437  * @return Background file name.
438  *
439  * Returns the background file name.
440  ***************************************************************************/
441 inline
442 const std::string& GPha::backfile(void) const
443 {
444  return (m_backfile);
445 }
446 
447 
448 /***********************************************************************//**
449  * @brief Set correction file name
450  *
451  * @param[in] corrfile Correction file name.
452  *
453  * Set the correction file name.
454  ***************************************************************************/
455 inline
456 void GPha::corrfile(const std::string& corrfile)
457 {
459  return;
460 }
461 
462 
463 /***********************************************************************//**
464  * @brief Return correction file name
465  *
466  * @return Correction file name.
467  *
468  * Returns the correction file name.
469  ***************************************************************************/
470 inline
471 const std::string& GPha::corrfile(void) const
472 {
473  return (m_corrfile);
474 }
475 
476 
477 /***********************************************************************//**
478  * @brief Set Redistribution Matrix File name
479  *
480  * @param[in] respfile Redistribution Matrix File name.
481  *
482  * Set the Redistribution Matrix File name.
483  ***************************************************************************/
484 inline
485 void GPha::respfile(const std::string& respfile)
486 {
488  return;
489 }
490 
491 
492 /***********************************************************************//**
493  * @brief Return Redistribution Matrix File name
494  *
495  * @return Redistribution Matrix File name.
496  *
497  * Returns the Redistribution Matrix File name.
498  ***************************************************************************/
499 inline
500 const std::string& GPha::respfile(void) const
501 {
502  return (m_respfile);
503 }
504 
505 
506 /***********************************************************************//**
507  * @brief Set Ancilliary Response File name
508  *
509  * @param[in] ancrfile Ancilliary Response File name.
510  *
511  * Set the Ancilliary Response File name.
512  ***************************************************************************/
513 inline
514 void GPha::ancrfile(const std::string& ancrfile)
515 {
517  return;
518 }
519 
520 
521 /***********************************************************************//**
522  * @brief Return Ancilliary Response File name
523  *
524  * @return Ancilliary Response File name.
525  *
526  * Returns the Ancilliary Response File name.
527  ***************************************************************************/
528 inline
529 const std::string& GPha::ancrfile(void) const
530 {
531  return (m_ancrfile);
532 }
533 
534 
535 /***********************************************************************//**
536  * @brief Return file name
537  *
538  * @return File name from which the PHA information has been read or into
539  * which PHA information has been saved.
540  *
541  * Returns the file name from which the PHA information has been read or into
542  * which PHA information has been saved. The returned string will be empty if
543  * no load() or save() method has been called before.
544  ***************************************************************************/
545 inline
546 const GFilename& GPha::filename(void) const
547 {
548  return (m_filename);
549 }
550 
551 
552 /***********************************************************************//**
553  * @brief Return FITS header
554  *
555  * @return FITS header or PHA file.
556  ***************************************************************************/
557 inline
558 const GFitsHeader& GPha::header(void) const
559 {
560  return (m_header);
561 }
562 
563 
564 /***********************************************************************//**
565  * @brief Set FITS header
566  *
567  * @param[in] header FITS header.
568  ***************************************************************************/
569 inline
570 void GPha::header(const GFitsHeader& header)
571 {
572  m_header = header;
573  return;
574 }
575 
576 
577 /***********************************************************************//**
578  * @brief Spectrum addition operator friend
579  *
580  * @param[in] a First Pulse Height Analyzer spectrum.
581  * @param[in] b Second Pulse Height Analyzer spectrum.
582  * @return Sum of Pulse Height Analyzer spectra.
583  ***************************************************************************/
584 inline
585 GPha operator+(const GPha& a, const GPha& b)
586 {
587  GPha result = a;
588  result += b;
589  return result;
590 }
591 
592 
593 /***********************************************************************//**
594  * @brief Spectrum subtraction operator friend
595  *
596  * @param[in] a First Pulse Height Analyzer spectrum.
597  * @param[in] b Second Pulse Height Analyzer spectrum.
598  * @return Difference of Pulse Height Analyzer spectra.
599  ***************************************************************************/
600 inline
601 GPha operator-(const GPha& a, const GPha& b)
602 {
603  GPha result = a;
604  result -= b;
605  return result;
606 }
607 
608 
609 /***********************************************************************//**
610  * @brief Spectrum scaling operator friend
611  *
612  * @param[in] pha Pulse Height Analyzer spectrum.
613  * @param[in] scale Scale factor.
614  * @return Scaled Pulse Height Analyzer spectrum.
615  ***************************************************************************/
616 inline
617 GPha operator*(const GPha& pha, const double& scale)
618 {
619  GPha result = pha;
620  result *= scale;
621  return result;
622 }
623 
624 
625 /***********************************************************************//**
626  * @brief Spectrum scaling operator friend
627  *
628  * @param[in] scale Scale factor.
629  * @param[in] pha Pulse Height Analyzer spectrum.
630  * @return Scaled Pulse Height Analyzer spectrum.
631  ***************************************************************************/
632 inline
633 GPha operator*(const double& scale, const GPha& pha)
634 {
635  GPha result = pha;
636  result *= scale;
637  return result;
638 }
639 
640 
641 /***********************************************************************//**
642  * @brief Spectrum division operator friend
643  *
644  * @param[in] pha Pulse Height Analyzer spectrum.
645  * @param[in] scale Division factor.
646  * @return Divided Pulse Height Analyzer spectrum.
647  ***************************************************************************/
648 inline
649 GPha operator/(const GPha& pha, const double& scale)
650 {
651  GPha result = pha;
652  result /= scale;
653  return result;
654 }
655 
656 #endif /* GPHA_HPP */
GArf operator/(const GArf &arf, const double &scale)
Auxiliary Response File vision operator friend.
Definition: GArf.hpp:357
const double & exposure(void) const
Return exposure time.
Definition: GPha.hpp:355
const std::string & ancrfile(void) const
Return Ancilliary Response File name.
Definition: GPha.hpp:529
GPha * clone(void) const
Clone object.
Definition: GPha.cpp:465
void append(const std::string &name, const std::vector< double > &column)
Append additional column to spectrum.
Definition: GPha.cpp:574
virtual ~GPha(void)
Destructor.
Definition: GPha.cpp:159
double m_overflow
Number of overflowing events.
Definition: GPha.hpp:164
const double & underflow(void) const
Return number of underflow counts.
Definition: GPha.hpp:297
const GEnergy & emin_obs(void) const
Return minimum energy of observations.
Definition: GPha.hpp:384
double m_exposure
Deadtime corr. exp. time (sec)
Definition: GPha.hpp:166
const GEbounds & ebounds(void) const
Return energy boundaries.
Definition: GPha.hpp:282
double m_underflow
Number of underflowing events.
Definition: GPha.hpp:163
double counts(void) const
Number of counts in spectrum.
Definition: GPha.cpp:703
Definition of interface for all GammaLib classes.
GNdarray counts_spectrum(void) const
Get number of counts in spectrum as GNdarray.
Definition: GPha.cpp:724
GFilename m_filename
Filename of origin.
Definition: GPha.hpp:155
void backscal(const int &index, const double &backscal)
Set background scaling factor.
Definition: GPha.cpp:658
std::vector< double > m_areascal
Area scaling.
Definition: GPha.hpp:157
GPha & operator*=(const double &scale)
Scale spectrum values.
Definition: GPha.cpp:343
FITS file class.
Definition: GFits.hpp:63
void fill(const GEnergy &energy, const double &value=1.0)
Fill spectrum with a value.
Definition: GPha.cpp:771
void init_members(void)
Initialise class members.
Definition: GPha.cpp:1226
GArf operator+(const GArf &a, const GArf &b)
Auxiliary Response File addition operator friend.
Definition: GArf.hpp:293
void load(const GFilename &filename)
Load Pulse Height Analyzer spectrum.
Definition: GPha.cpp:806
const GFitsHeader & header(void) const
Return FITS header.
Definition: GPha.hpp:558
double m_outflow
Number of outflowing events.
Definition: GPha.hpp:165
GEbounds m_ebounds
Energy boundaries.
Definition: GPha.hpp:167
int column_index(const std::string &colname) const
Returns index of additional vector column.
Definition: GPha.cpp:1330
Interface for FITS header class.
Definition: GFitsHeader.hpp:49
const GFilename & filename(void) const
Return file name.
Definition: GPha.hpp:546
std::vector< std::vector< double > > m_coldata
Additional column data.
Definition: GPha.hpp:160
Energy boundaries container class.
Definition: GEbounds.hpp:60
const std::string & corrfile(void) const
Return correction file name.
Definition: GPha.hpp:471
std::string m_respfile
RMF file.
Definition: GPha.hpp:170
const std::string & respfile(void) const
Return Redistribution Matrix File name.
Definition: GPha.hpp:500
Filename class.
Definition: GFilename.hpp:62
N-dimensional array class interface definition.
std::string m_corrfile
Correction file.
Definition: GPha.hpp:169
GPha & operator=(const GPha &pha)
Assignment operator.
Definition: GPha.cpp:181
Interface class for all GammaLib classes.
Definition: GBase.hpp:52
const double & overflow(void) const
Return number of overflow counts.
Definition: GPha.hpp:312
friend GPha operator/(const GPha &pha, const double &scale)
Spectrum division operator friend.
Definition: GPha.hpp:649
double & operator[](const int &index)
Return content of spectral bin.
Definition: GPha.hpp:196
void free_members(void)
Delete class members.
Definition: GPha.cpp:1288
Abstract interface for FITS table.
Definition: GFitsTable.hpp:44
GChatter
Definition: GTypemaps.hpp:33
GArf operator*(const GArf &arf, const double &scale)
Auxiliary Response File scaling operator friend.
Definition: GArf.hpp:325
N-dimensional array class.
Definition: GNdarray.hpp:44
const std::string extname_pha
Definition: GPha.hpp:45
void clear(void)
Clear object.
Definition: GPha.cpp:447
GPha & operator/=(const double &scale)
Divide spectrum values.
Definition: GPha.cpp:369
const std::string & backfile(void) const
Return background file name.
Definition: GPha.hpp:442
GPha & operator+=(const GPha &pha)
Add spectrum.
Definition: GPha.cpp:231
FITS header cards container class definition.
void write(GFits &fits) const
Write Pulse Height Analyzer spectrum.
Definition: GPha.cpp:1035
void save(const GFilename &filename, const bool &clobber=false) const
Save Pulse Height Analyzer spectrum.
Definition: GPha.cpp:845
std::vector< double > m_counts
Counts data.
Definition: GPha.hpp:156
std::string m_backfile
Background file.
Definition: GPha.hpp:168
GEnergy m_emin_obs
Minimum energy of observation.
Definition: GPha.hpp:161
std::string classname(void) const
Return class name.
Definition: GPha.hpp:182
void copy_members(const GPha &pha)
Copy class members.
Definition: GPha.cpp:1258
std::string print(const GChatter &chatter=NORMAL) const
Print Pulse Height Analyzer spectrum.
Definition: GPha.cpp:1163
int size(void) const
Return number of bins in spectrum.
Definition: GPha.hpp:254
void read(const GFits &fits)
Read Pulse Height Analyzer spectrum.
Definition: GPha.cpp:874
GPha(void)
Void constructor.
Definition: GPha.cpp:71
friend GPha operator+(const GPha &a, const GPha &b)
Spectrum addition operator friend.
Definition: GPha.hpp:585
const GEnergy & emax_obs(void) const
Return maximum energy of observations.
Definition: GPha.hpp:413
Energy boundaries class interface definition.
double & operator()(const int &index, const int &col)
Return content of additional columns.
Definition: GPha.hpp:225
GFitsHeader m_header
FITS header cards.
Definition: GPha.hpp:172
friend GPha operator-(const GPha &a, const GPha &b)
Spectrum subtraction operator friend.
Definition: GPha.hpp:601
friend GPha operator*(const GPha &pha, const double &scale)
Spectrum scaling operator friend.
Definition: GPha.hpp:617
double & at(const int &index)
Return content of spectral bin.
Definition: GPha.cpp:482
void areascal(const int &index, const double &areascal)
Set area scaling factor.
Definition: GPha.cpp:607
void alloc(const int &size)
Allocate spectrum.
Definition: GPha.cpp:1303
std::string m_ancrfile
ARF file.
Definition: GPha.hpp:171
std::vector< std::string > m_colnames
Additional column names.
Definition: GPha.hpp:159
std::vector< double > m_backscal
Background scaling.
Definition: GPha.hpp:158
int columns(void) const
Return number of additional columns.
Definition: GPha.hpp:268
Pulse Height Analyzer class.
Definition: GPha.hpp:64
GArf operator-(const GArf &a, const GArf &b)
Auxiliary Response File subtraction operator friend.
Definition: GArf.hpp:309
GNdarray backscal_spectrum(void) const
Get background scaling factors as GNdarray.
Definition: GPha.cpp:747
GPha & operator-=(const GPha &pha)
Subtract spectrum.
Definition: GPha.cpp:297
const double & outflow(void) const
Return number of outflow counts.
Definition: GPha.hpp:326
GEnergy m_emax_obs
Minimum energy of observation.
Definition: GPha.hpp:162
Filename class interface definition.
Class that handles energies in a unit independent way.
Definition: GEnergy.hpp:48