Commit 0e72361becbad432a5058509752d1c889dbc44a1

Authored by Jürgen Knödlseder
1 parent 571d0bc5

Add CTA background cube skymap grid constructor

inst/cta/include/GCTACubeBackground.hpp
... ... @@ -55,6 +55,15 @@ public:
55 55 explicit GCTACubeBackground(const GFilename& filename);
56 56 explicit GCTACubeBackground(const GCTAEventCube& cube);
57 57 GCTACubeBackground(const GCTACubeBackground& bgd);
  58 + GCTACubeBackground(const std::string& wcs,
  59 + const std::string& coords,
  60 + const double& x,
  61 + const double& y,
  62 + const double& dx,
  63 + const double& dy,
  64 + const int& nx,
  65 + const int& ny,
  66 + const GEnergies& energies);
58 67 virtual ~GCTACubeBackground(void);
59 68  
60 69 // Operators
... ...
inst/cta/pyext/GCTACubeBackground.i
... ... @@ -42,6 +42,15 @@ public:
42 42 explicit GCTACubeBackground(const GFilename& filename);
43 43 explicit GCTACubeBackground(const GCTAEventCube& cube);
44 44 GCTACubeBackground(const GCTACubeBackground& bgd);
  45 + GCTACubeBackground(const std::string& wcs,
  46 + const std::string& coords,
  47 + const double& x,
  48 + const double& y,
  49 + const double& dx,
  50 + const double& dy,
  51 + const int& nx,
  52 + const int& ny,
  53 + const GEnergies& energies);
45 54 virtual ~GCTACubeBackground(void);
46 55  
47 56 // Operators
... ...
inst/cta/src/GCTACubeBackground.cpp
... ... @@ -158,6 +158,49 @@ GCTACubeBackground::GCTACubeBackground(const GCTACubeBackground& bgd)
158 158  
159 159  
160 160 /***********************************************************************//**
  161 + * @brief Background cube constructor
  162 + *
  163 + * @param[in] wcs World Coordinate System.
  164 + * @param[in] coords Coordinate System (CEL or GAL).
  165 + * @param[in] x X coordinate of sky map centre (deg).
  166 + * @param[in] y Y coordinate of sky map centre (deg).
  167 + * @param[in] dx Pixel size in x direction at centre (deg/pixel).
  168 + * @param[in] dy Pixel size in y direction at centre (deg/pixel).
  169 + * @param[in] nx Number of pixels in x direction.
  170 + * @param[in] ny Number of pixels in y direction.
  171 + * @param[in] energies Energies.
  172 + *
  173 + * Constructs a background cube by specifying the sky map grid and the
  174 + * energies.
  175 + ***************************************************************************/
  176 +GCTACubeBackground::GCTACubeBackground(const std::string& wcs,
  177 + const std::string& coords,
  178 + const double& x,
  179 + const double& y,
  180 + const double& dx,
  181 + const double& dy,
  182 + const int& nx,
  183 + const int& ny,
  184 + const GEnergies& energies)
  185 +{
  186 + // Initialise class members
  187 + init_members();
  188 +
  189 + // Store energies
  190 + m_energies = energies;
  191 +
  192 + // Set GNodeArray used for interpolation
  193 + set_eng_axis();
  194 +
  195 + // Create sky map
  196 + m_cube = GSkyMap(wcs, coords, x, y, dx, dy, nx, ny, m_energies.size());
  197 +
  198 + // Return
  199 + return;
  200 +}
  201 +
  202 +
  203 +/***********************************************************************//**
161 204 * @brief Destructor
162 205 ***************************************************************************/
163 206 GCTACubeBackground::~GCTACubeBackground(void)
... ...
inst/cta/src/GCTACubeEdisp.cpp
... ... @@ -202,7 +202,7 @@ GCTACubeEdisp::GCTACubeEdisp(const GCTAEventCube& cube, const double& mmax,
202 202  
203 203  
204 204 /***********************************************************************//**
205   - * @brief Mean PSF cube constructor
  205 + * @brief Energy dispersion cube constructor
206 206 *
207 207 * @param[in] wcs World Coordinate System.
208 208 * @param[in] coords Coordinate System (CEL or GAL).
... ... @@ -219,7 +219,8 @@ GCTACubeEdisp::GCTACubeEdisp(const GCTAEventCube& cube, const double& mmax,
219 219 * @exception GException::invalid_argument
220 220 * Maximum energy migration or number of migration bins invalid.
221 221 *
222   - * Construct an energy dispersion cube with all elements set to zero.
  222 + * Constructs an energy dispersion cube by specifying the sky map grid and
  223 + * the energies.
223 224 ***************************************************************************/
224 225 GCTACubeEdisp::GCTACubeEdisp(const std::string& wcs,
225 226 const std::string& coords,
... ...
inst/cta/src/GCTACubeExposure.cpp
... ... @@ -161,8 +161,8 @@ GCTACubeExposure::GCTACubeExposure(const GCTAEventCube& cube)
161 161 * @param[in] ny Number of pixels in y direction.
162 162 * @param[in] energies Energies.
163 163 *
164   - * Constructs an exposure cube by specifying the sky map grid and the energy
165   - * boundaries.
  164 + * Constructs an exposure cube by specifying the sky map grid and the
  165 + * energies.
166 166 ***************************************************************************/
167 167 GCTACubeExposure::GCTACubeExposure(const std::string& wcs,
168 168 const std::string& coords,
... ...
inst/cta/src/GCTACubePsf.cpp
... ... @@ -181,7 +181,7 @@ GCTACubePsf::GCTACubePsf(const GCTAEventCube& cube, const double& dmax,
181 181  
182 182  
183 183 /***********************************************************************//**
184   - * @brief Mean PSF cube constructor
  184 + * @brief PSF cube constructor
185 185 *
186 186 * @param[in] wcs World Coordinate System.
187 187 * @param[in] coords Coordinate System (CEL or GAL).
... ... @@ -195,8 +195,7 @@ GCTACubePsf::GCTACubePsf(const GCTAEventCube& cube, const double& dmax,
195 195 * @param[in] dmax Maximum delta (deg).
196 196 * @param[in] ndbins Number of delta bins.
197 197 *
198   - * Constructs a mean PSF cube by computing the mean PSF from all CTA
199   - * observations found in the observation container.
  198 + * Constructs a PSF cube by specifying the sky map grid and the energies.
200 199 ***************************************************************************/
201 200 GCTACubePsf::GCTACubePsf(const std::string& wcs,
202 201 const std::string& coords,
... ...