ctools 2.1.0
Loading...
Searching...
No Matches
ctcubemask.hpp
Go to the documentation of this file.
1/***************************************************************************
2 * ctcubemask - Cube filter tool *
3 * ----------------------------------------------------------------------- *
4 * copyright (C) 2014-2022 by Chia-Chun Lu *
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 ctcubemask.hpp
23 * @brief Cube filter tool definition
24 * @author Chia-Chun Lu
25 */
26
27#ifndef CTCUBEMASK_HPP
28#define CTCUBEMASK_HPP
29
30/* __ Includes ___________________________________________________________ */
31#include <vector>
32#include <string>
33#include "GammaLib.hpp"
34#include "GCTALib.hpp"
35#include "ctobservation.hpp"
36#include "GCTAEventCube.hpp"
37
38/* __Definitions _________________________________________________________ */
39#define CTCUBEMASK_NAME "ctcubemask"
40
41
42/***********************************************************************//**
43 * @class ctcubemask
44 *
45 * @brief Cube filter tool
46 ***************************************************************************/
47class ctcubemask : public ctobservation {
48
49public:
50 // Constructors and destructors
51 ctcubemask(void);
52 explicit ctcubemask(const GObservations& obs);
53 ctcubemask(int argc, char *argv[]);
54 ctcubemask(const ctcubemask& app);
55 virtual ~ctcubemask(void);
56
57 // Operators
58 ctcubemask& operator=(const ctcubemask& app);
59
60 // Methods
61 void clear(void);
62 void process(void);
63 void save(void);
64 void publish(const std::string& name = "");
65
66protected:
67 // Protected methods
68 void init_members(void);
69 void copy_members(const ctcubemask& app);
70 void free_members(void);
71 void get_parameters(void);
72 void apply_mask(GCTAObservation* obs);
73 std::string region_string(const GSkyRegion& region) const;
74 std::string set_outfile_name(const std::string& filename) const;
75 void save_fits(void);
76 void save_xml(void);
77
78 // User parameters
79 GFilename m_outcube; //!< Output event list or XML file
80 std::string m_prefix; //!< Prefix for multiple counts maps
81 double m_emin; //!< Lower energy
82 double m_emax; //!< Upper energy
83 bool m_publish; //!< Publish counts cube?
84
85 // Protected members
86 std::vector<std::string> m_infiles; //!< Input event filenames
87 bool m_select_energy; //!< Perform energy selection
88};
89
90#endif /* CTCUBEMASK_HPP */
Cube filter tool.
double m_emin
Lower energy.
std::string set_outfile_name(const std::string &filename) const
Set output file name.
std::vector< std::string > m_infiles
Input event filenames.
void clear(void)
Clear ctcubemask tool.
std::string m_prefix
Prefix for multiple counts maps.
bool m_select_energy
Perform energy selection.
bool m_publish
Publish counts cube?
void get_parameters(void)
Get application parameters.
GFilename m_outcube
Output event list or XML file.
void copy_members(const ctcubemask &app)
Copy class members.
virtual ~ctcubemask(void)
Destructor.
void process(void)
Mask data cube.
void save(void)
Save the masked event cube(s)
void save_xml(void)
Save counts cube(s) in XML format.
ctcubemask & operator=(const ctcubemask &app)
Assignment operator.
double m_emax
Upper energy.
void init_members(void)
Initialise class members.
void apply_mask(GCTAObservation *obs)
Apply mask to event cube.
void publish(const std::string &name="")
Publish counts cube.
ctcubemask(void)
Void constructor.
void free_members(void)
Delete class members.
void save_fits(void)
Save counts cube in FITS format.
std::string region_string(const GSkyRegion &region) const
Return region string.
Base class for observation tools.
const GObservations & obs(void) const
Return observation container.
Observation tool base class interface definition.