From 0604461b9c3af126c60892a3f76620c1b18e539d Mon Sep 17 00:00:00 2001 From: Jürgen Knödlseder Date: Mon, 15 Oct 2012 23:46:35 +0200 Subject: [PATCH] Add ctmodel. --- pyext/ctmodel.i | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ pyext/ctools.i | 17 ++++++++++++----- 2 files changed, 79 insertions(+), 5 deletions(-) create mode 100644 pyext/ctmodel.i diff --git a/pyext/ctmodel.i b/pyext/ctmodel.i new file mode 100644 index 0000000..c530c29 --- /dev/null +++ b/pyext/ctmodel.i @@ -0,0 +1,67 @@ +/*************************************************************************** + * ctmodel - CTA counts model tool * + * ----------------------------------------------------------------------- * + * copyright (C) 2012 by Juergen Knoedlseder * + * ----------------------------------------------------------------------- * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation, either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see . * + * * + ***************************************************************************/ +/** + * @file ctmodel.i + * @brief CTA counts model tool definition + * @author Juergen Knoedlseder + */ +%{ +/* Put headers and other declarations here that are needed for compilation */ +#include "ctmodel.hpp" +#include "GTools.hpp" +%} + + +/***********************************************************************//** + * @class ctmodel + * + * @brief CTA counts model tool interface defintion + ***************************************************************************/ +class ctmodel : public GApplication { + +public: + // Constructors and destructors + ctmodel(void); + explicit ctmodel(GObservations obs); + ctmodel(int argc, char *argv[]); + ctmodel(const ctmodel& app); + virtual ~ctmodel(void); + + // Methods + void clear(void); + void execute(void); + void run(void); + void save(void); + GObservations& obs(void) { return m_obs; } + void get_parameters(void); + void setup_obs(void); + void model_map(GCTAObservation* obs, const GModels& models); +}; + + +/***********************************************************************//** + * @brief CTA counts model tool Python extension + ***************************************************************************/ +%extend ctmodel { + ctmodel copy() { + return (*self); + } +} diff --git a/pyext/ctools.i b/pyext/ctools.i index 2f145e4..4880856 100755 --- a/pyext/ctools.i +++ b/pyext/ctools.i @@ -1,7 +1,7 @@ /*************************************************************************** * ctools - SWIG file * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2011 by Jurgen Knodlseder * + * copyright (C) 2010-2012 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -21,6 +21,11 @@ * Usage: * * swig -c++ -python -Wall ctools.i * ***************************************************************************/ +/** + * @file ctools.i + * @brief ctools SWIG file + * @author Juergen Knoedlseder + */ %module ctools %feature("autodoc", "1"); @@ -31,10 +36,12 @@ %import(module="gammalib.support") "GException.i"; /* __ Inform about base classes __________________________________________ */ -%import(module="gammalib.app") "GApplication.i"; +%import(module="gammalib.base") "GBase.i"; +%import(module="gammalib.app") "GApplication.i"; -/* __ CTA tools __________________________________________________________ */ -%include "ctobssim.i" -%include "ctselect.i" +/* __ ctools _____________________________________________________________ */ %include "ctbin.i" +%include "ctobssim.i" %include "ctlike.i" +%include "ctmodel.i" +%include "ctselect.i" -- libgit2 0.21.4