GammaLib
2.0.0
|
Abstract temporal model base class. More...
#include <GModelTemporal.hpp>
Public Member Functions | |
GModelTemporal (void) | |
Void constructor. More... | |
GModelTemporal (const GModelTemporal &model) | |
Copy constructor. More... | |
virtual | ~GModelTemporal (void) |
Destructor. More... | |
virtual GModelTemporal & | operator= (const GModelTemporal &model) |
Assignment operator. More... | |
virtual GModelPar & | operator[] (const int &index) |
Returns model parameter. More... | |
virtual const GModelPar & | operator[] (const int &index) const |
Returns model parameter (const version) More... | |
virtual GModelPar & | operator[] (const std::string &name) |
Returns reference to model parameter. More... | |
virtual const GModelPar & | operator[] (const std::string &name) const |
Returns reference to model parameter (const version) More... | |
virtual void | clear (void)=0 |
Clear object. More... | |
virtual GModelTemporal * | clone (void) const =0 |
Clones object. More... | |
virtual std::string | classname (void) const =0 |
Return class name. More... | |
virtual std::string | type (void) const =0 |
virtual double | eval (const GTime &srcTime, const bool &gradients=false) const =0 |
virtual GTimes | mc (const double &rate, const GTime &tmin, const GTime &tmax, GRan &ran) const =0 |
virtual void | read (const GXmlElement &xml)=0 |
virtual void | write (GXmlElement &xml) const =0 |
virtual std::string | print (const GChatter &chatter=NORMAL) const =0 |
Print content of object. More... | |
GModelPar & | at (const int &index) |
Returns model parameter. More... | |
const GModelPar & | at (const int &index) const |
Returns model parameter (const version) More... | |
bool | has_par (const std::string &name) const |
Checks if parameter name exists. More... | |
int | size (void) const |
Return number of parameters. More... | |
void | autoscale (void) |
Autoscale parameters. More... | |
Public Member Functions inherited from GBase | |
virtual | ~GBase (void) |
Destructor. More... | |
Protected Member Functions | |
void | init_members (void) |
Initialise class members. More... | |
void | copy_members (const GModelTemporal &model) |
Copy class members. More... | |
void | free_members (void) |
Delete class members. More... | |
Protected Attributes | |
std::vector< GModelPar * > | m_pars |
Parameter pointers. More... | |
Abstract temporal model base class.
This class implements the temporal component of the factorised model. The temporal component of the factorised model is supposed to describe the relative variation of the source flux with respect to the mean value that is given by the spectral component. Normally, this model will have a mean value of 1.
Definition at line 51 of file GModelTemporal.hpp.
GModelTemporal::GModelTemporal | ( | void | ) |
GModelTemporal::GModelTemporal | ( | const GModelTemporal & | model | ) |
Copy constructor.
[in] | model | Temporal model. |
Definition at line 69 of file GModelTemporal.cpp.
References copy_members(), and init_members().
|
virtual |
GModelPar & GModelTemporal::at | ( | const int & | index | ) |
Returns model parameter.
[in] | index | Parameter index [0,...,size()[. |
GException::out_of_range | Parameter index is out of range. |
Returns model parameter with index
range checking.
Definition at line 205 of file GModelTemporal.cpp.
const GModelPar & GModelTemporal::at | ( | const int & | index | ) | const |
Returns model parameter (const version)
[in] | index | Parameter index [0,...,size()[. |
GException::out_of_range | Parameter index is out of range. |
Returns model parameter with index
range checking.
Definition at line 228 of file GModelTemporal.cpp.
void GModelTemporal::autoscale | ( | void | ) |
Autoscale parameters.
Sets the scale factors for all parameters so that the values are unity.
Definition at line 272 of file GModelTemporal.cpp.
References m_pars.
|
pure virtual |
Return class name.
Returns the class name for non-abstract classes in a human readable way.
Implements GBase.
Implemented in GModelTemporalPhaseCurve, GModelTemporalLightCurve, and GModelTemporalConst.
|
pure virtual |
Clear object.
Sets the object to a clean initial state. After calling the method the object will be in the same state as it were if an empty instance of the object would have been created.
Implements GBase.
Implemented in GModelTemporalPhaseCurve, GModelTemporalLightCurve, and GModelTemporalConst.
|
pure virtual |
Clones object.
Creates a deep copy of the object and returns a pointer to the object.
Implements GBase.
Implemented in GModelTemporalPhaseCurve, GModelTemporalLightCurve, and GModelTemporalConst.
Referenced by GCTAModelIrfBackground::copy_members(), GCTAModelAeffBackground::copy_members(), GCTAModelCubeBackground::copy_members(), GCTAModelRadialAcceptance::copy_members(), GCTAModelBackground::copy_members(), GCTAModelSkyCube::copy_members(), GModelSky::copy_members(), GCTAModelAeffBackground::GCTAModelAeffBackground(), GCTAModelBackground::GCTAModelBackground(), GCTAModelCubeBackground::GCTAModelCubeBackground(), GCTAModelRadialAcceptance::GCTAModelRadialAcceptance(), GCTAModelSkyCube::GCTAModelSkyCube(), GModelSky::GModelSky(), GCTAModelIrfBackground::temporal(), GCTAModelAeffBackground::temporal(), GCTAModelCubeBackground::temporal(), GCTAModelRadialAcceptance::temporal(), GCTAModelBackground::temporal(), GCTAModelSkyCube::temporal(), and GModelSky::temporal().
|
protected |
Copy class members.
[in] | model | Temporal model. |
Definition at line 310 of file GModelTemporal.cpp.
References m_pars.
Referenced by GModelTemporal(), and operator=().
|
pure virtual |
Implemented in GModelTemporalPhaseCurve, GModelTemporalLightCurve, and GModelTemporalConst.
Referenced by GCTAModelIrfBackground::eval(), GCTAModelAeffBackground::eval(), GCTAModelCubeBackground::eval(), GCTAModelRadialAcceptance::eval(), GCTAModelBackground::eval(), GCTAModelSkyCube::eval(), cta_nroi_kern::eval(), GResponse::eval_prob(), GResponse::eval_probs(), GModelSky::gradients(), GCTAModelIrfBackground::npred(), GCTAModelAeffBackground::npred(), GCTAModelCubeBackground::npred(), GCTAModelRadialAcceptance::npred(), GCTAModelBackground::npred(), GCTAModelSkyCube::npred(), GCTAResponseIrf::nroi(), and GModelSky::value().
|
protected |
Delete class members.
Definition at line 323 of file GModelTemporal.cpp.
Referenced by GModelTemporalConst::clear(), GModelTemporalLightCurve::clear(), GModelTemporalPhaseCurve::clear(), operator=(), and ~GModelTemporal().
bool GModelTemporal::has_par | ( | const std::string & | name | ) | const |
Checks if parameter name exists.
[in] | name | Parameter name. |
name
exists.Searches all parameter names for a match with the specified name
. If the specified name has been found, true is returned.
Definition at line 249 of file GModelTemporal.cpp.
|
protected |
Initialise class members.
Definition at line 295 of file GModelTemporal.cpp.
References m_pars.
Referenced by GModelTemporalConst::clear(), GModelTemporalLightCurve::clear(), GModelTemporalPhaseCurve::clear(), GModelTemporal(), and operator=().
|
pure virtual |
Implemented in GModelTemporalPhaseCurve, GModelTemporalLightCurve, and GModelTemporalConst.
Referenced by GCTAModelIrfBackground::mc(), GCTAModelAeffBackground::mc(), GCTAModelRadialAcceptance::mc(), GCTAModelBackground::mc(), and GModelSky::mc().
|
virtual |
Assignment operator.
[in] | model | Temporal model. |
Definition at line 107 of file GModelTemporal.cpp.
References copy_members(), free_members(), and init_members().
Referenced by GModelTemporalConst::operator=(), GModelTemporalLightCurve::operator=(), and GModelTemporalPhaseCurve::operator=().
|
inlinevirtual |
Returns model parameter.
[in] | index | Parameter index [0,...,size()-1]. |
Returns model parameter without index
range checking.
Definition at line 106 of file GModelTemporal.hpp.
References m_pars.
|
inlinevirtual |
Returns model parameter (const version)
[in] | index | Parameter index [0,...,size()-1]. |
Returns model parameter without index
range checking.
Definition at line 121 of file GModelTemporal.hpp.
References m_pars.
|
virtual |
Returns reference to model parameter.
[in] | name | Parameter name. |
GException::invalid_argument | Parameter with specified name not found. |
Definition at line 136 of file GModelTemporal.cpp.
|
virtual |
Returns reference to model parameter (const version)
[in] | name | Parameter name. |
GException::invalid_argument | Parameter with specified name not found. |
Definition at line 166 of file GModelTemporal.cpp.
Print content of object.
[in] | chatter | Chattiness (defaults to NORMAL). |
Formats the content in a standard way and puts this content in a C++ string that is returned.
Implements GBase.
Implemented in GModelTemporalPhaseCurve, GModelTemporalLightCurve, and GModelTemporalConst.
|
pure virtual |
Implemented in GModelTemporalPhaseCurve, GModelTemporalLightCurve, and GModelTemporalConst.
Referenced by GModelTemporalRegistry::alloc().
|
inline |
Return number of parameters.
Returns the number of parameters in the temporal model component.
Definition at line 135 of file GModelTemporal.hpp.
References m_pars.
Referenced by at(), GResponse::convolve(), GResponse::edisp_kerns::edisp_kerns(), GCTAModelIrfBackground::eval(), GCTAModelAeffBackground::eval(), GCTAModelCubeBackground::eval(), GCTAModelRadialAcceptance::eval(), GCTAModelBackground::eval(), GCTAModelSkyCube::eval(), GResponse::eval_prob(), GResponse::eval_probs(), has_par(), operator[](), GCTAModelIrfBackground::print(), GCTAModelAeffBackground::print(), GModelTemporalConst::print(), GCTAModelCubeBackground::print(), GCTAModelRadialAcceptance::print(), GCTAModelBackground::print(), GModelTemporalLightCurve::print(), GCTAModelSkyCube::print(), GModelTemporalPhaseCurve::print(), GModelSky::print(), GCTAModelIrfBackground::set_pointers(), GCTAModelAeffBackground::set_pointers(), GCTAModelCubeBackground::set_pointers(), GCTAModelRadialAcceptance::set_pointers(), GCTAModelBackground::set_pointers(), GCTAModelSkyCube::set_pointers(), GModelSky::set_pointers(), GModelSky::signal_analytical_gradients(), and GResponse::size_edisp_vector().
|
pure virtual |
Implemented in GModelTemporalPhaseCurve, GModelTemporalLightCurve, and GModelTemporalConst.
Referenced by GModelTemporalRegistry::GModelTemporalRegistry(), GCTAModelIrfBackground::is_constant(), GCTAModelAeffBackground::is_constant(), GCTAModelCubeBackground::is_constant(), GCTAModelRadialAcceptance::is_constant(), GCTAModelBackground::is_constant(), GCTAModelSkyCube::is_constant(), GModelSky::is_constant(), GCTAModelIrfBackground::write(), GCTAModelAeffBackground::write(), GCTAModelCubeBackground::write(), GCTAModelRadialAcceptance::write(), and GCTAModelSkyCube::write().
|
pure virtual |
Implemented in GModelTemporalPhaseCurve, GModelTemporalLightCurve, and GModelTemporalConst.
Referenced by GCTAModelIrfBackground::write(), GCTAModelAeffBackground::write(), GCTAModelCubeBackground::write(), GCTAModelRadialAcceptance::write(), GCTAModelBackground::write(), GCTAModelSkyCube::write(), and GModelSky::write().
|
protected |
Parameter pointers.
Definition at line 93 of file GModelTemporal.hpp.
Referenced by at(), autoscale(), GModelTemporalConst::copy_members(), copy_members(), GModelTemporalLightCurve::copy_members(), GModelTemporalPhaseCurve::copy_members(), has_par(), GModelTemporalConst::init_members(), init_members(), GModelTemporalLightCurve::init_members(), GModelTemporalPhaseCurve::init_members(), operator[](), GModelTemporalConst::print(), GModelTemporalLightCurve::print(), GModelTemporalPhaseCurve::print(), and size().