ctools 2.1.0
Loading...
Searching...
No Matches
ctfindvar.hpp
Go to the documentation of this file.
1/***************************************************************************
2 * ctfindvar - Time variability search tool *
3 * ----------------------------------------------------------------------- *
4 * copyright (C) 2018-2022 by Simon Bonnefoy *
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 ctfindvar.hpp
23 * @brief Time variability search tool definition
24 * @author Simon Bonnefoy
25 */
26
27#ifndef CTFINDVAR_HPP
28#define CTFINDVAR_HPP
29
30/* __ Includes ___________________________________________________________ */
31#include "ctobservation.hpp"
32#include "GSkyMap.hpp"
33#include "GGti.hpp"
34
35
36/* __Definitions _________________________________________________________ */
37#define CTFINDVAR_NAME "ctfindvar"
38
39
40/***********************************************************************//**
41 * @class ctfindvar
42 *
43 * @brief Time variability search tool
44 *
45 * @todo Add tool description.
46 ***************************************************************************/
47class ctfindvar : public ctobservation {
48public:
49 // Constructors and destructors
50 ctfindvar(void);
51 explicit ctfindvar(const GObservations& obs);
52 ctfindvar(int argc, char *argv[]);
53 ctfindvar(const ctfindvar& app);
54 virtual ~ctfindvar(void);
55
56 // Operators
57 ctfindvar& operator=(const ctfindvar& app);
58
59 // Methods
60 void clear(void);
61 void process(void);
62 void save(void);
63
64protected:
65 // Protected methods
66 void init_members(void);
67 void copy_members(const ctfindvar& app);
68 void free_members(void);
69 void get_parameters(void);
70 void init_gtis(void);
71 void create_cube(void);
72 void fill_cube(GCTAObservation* obs);
73 void analyse_cube(void);
74 std::vector<int> get_pixels(void);
75 GNdarray get_variability_sig(const int& ipix);
76 std::vector<double> get_alphas(const int& ipix) const;
77 double gti_overlap(const GGti& gti1, const GGti& gti2) const;
78 GTime get_tstart(void);
79 GTime get_tstop(void);
80 GModelSky sky_model(const GSkyDir& dir) const;
81 void write_source_histograms(GFits& fits);
82 int time2inx(const GTime& time) const;
83
84 // Protected members
85 GSkyMap m_counts; //!< Counts for each time interval
86 std::vector<GGti> m_gti; //!< List of time intervals
87 GModels m_inmodel; //!< List of models for source positions
88 GSkyDir m_max_sig_dir; //!< Sky direction associated with maximum significance
89 double m_minoff; //!< Minimum counts for use in significance calculation
90 double m_sig_threshold; //!< Minimum significance required to set source as variable
91 GSkyMap m_peaksigmap; //!< Skymap holding the maximum significance
92 GNdarray m_pixsigsrc; //!< Store distributions of the source significances
93 GNdarray m_pixsigmax; //!< Store distribution for pixel with max significance
94 GTime m_tstart; //!< Start time for variability study
95 GTime m_tstop; //!< Stop time for variability study
96 GEnergy m_emin; //!< Minimum energy for events
97 GEnergy m_emax; //!< Maximum energy for events
98 GModels m_model_above_thr; //!< Model storing position with significance above thr
99
100};
101
102#endif /* CTFINDVAR_HPP */
Time variability search tool.
Definition ctfindvar.hpp:47
double gti_overlap(const GGti &gti1, const GGti &gti2) const
Returns number of seconds that two GTIs overlap.
int time2inx(const GTime &time) const
Get the map index associated with a given time.
GNdarray get_variability_sig(const int &ipix)
Get the significance of variability for a given skymap pixel.
std::vector< int > get_pixels(void)
Return pixel vector.
void process(void)
Process time variability search tool.
void clear(void)
Clear time variability search tool.
std::vector< GGti > m_gti
List of time intervals.
Definition ctfindvar.hpp:86
double m_minoff
Minimum counts for use in significance calculation.
Definition ctfindvar.hpp:89
double m_sig_threshold
Minimum significance required to set source as variable.
Definition ctfindvar.hpp:90
GNdarray m_pixsigmax
Store distribution for pixel with max significance.
Definition ctfindvar.hpp:93
void init_gtis(void)
Initialize Good Time Intervals.
GSkyMap m_peaksigmap
Skymap holding the maximum significance.
Definition ctfindvar.hpp:91
void free_members(void)
Delete class members.
void copy_members(const ctfindvar &app)
Copy class members.
void get_parameters(void)
Get application parameters.
virtual ~ctfindvar(void)
Destructor.
ctfindvar & operator=(const ctfindvar &app)
Assignment operator.
void analyse_cube(void)
Analyse all pixels of counts cube.
GTime get_tstop(void)
Get stop time.
GTime m_tstart
Start time for variability study.
Definition ctfindvar.hpp:94
std::vector< double > get_alphas(const int &ipix) const
Get alpha vector.
GSkyDir m_max_sig_dir
Sky direction associated with maximum significance.
Definition ctfindvar.hpp:88
GModels m_model_above_thr
Model storing position with significance above thr.
Definition ctfindvar.hpp:98
void save(void)
Save peak significance map and significance distributions.
GEnergy m_emin
Minimum energy for events.
Definition ctfindvar.hpp:96
GEnergy m_emax
Maximum energy for events.
Definition ctfindvar.hpp:97
GModels m_inmodel
List of models for source positions.
Definition ctfindvar.hpp:87
ctfindvar(void)
Void constructor.
Definition ctfindvar.cpp:67
GNdarray m_pixsigsrc
Store distributions of the source significances.
Definition ctfindvar.hpp:92
GTime get_tstart(void)
Get start time.
GSkyMap m_counts
Counts for each time interval.
Definition ctfindvar.hpp:85
void write_source_histograms(GFits &fits)
Write source histograms in FITS format.
void create_cube(void)
Create counts cube.
GTime m_tstop
Stop time for variability study.
Definition ctfindvar.hpp:95
void fill_cube(GCTAObservation *obs)
Fill the cube from the events in an observation.
GModelSky sky_model(const GSkyDir &dir) const
Return sky model for a given sky direction.
void init_members(void)
Initialise class members.
Base class for observation tools.
const GObservations & obs(void) const
Return observation container.
Observation tool base class interface definition.