GammaLib
2.0.0
|
#include <GModelSpatialRadialProfileGauss.hpp>
Public Member Functions | |
GModelSpatialRadialProfileGauss (void) | |
Void constructor. More... | |
GModelSpatialRadialProfileGauss (const GXmlElement &xml) | |
XML constructor. More... | |
GModelSpatialRadialProfileGauss (const GSkyDir &dir, const double &sigma) | |
Constructor. More... | |
GModelSpatialRadialProfileGauss (const GModelSpatialRadialProfileGauss &model) | |
Copy constructor. More... | |
virtual | ~GModelSpatialRadialProfileGauss (void) |
Destructor. More... | |
virtual GModelSpatialRadialProfileGauss & | operator= (const GModelSpatialRadialProfileGauss &model) |
Assignment operator. More... | |
virtual void | clear (void) |
Clear radial Gaussian profile model. More... | |
virtual GModelSpatialRadialProfileGauss * | clone (void) const |
Clone radial Gaussian profile model. More... | |
virtual std::string | classname (void) const |
Return class name. More... | |
virtual double | theta_min (void) const |
Return maximum model radius (in radians) More... | |
virtual double | theta_max (void) const |
Return maximum model radius (in radians) 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... | |
virtual std::string | print (const GChatter &chatter=NORMAL) const |
Print information. More... | |
double | sigma (void) const |
Return Gaussian sigma. More... | |
void | sigma (const double &sigma) |
Set Gaussian sigma. More... | |
Public Member Functions inherited from GModelSpatialRadialProfile | |
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 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... | |
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 GModelSpatialRadialProfileGauss &model) |
Copy class members. More... | |
void | free_members (void) |
Delete class members. More... | |
virtual double | profile_value (const double &theta) const |
Radial profile. More... | |
Protected Member Functions inherited from GModelSpatialRadialProfile | |
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 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 | |
GModelPar | m_sigma |
Gaussian width (deg) More... | |
Protected Attributes inherited from GModelSpatialRadialProfile | |
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 47 of file GModelSpatialRadialProfileGauss.hpp.
GModelSpatialRadialProfileGauss::GModelSpatialRadialProfileGauss | ( | void | ) |
Void constructor.
Constructs empty radial Gaussian profile
Definition at line 66 of file GModelSpatialRadialProfileGauss.cpp.
References init_members().
Referenced by clone().
|
explicit |
XML constructor.
[in] | xml | XML element. |
Constructs radial Gaussian profile model by extracting information from an XML element. See the read() method for more information about the expected structure of the XML element.
Definition at line 86 of file GModelSpatialRadialProfileGauss.cpp.
References init_members(), and read().
GModelSpatialRadialProfileGauss::GModelSpatialRadialProfileGauss | ( | const GSkyDir & | dir, |
const double & | sigma | ||
) |
Constructor.
[in] | dir | Sky position of Gaussian. |
[in] | sigma | Width of Gaussian (in degrees). |
Constructs a Gaussian spatial model using a sky direction (dir
) and a Gaussian width parameter sigma
in degrees.
Definition at line 109 of file GModelSpatialRadialProfileGauss.cpp.
References GModelSpatialRadial::dir(), init_members(), and sigma().
GModelSpatialRadialProfileGauss::GModelSpatialRadialProfileGauss | ( | const GModelSpatialRadialProfileGauss & | model | ) |
Copy constructor.
[in] | model | Radial Gaussian profile model. |
Copies radial Gaussian profile model from another radial profile model.
Definition at line 132 of file GModelSpatialRadialProfileGauss.cpp.
References copy_members(), and init_members().
|
virtual |
Destructor.
Destructs radial Gaussian profile model.
Definition at line 151 of file GModelSpatialRadialProfileGauss.cpp.
References free_members().
|
inlinevirtual |
Return class name.
Implements GModelSpatialRadialProfile.
Definition at line 92 of file GModelSpatialRadialProfileGauss.hpp.
|
virtual |
Clear radial Gaussian profile model.
Clears radial Gaussian profile model.
Implements GModelSpatialRadialProfile.
Definition at line 210 of file GModelSpatialRadialProfileGauss.cpp.
References free_members(), GModelSpatialRadialProfile::free_members(), GModelSpatialRadial::free_members(), GModelSpatial::free_members(), init_members(), GModelSpatialRadialProfile::init_members(), GModelSpatialRadial::init_members(), and GModelSpatial::init_members().
|
virtual |
Clone radial Gaussian profile model.
Returns a deep copy of the radial Gaussian profile model.
Implements GModelSpatialRadialProfile.
Definition at line 236 of file GModelSpatialRadialProfileGauss.cpp.
References GModelSpatialRadialProfileGauss().
|
protected |
Copy class members.
[in] | model | Radial Gaussian model. |
Copies class members from another radial profile model.
Definition at line 409 of file GModelSpatialRadialProfileGauss.cpp.
References m_sigma, and GModelSpatial::m_type.
Referenced by GModelSpatialRadialProfileGauss(), and operator=().
|
protected |
Delete class members.
Definition at line 425 of file GModelSpatialRadialProfileGauss.cpp.
Referenced by clear(), operator=(), and ~GModelSpatialRadialProfileGauss().
|
protected |
Initialise class members.
Definition at line 375 of file GModelSpatialRadialProfileGauss.cpp.
References GOptimizerPar::clear(), GOptimizerPar::free(), GOptimizerPar::gradient(), GOptimizerPar::has_grad(), GModelSpatialRadialProfile::m_coord_indep, GModelSpatial::m_pars, m_sigma, GModelSpatial::m_type, GOptimizerPar::min(), GOptimizerPar::name(), GOptimizerPar::scale(), GOptimizerPar::unit(), and GOptimizerPar::value().
Referenced by clear(), GModelSpatialRadialProfileGauss(), and operator=().
|
virtual |
Assignment operator.
[in] | model | Radial Gaussian profile model. |
Assigns radial Gaussian profile model.
Definition at line 175 of file GModelSpatialRadialProfileGauss.cpp.
References copy_members(), free_members(), init_members(), and GModelSpatialRadialProfile::operator=().
|
virtual |
Print information.
[in] | chatter | Chattiness (defaults to NORMAL). |
Implements GModelSpatialRadialProfile.
Definition at line 341 of file GModelSpatialRadialProfileGauss.cpp.
References GModelSpatial::m_pars, gammalib::parformat(), SILENT, GModelSpatial::size(), and gammalib::str().
|
protectedvirtual |
Radial profile.
[in] | theta | Angular distance from Gaussian centre (radians). |
Implements GModelSpatialRadialProfile.
Definition at line 438 of file GModelSpatialRadialProfileGauss.cpp.
References gammalib::deg2rad, exp(), m_sigma, gammalib::twopi, and GOptimizerPar::value().
|
virtual |
Read model from XML element.
[in] | xml | XML element. |
Reads the Gaussian radial profile model information from an XML element. The XML element shall have either the format
<spatialModel type="GaussianProfile"> <parameter name="RA" scale="1.0" value="83.6331" min="-360" max="360" free="1"/> <parameter name="DEC" scale="1.0" value="22.0145" min="-90" max="90" free="1"/> <parameter name="Sigma" scale="1.0" value="0.45" min="0.01" max="10" free="1"/> </spatialModel>
or
<spatialModel type="GaussianProfile"> <parameter name="GLON" scale="1.0" value="83.6331" min="-360" max="360" free="1"/> <parameter name="GLAT" scale="1.0" value="22.0145" min="-90" max="90" free="1"/> <parameter name="Sigma" scale="1.0" value="0.45" min="0.01" max="10" free="1"/> </spatialModel>
Reimplemented from GModelSpatialRadial.
Definition at line 287 of file GModelSpatialRadialProfileGauss.cpp.
References G_READ, m_sigma, GOptimizerPar::name(), GModelSpatialRadial::read(), GModelPar::read(), gammalib::xml_check_parnum(), and gammalib::xml_get_par().
Referenced by GModelSpatialRadialProfileGauss().
|
inline |
Return Gaussian sigma.
Returns the Gaussian sigma in degrees.
Definition at line 106 of file GModelSpatialRadialProfileGauss.hpp.
References m_sigma, and GOptimizerPar::value().
Referenced by GModelSpatialRadialProfileGauss().
|
inline |
Set Gaussian sigma.
[in] | sigma | Gaussian sigma (degrees). |
Sets the Gaussian sigma in degrees.
Definition at line 120 of file GModelSpatialRadialProfileGauss.hpp.
References m_sigma, and GOptimizerPar::value().
|
virtual |
Return maximum model radius (in radians)
Implements GModelSpatialRadialProfile.
Definition at line 258 of file GModelSpatialRadialProfileGauss.cpp.
References gammalib::deg2rad, m_sigma, and GOptimizerPar::value().
|
virtual |
Return maximum model radius (in radians)
Implements GModelSpatialRadialProfile.
Definition at line 247 of file GModelSpatialRadialProfileGauss.cpp.
|
virtual |
Write model into XML element.
[in] | xml | XML element into which model information is written. |
Writes the Gaussian radial profile model information into an XML element. The XML element will have the format
<spatialModel type="GaussianProfile"> <parameter name="RA" scale="1.0" value="83.6331" min="-360" max="360" free="1"/> <parameter name="DEC" scale="1.0" value="22.0145" min="-90" max="90" free="1"/> <parameter name="Sigma" scale="1.0" value="0.45" min="0.01" max="10" free="1"/> </spatialModel>
Reimplemented from GModelSpatialRadial.
Definition at line 318 of file GModelSpatialRadialProfileGauss.cpp.
References G_WRITE, m_sigma, GOptimizerPar::name(), GModelSpatial::type(), GModelSpatialRadial::write(), GModelPar::write(), gammalib::xml_check_type(), and gammalib::xml_need_par().
|
protected |
Gaussian width (deg)
Definition at line 82 of file GModelSpatialRadialProfileGauss.hpp.
Referenced by copy_members(), init_members(), profile_value(), read(), sigma(), theta_max(), and write().