Commit 1f5cab40bbe9696b7c855829e761a9161c96debb
1 parent
cf853cd8
initial version
Showing
1 changed file
with
83 additions
and
0 deletions
inst/lat/pyext/GLATMeanPsf.i
0 → 100644
| 1 | +/*************************************************************************** | ||
| 2 | + * GLATMeanPsf.hpp - Fermi/LAT mean PSF * | ||
| 3 | + * ----------------------------------------------------------------------- * | ||
| 4 | + * copyright (C) 2010-2011 by Jurgen Knodlseder * | ||
| 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 GLATMeanPsf.hpp | ||
| 23 | + * @brief Fermi LAT mean PSF Python interface definition | ||
| 24 | + * @author J. Knodlseder | ||
| 25 | + */ | ||
| 26 | +%{ | ||
| 27 | +/* Put headers and other declarations here that are needed for compilation */ | ||
| 28 | +#include "GLATMeanPsf.hpp" | ||
| 29 | +#include "GTools.hpp" | ||
| 30 | +%} | ||
| 31 | + | ||
| 32 | + | ||
| 33 | +/***********************************************************************//** | ||
| 34 | + * @class GLATMeanPsf | ||
| 35 | + * | ||
| 36 | + * @brief Interface for the Fermi LAT position-dependent mean PSF. | ||
| 37 | + * | ||
| 38 | + * The position-dependent mean PSF is the point spread function that has | ||
| 39 | + * been averaged over the zenith and azimuth angles of an observation. The | ||
| 40 | + * averaging is done using the livetime cube which holds the lifetime as | ||
| 41 | + * function and zenith and azimuth angles for an observation. | ||
| 42 | + ***************************************************************************/ | ||
| 43 | +class GLATMeanPsf { | ||
| 44 | +public: | ||
| 45 | + // Constructors and destructors | ||
| 46 | + GLATMeanPsf(void); | ||
| 47 | + GLATMeanPsf(const GSkyDir& dir, const GLATObservation& obs); | ||
| 48 | + GLATMeanPsf(const GLATMeanPsf& cube); | ||
| 49 | + virtual ~GLATMeanPsf(void); | ||
| 50 | + | ||
| 51 | + // Operators | ||
| 52 | + double operator()(const double& offset, const double& logE); | ||
| 53 | + | ||
| 54 | + // Methods | ||
| 55 | + void clear(void); | ||
| 56 | + GLATMeanPsf* clone(void) const; | ||
| 57 | + int size(void) const; | ||
| 58 | + void set(const GSkyDir& dir, const GLATObservation& obs); | ||
| 59 | + int noffsets(void) const; | ||
| 60 | + int nenergies(void) const; | ||
| 61 | + double offset(const int& inx); | ||
| 62 | + double energy(const int& inx); | ||
| 63 | + GSkyDir dir(void) const; | ||
| 64 | + std::string name(void) const; | ||
| 65 | + void name(const std::string& name); | ||
| 66 | + double thetamax(void) const; | ||
| 67 | + void thetamax(const double& value); | ||
| 68 | + double psf(const double& offset, const double& logE); | ||
| 69 | + double exposure(const double& logE); | ||
| 70 | +}; | ||
| 71 | + | ||
| 72 | + | ||
| 73 | +/***********************************************************************//** | ||
| 74 | + * @brief GLATMeanPsf class extension | ||
| 75 | + ***************************************************************************/ | ||
| 76 | +%extend GLATMeanPsf { | ||
| 77 | + char *__str__() { | ||
| 78 | + return tochar(self->print()); | ||
| 79 | + } | ||
| 80 | + GLATMeanPsf copy() { | ||
| 81 | + return (*self); | ||
| 82 | + } | ||
| 83 | +}; |