Commit 0604461b9c3af126c60892a3f76620c1b18e539d
1 parent
010bb30b
Add ctmodel.
Add ctmodel Python interface file.
Showing
2 changed files
with
79 additions
and
5 deletions
pyext/ctmodel.i
0 → 100644
| 1 | +/*************************************************************************** | ||
| 2 | + * ctmodel - CTA counts model tool * | ||
| 3 | + * ----------------------------------------------------------------------- * | ||
| 4 | + * copyright (C) 2012 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 ctmodel.i | ||
| 23 | + * @brief CTA counts model tool definition | ||
| 24 | + * @author Juergen Knoedlseder | ||
| 25 | + */ | ||
| 26 | +%{ | ||
| 27 | +/* Put headers and other declarations here that are needed for compilation */ | ||
| 28 | +#include "ctmodel.hpp" | ||
| 29 | +#include "GTools.hpp" | ||
| 30 | +%} | ||
| 31 | + | ||
| 32 | + | ||
| 33 | +/***********************************************************************//** | ||
| 34 | + * @class ctmodel | ||
| 35 | + * | ||
| 36 | + * @brief CTA counts model tool interface defintion | ||
| 37 | + ***************************************************************************/ | ||
| 38 | +class ctmodel : public GApplication { | ||
| 39 | + | ||
| 40 | +public: | ||
| 41 | + // Constructors and destructors | ||
| 42 | + ctmodel(void); | ||
| 43 | + explicit ctmodel(GObservations obs); | ||
| 44 | + ctmodel(int argc, char *argv[]); | ||
| 45 | + ctmodel(const ctmodel& app); | ||
| 46 | + virtual ~ctmodel(void); | ||
| 47 | + | ||
| 48 | + // Methods | ||
| 49 | + void clear(void); | ||
| 50 | + void execute(void); | ||
| 51 | + void run(void); | ||
| 52 | + void save(void); | ||
| 53 | + GObservations& obs(void) { return m_obs; } | ||
| 54 | + void get_parameters(void); | ||
| 55 | + void setup_obs(void); | ||
| 56 | + void model_map(GCTAObservation* obs, const GModels& models); | ||
| 57 | +}; | ||
| 58 | + | ||
| 59 | + | ||
| 60 | +/***********************************************************************//** | ||
| 61 | + * @brief CTA counts model tool Python extension | ||
| 62 | + ***************************************************************************/ | ||
| 63 | +%extend ctmodel { | ||
| 64 | + ctmodel copy() { | ||
| 65 | + return (*self); | ||
| 66 | + } | ||
| 67 | +} |
pyext/ctools.i
| 1 | /*************************************************************************** | 1 | /*************************************************************************** |
| 2 | * ctools - SWIG file * | 2 | * ctools - SWIG file * |
| 3 | * ----------------------------------------------------------------------- * | 3 | * ----------------------------------------------------------------------- * |
| 4 | - * copyright (C) 2010-2011 by Jurgen Knodlseder * | 4 | + * copyright (C) 2010-2012 by Juergen Knoedlseder * |
| 5 | * ----------------------------------------------------------------------- * | 5 | * ----------------------------------------------------------------------- * |
| 6 | * * | 6 | * * |
| 7 | * This program is free software: you can redistribute it and/or modify * | 7 | * This program is free software: you can redistribute it and/or modify * |
| @@ -21,6 +21,11 @@ | @@ -21,6 +21,11 @@ | ||
| 21 | * Usage: * | 21 | * Usage: * |
| 22 | * swig -c++ -python -Wall ctools.i * | 22 | * swig -c++ -python -Wall ctools.i * |
| 23 | ***************************************************************************/ | 23 | ***************************************************************************/ |
| 24 | +/** | ||
| 25 | + * @file ctools.i | ||
| 26 | + * @brief ctools SWIG file | ||
| 27 | + * @author Juergen Knoedlseder | ||
| 28 | + */ | ||
| 24 | %module ctools | 29 | %module ctools |
| 25 | %feature("autodoc", "1"); | 30 | %feature("autodoc", "1"); |
| 26 | 31 | ||
| @@ -31,10 +36,12 @@ | @@ -31,10 +36,12 @@ | ||
| 31 | %import(module="gammalib.support") "GException.i"; | 36 | %import(module="gammalib.support") "GException.i"; |
| 32 | 37 | ||
| 33 | /* __ Inform about base classes __________________________________________ */ | 38 | /* __ Inform about base classes __________________________________________ */ |
| 34 | -%import(module="gammalib.app") "GApplication.i"; | 39 | +%import(module="gammalib.base") "GBase.i"; |
| 40 | +%import(module="gammalib.app") "GApplication.i"; | ||
| 35 | 41 | ||
| 36 | -/* __ CTA tools __________________________________________________________ */ | ||
| 37 | -%include "ctobssim.i" | ||
| 38 | -%include "ctselect.i" | 42 | +/* __ ctools _____________________________________________________________ */ |
| 39 | %include "ctbin.i" | 43 | %include "ctbin.i" |
| 44 | +%include "ctobssim.i" | ||
| 40 | %include "ctlike.i" | 45 | %include "ctlike.i" |
| 46 | +%include "ctmodel.i" | ||
| 47 | +%include "ctselect.i" |