From cb3431480190842fa4ace915d39b7e37e96c4e28 Mon Sep 17 00:00:00 2001 From: Jürgen Knödlseder Date: Sun, 22 Mar 2015 21:06:43 +0100 Subject: [PATCH] Add ctmodel::models() method that allows assigning of a model container for modelling. --- pyext/ctmodel.i | 3 ++- src/ctmodel/ctmodel.cpp | 2 ++ src/ctmodel/ctmodel.hpp | 16 ++++++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/pyext/ctmodel.i b/pyext/ctmodel.i index 27632f3..33d5f56 100644 --- a/pyext/ctmodel.i +++ b/pyext/ctmodel.i @@ -1,7 +1,7 @@ /*************************************************************************** * ctmodel - Model cube generation tool * * ----------------------------------------------------------------------- * - * copyright (C) 2012-2014 by Juergen Knoedlseder * + * copyright (C) 2012-2015 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -50,6 +50,7 @@ public: const GObservations& obs(void) const; const GCTAEventCube& cube(void) const; void cube(const GCTAEventCube& cube); + void models(const GModels& models); }; diff --git a/src/ctmodel/ctmodel.cpp b/src/ctmodel/ctmodel.cpp index cbd4d9e..eb1cb5e 100644 --- a/src/ctmodel/ctmodel.cpp +++ b/src/ctmodel/ctmodel.cpp @@ -432,6 +432,8 @@ void ctmodel::get_parameters(void) // Read model definition file if required if (m_obs.models().size() == 0) { + + // Get model filename std::string inmodel = (*this)["inmodel"].filename(); // Load models from file diff --git a/src/ctmodel/ctmodel.hpp b/src/ctmodel/ctmodel.hpp index fe6e9a8..e3d559e 100644 --- a/src/ctmodel/ctmodel.hpp +++ b/src/ctmodel/ctmodel.hpp @@ -71,6 +71,7 @@ public: const GObservations& obs(void) const; const GCTAEventCube& cube(void) const; void cube(const GCTAEventCube& cube); + void models(const GModels& models); protected: // Protected methods @@ -130,4 +131,19 @@ bool ctmodel::has_cube(void) const return m_has_cube; } + +/***********************************************************************//** + * @brief Set models + * + * @param[in] models Model container. + * + * Set model container that should be used for model generation. + ***************************************************************************/ +inline +void ctmodel::models(const GModels& models) +{ + m_obs.models(models); + return; +} + #endif /* CTMODEL_HPP */ -- libgit2 0.21.4