GammaLib
2.0.0
|
#include <GModelSpatialRadialProfile.hpp>
Classes | |
struct | profile |
Public Member Functions | |
GModelSpatialRadialProfile (void) | |
Void constructor. More... | |
GModelSpatialRadialProfile (const GXmlElement &xml) | |
XML constructor. More... | |
GModelSpatialRadialProfile (const GModelSpatialRadialProfile &model) | |
Copy constructor. More... | |
virtual | ~GModelSpatialRadialProfile (void) |
Destructor. More... | |
virtual GModelSpatialRadialProfile & | operator= (const GModelSpatialRadialProfile &model) |
Assignment operator. More... | |
virtual void | clear (void)=0 |
Clear object. More... | |
virtual GModelSpatialRadialProfile * | clone (void) const =0 |
Clones object. More... | |
virtual std::string | classname (void) const =0 |
Return class name. More... | |
virtual double | theta_min (void) const =0 |
virtual double | theta_max (void) const =0 |
virtual std::string | print (const GChatter &chatter=NORMAL) const =0 |
Print content of object. More... | |
virtual double | eval (const double &theta, const GEnergy &energy, const GTime &time, const bool &gradients=false) const |
Evaluate function (in units of sr^-1) More... | |
virtual GSkyDir | mc (const GEnergy &energy, const GTime &time, GRan &ran) const |
Return MC sky direction. More... | |
virtual bool | contains (const GSkyDir &dir, const double &margin=0.0) const |
Checks where model contains specified sky direction. More... | |
int | num_nodes (void) const |
Return number of nodes. More... | |
void | num_nodes (const int &number) |
Set number of nodes. More... | |
Public Member Functions inherited from GModelSpatialRadial | |
GModelSpatialRadial (void) | |
Void constructor. More... | |
GModelSpatialRadial (const GModelSpatialRadial &model) | |
Copy constructor. More... | |
GModelSpatialRadial (const GXmlElement &xml) | |
XML constructor. More... | |
virtual | ~GModelSpatialRadial (void) |
Destructor. More... | |
virtual GModelSpatialRadial & | operator= (const GModelSpatialRadial &model) |
Assignment operator. More... | |
virtual GClassCode | code (void) const |
Return class code. More... | |
virtual bool | is_energy_dependent (void) const |
Signals whether radial model is energy dependent. More... | |
virtual bool | is_time_dependent (void) const |
Signals whether radial model is time dependent. More... | |
virtual double | eval (const GPhoton &photon, const bool &gradients=false) const |
Return model value. More... | |
virtual double | mc_norm (const GSkyDir &dir, const double &radius) const |
Return normalization of radial source for Monte Carlo simulations. More... | |
virtual void | read (const GXmlElement &xml) |
Read model from XML element. More... | |
virtual void | write (GXmlElement &xml) const |
Write model into XML element. More... | |
std::string | coordsys (void) const |
Return coordinate system. More... | |
const GSkyDir & | dir (void) const |
Return position of radial spatial model. More... | |
void | dir (const GSkyDir &dir) |
Set position of radial spatial model. More... | |
Public Member Functions inherited from GModelSpatial | |
GModelSpatial (void) | |
Void constructor. More... | |
GModelSpatial (const GModelSpatial &model) | |
Copy constructor. More... | |
virtual | ~GModelSpatial (void) |
Destructor. More... | |
virtual GModelSpatial & | operator= (const GModelSpatial &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 model parameter. More... | |
virtual const GModelPar & | operator[] (const std::string &name) const |
Returns model parameter (const version) More... | |
virtual double | flux (const GSkyRegion ®ion, const GEnergy &srcEng=GEnergy(), const GTime &srcTime=GTime()) const |
Returns model flux integrated in circular sky region. More... | |
std::string | type (void) const |
Return model type. More... | |
void | type (const std::string &type) |
Set model type. 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... | |
bool | has_free_pars (void) const |
Checks if the spatial model has free parameters. More... | |
int | size (void) const |
Return number of parameters. More... | |
void | autoscale (void) |
Autoscale parameters. More... | |
const GSkyRegion * | region (void) const |
Return boundary sky region. 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 GModelSpatialRadialProfile &model) |
Copy class members. More... | |
void | free_members (void) |
Delete class members. More... | |
int | cache_index (void) const |
Return index to pre-computation cache. More... | |
virtual double | profile_value (const double &theta) const =0 |
virtual void | set_region (void) const |
Set boundary sky region. More... | |
Protected Member Functions inherited from GModelSpatialRadial | |
void | init_members (void) |
Initialise class members. More... | |
void | copy_members (const GModelSpatialRadial &model) |
Copy class members. More... | |
void | free_members (void) |
Delete class members. More... | |
bool | is_celestial (void) const |
Check if model holds celestial coordinates. More... | |
Protected Member Functions inherited from GModelSpatial | |
void | init_members (void) |
Initialise class members. More... | |
void | copy_members (const GModelSpatial &model) |
Copy class members. More... | |
void | free_members (void) |
Delete class members. More... | |
Protected Attributes | |
bool | m_coord_indep |
True if model independent of sky coordinates. More... | |
int | m_num_nodes |
Number of profile nodes. More... | |
std::vector< profile > | m_profile |
Pre-computation cache. More... | |
Protected Attributes inherited from GModelSpatialRadial | |
GModelPar | m_lon |
Right Ascension or Galactic longitude (deg) More... | |
GModelPar | m_lat |
Declination or Galactic latitude (deg) More... | |
GSkyDir | m_dir |
Sky direction representing parameters. More... | |
double | m_last_lon |
Last longitude. More... | |
double | m_last_lat |
Last latitude. More... | |
Protected Attributes inherited from GModelSpatial | |
std::string | m_type |
Spatial model type. More... | |
GSkyRegionCircle | m_region |
Bounding circle. More... | |
std::vector< GModelPar * > | m_pars |
Parameter pointers. More... | |
Definition at line 49 of file GModelSpatialRadialProfile.hpp.
GModelSpatialRadialProfile::GModelSpatialRadialProfile | ( | void | ) |
Void constructor.
Constructs empty radial profile
Definition at line 63 of file GModelSpatialRadialProfile.cpp.
References init_members().
|
explicit |
XML constructor.
[in] | xml | XML element. |
Constructs radial profile model by extracting information from an XML elements.
Definition at line 82 of file GModelSpatialRadialProfile.cpp.
References init_members(), and GModelSpatialRadial::read().
GModelSpatialRadialProfile::GModelSpatialRadialProfile | ( | const GModelSpatialRadialProfile & | model | ) |
Copy constructor.
[in] | model | Radial profile model. |
Copies radial profile model from another radial profile model.
Definition at line 103 of file GModelSpatialRadialProfile.cpp.
References copy_members(), and init_members().
|
virtual |
Destructor.
Destructs radial profile model.
Definition at line 122 of file GModelSpatialRadialProfile.cpp.
References free_members().
|
protected |
Return index to pre-computation cache.
Returns the index to the pre-computation cache. If no pre-computation cache was found the method will create one and return the index to that cache.
Definition at line 342 of file GModelSpatialRadialProfile.cpp.
References GNodeArray::append(), GNodeArray::clear(), m_coord_indep, m_num_nodes, GModelSpatial::m_pars, m_profile, mc(), GModelSpatialRadialProfile::profile::mc, GModelSpatialRadialProfile::profile::mc_max, GModelSpatialRadialProfile::profile::nodes, norm(), GModelSpatialRadialProfile::profile::pars, profile_value(), sin(), theta_max(), theta_min(), gammalib::twopi, and GModelSpatialRadialProfile::profile::values.
|
pure virtual |
Return class name.
Returns the class name for non-abstract classes in a human readable way.
Implements GModelSpatialRadial.
Implemented in GModelSpatialRadialProfileDMBurkert, GModelSpatialRadialProfileDMEinasto, GModelSpatialRadialProfileDMZhao, and GModelSpatialRadialProfileGauss.
|
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 GModelSpatialRadial.
Implemented in GModelSpatialRadialProfileDMBurkert, GModelSpatialRadialProfileDMEinasto, GModelSpatialRadialProfileDMZhao, and GModelSpatialRadialProfileGauss.
|
pure virtual |
Clones object.
Creates a deep copy of the object and returns a pointer to the object.
Implements GModelSpatialRadial.
Implemented in GModelSpatialRadialProfileDMBurkert, GModelSpatialRadialProfileDMEinasto, GModelSpatialRadialProfileDMZhao, and GModelSpatialRadialProfileGauss.
|
virtual |
Checks where model contains specified sky direction.
[in] | dir | Sky direction. |
[in] | margin | Margin to be added to sky direction (degrees) |
Signals whether a sky direction is contained in the radial disk model.
Implements GModelSpatialRadial.
Definition at line 271 of file GModelSpatialRadialProfile.cpp.
References gammalib::deg2rad, GModelSpatialRadial::dir(), GSkyDir::dist(), theta_max(), and theta_min().
|
protected |
Copy class members.
[in] | model | Radial disk model. |
Definition at line 311 of file GModelSpatialRadialProfile.cpp.
References m_coord_indep, m_num_nodes, and m_profile.
Referenced by GModelSpatialRadialProfile(), and operator=().
|
virtual |
Evaluate function (in units of sr^-1)
[in] | theta | Angular distance from model centre (radians). |
[in] | energy | Photon energy. |
[in] | time | Photon arrival time. |
[in] | gradients | Compute gradients? |
Evaluate the radial profile model for a given angular distance theta
the model centre, a given photon energy
and a given time
. The method evaluates the model by linear interpolation.
Implements GModelSpatialRadial.
Definition at line 189 of file GModelSpatialRadialProfile.cpp.
References cache_index(), gammalib::is_infinite(), gammalib::is_notanumber(), and m_profile.
|
protected |
Delete class members.
Definition at line 326 of file GModelSpatialRadialProfile.cpp.
Referenced by GModelSpatialRadialProfileGauss::clear(), GModelSpatialRadialProfileDMEinasto::clear(), GModelSpatialRadialProfileDMZhao::clear(), GModelSpatialRadialProfileDMBurkert::clear(), operator=(), and ~GModelSpatialRadialProfile().
|
protected |
Initialise class members.
Definition at line 292 of file GModelSpatialRadialProfile.cpp.
References m_coord_indep, m_num_nodes, and m_profile.
Referenced by GModelSpatialRadialProfileGauss::clear(), GModelSpatialRadialProfileDMEinasto::clear(), GModelSpatialRadialProfileDMZhao::clear(), GModelSpatialRadialProfileDMBurkert::clear(), GModelSpatialRadialProfile(), and operator=().
|
virtual |
Return MC sky direction.
[in] | energy | Photon energy. |
[in] | time | Photon arrival time. |
[in,out] | ran | Random number generator. |
Draws an arbitrary sky direction from the radial profile using a rejection method.
Implements GModelSpatialRadial.
Definition at line 231 of file GModelSpatialRadialProfile.cpp.
References cache_index(), GModelSpatialRadial::dir(), m_profile, gammalib::rad2deg, GSkyDir::rotate_deg(), theta_max(), theta_min(), and GRan::uniform().
Referenced by cache_index().
|
inline |
Return number of nodes.
Returns the number of nodes in the radial profile.
Definition at line 119 of file GModelSpatialRadialProfile.hpp.
References m_num_nodes.
|
inline |
Set number of nodes.
[in] | number | Number of nodes. |
Sets the number of nodes in the radial profile.
Definition at line 133 of file GModelSpatialRadialProfile.hpp.
References m_num_nodes, and gammalib::number().
|
virtual |
Assignment operator.
[in] | model | Radial profile model. |
Assigns radial profile model.
Definition at line 146 of file GModelSpatialRadialProfile.cpp.
References copy_members(), free_members(), init_members(), and GModelSpatialRadial::operator=().
Referenced by GModelSpatialRadialProfileGauss::operator=(), GModelSpatialRadialProfileDMEinasto::operator=(), GModelSpatialRadialProfileDMZhao::operator=(), and GModelSpatialRadialProfileDMBurkert::operator=().
|
pure virtual |
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 GModelSpatialRadial.
Implemented in GModelSpatialRadialProfileDMBurkert, GModelSpatialRadialProfileDMEinasto, GModelSpatialRadialProfileDMZhao, and GModelSpatialRadialProfileGauss.
|
protectedpure virtual |
Implemented in GModelSpatialRadialProfileDMZhao, GModelSpatialRadialProfileDMEinasto, GModelSpatialRadialProfileDMBurkert, and GModelSpatialRadialProfileGauss.
Referenced by cache_index().
|
protectedvirtual |
Set boundary sky region.
Implements GModelSpatialRadial.
Definition at line 441 of file GModelSpatialRadialProfile.cpp.
References GModelSpatialRadial::dir(), GModelSpatial::m_region, gammalib::rad2deg, GModelSpatial::region(), and theta_max().
|
pure virtual |
Implements GModelSpatialRadial.
Implemented in GModelSpatialRadialProfileDMBurkert, GModelSpatialRadialProfileDMEinasto, GModelSpatialRadialProfileDMZhao, and GModelSpatialRadialProfileGauss.
Referenced by cache_index(), contains(), mc(), and set_region().
|
pure virtual |
Implemented in GModelSpatialRadialProfileDMBurkert, GModelSpatialRadialProfileDMEinasto, GModelSpatialRadialProfileDMZhao, and GModelSpatialRadialProfileGauss.
Referenced by cache_index(), contains(), and mc().
|
protected |
True if model independent of sky coordinates.
Definition at line 94 of file GModelSpatialRadialProfile.hpp.
Referenced by cache_index(), copy_members(), GModelSpatialRadialProfileGauss::init_members(), and init_members().
|
protected |
Number of profile nodes.
Definition at line 95 of file GModelSpatialRadialProfile.hpp.
Referenced by cache_index(), copy_members(), init_members(), and num_nodes().
|
mutableprotected |
Pre-computation cache.
Definition at line 107 of file GModelSpatialRadialProfile.hpp.
Referenced by cache_index(), copy_members(), eval(), init_members(), and mc().