Commit 6bb81448cf5c9f6820bc8922f4dfb4d0d6bceb3d

Authored by Jürgen Knödlseder
1 parent bc63260c

Add GModelSpatialRadial::is_energy_dependent() and GModelSpatialRadial::is_time_…

…dependent() methods (#3203)
1 1 New Features and Important Changes in GammaLib 1.8.0
2 2  
3   -18 September 2020
  3 +22 September 2020
4 4  
5 5  
6 6 1. Introduction
... ... @@ -22,11 +22,13 @@ The following classes have been renamed:
22 22 - none
23 23  
24 24 The following methods have been added:
25   -- GVector GModel::eval(GObservation&, GMatrixSparse*)
26   -- GVector GModelSky::eval(GObservation&, GMatrixSparse*)
27   -- GVector GResponse::convolve(GModelSky&, GObservation&, GMatrixSparse*)
28   -- GVector GObservation::model(GModels&, GMatrixSparse*)
29   -- GVector GObservation::model_grad(GModel&, GModelPar&)
  25 +- GModel::eval(GObservation&, GMatrixSparse*)
  26 +- GModelSky::eval(GObservation&, GMatrixSparse*)
  27 +- GResponse::convolve(GModelSky&, GObservation&, GMatrixSparse*)
  28 +- GObservation::model(GModels&, GMatrixSparse*)
  29 +- GObservation::model_grad(GModel&, GModelPar&)
  30 +- GModelSpatialRadial::is_energy_dependent()
  31 +- GModelSpatialRadial::is_time_dependent()
30 32  
31 33 The following methods have been removed:
32 34 - none
... ... @@ -69,7 +71,8 @@ Implement GMatrixSparse::row() and GMatrixSparse::add_to_row() methods.
69 71  
70 72 8. Model module
71 73 ---------------
72   -None
  74 +Added is_energy_dependent() and is_time_dependent() methods to GModelSpatialRadial
  75 +to allow for checking of energy or time dependence of spatial model components.
73 76  
74 77  
75 78 9. Numerics module
... ...
include/GModelSpatialRadial.hpp
... ... @@ -79,6 +79,8 @@ public:
79 79  
80 80 // Implemented pure virtual base class methods
81 81 virtual GClassCode code(void) const;
  82 + virtual bool is_energy_dependent(void) const;
  83 + virtual bool is_time_dependent(void) const;
82 84 virtual double eval(const GPhoton& photon,
83 85 const bool& gradients = false) const;
84 86 virtual double mc_norm(const GSkyDir& dir, const double& radius) const;
... ... @@ -121,6 +123,36 @@ GClassCode GModelSpatialRadial::code(void) const
121 123  
122 124  
123 125 /***********************************************************************//**
  126 + * @brief Signals whether radial model is energy dependent
  127 + *
  128 + * @return True if radial model is energy dependent, false otherwise.
  129 + *
  130 + * Signals whether the radial model is energy dependent. This method always
  131 + * returns false.
  132 + ***************************************************************************/
  133 +inline
  134 +bool GModelSpatialRadial::is_energy_dependent(void) const
  135 +{
  136 + return (false);
  137 +}
  138 +
  139 +
  140 +/***********************************************************************//**
  141 + * @brief Signals whether radial model is time dependent
  142 + *
  143 + * @return True if radial model is time dependent, false otherwise.
  144 + *
  145 + * Signals whether the radial model is time dependent. This method always
  146 + * returns false.
  147 + ***************************************************************************/
  148 +inline
  149 +bool GModelSpatialRadial::is_time_dependent(void) const
  150 +{
  151 + return (false);
  152 +}
  153 +
  154 +
  155 +/***********************************************************************//**
124 156 * @brief Return Right Ascencion of model centre
125 157 *
126 158 * @return Right Ascencion of model centre (degrees).
... ...
pyext/GModelSpatialRadial.i
... ... @@ -59,6 +59,8 @@ public:
59 59 virtual double theta_max(void) const = 0;
60 60  
61 61 // Implemented virtual base class methods
  62 + virtual bool is_energy_dependent(void) const;
  63 + virtual bool is_time_dependent(void) const;
62 64 virtual double eval(const GPhoton& photon,
63 65 const bool& gradients = false) const;
64 66 virtual double mc_norm(const GSkyDir& dir, const double& radius) const;
... ...