GammaLib
2.0.0
|
Abstract radial spatial model base class. More...
#include <GModelSpatialRadial.hpp>
Public Member Functions | |
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 void | clear (void)=0 |
Clear object. More... | |
virtual GModelSpatialRadial * | clone (void) const =0 |
Clones object. More... | |
virtual std::string | classname (void) const =0 |
Return class name. More... | |
virtual double | eval (const double &theta, const GEnergy &energy, const GTime &time, const bool &gradients=false) const =0 |
virtual GSkyDir | mc (const GEnergy &energy, const GTime &time, GRan &ran) const =0 |
virtual bool | contains (const GSkyDir &dir, const double &margin=0.0) 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 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 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... | |
virtual void | set_region (void) const =0 |
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_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... | |
Abstract radial spatial model base class.
This class defines the interface for a radial model as spatial component of the factorized source model. Typical examples of radial components are axisymmetric Disk, Gaussian or Shell sources.
Definition at line 55 of file GModelSpatialRadial.hpp.
GModelSpatialRadial::GModelSpatialRadial | ( | void | ) |
GModelSpatialRadial::GModelSpatialRadial | ( | const GModelSpatialRadial & | model | ) |
Copy constructor.
[in] | model | Radial spatial model. |
Definition at line 92 of file GModelSpatialRadial.cpp.
References copy_members(), and init_members().
|
explicit |
XML constructor.
[in] | xml | XML element. |
Constructs a radial spatial 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 73 of file GModelSpatialRadial.cpp.
References init_members(), and read().
|
virtual |
|
pure virtual |
Return class name.
Returns the class name for non-abstract classes in a human readable way.
Implements GModelSpatial.
Implemented in GModelSpatialRadialShell, GModelSpatialRadialDisk, GModelSpatialRadialGeneralGauss, GModelSpatialRadialRing, GModelSpatialRadialGauss, GModelSpatialRadialProfile, 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 GModelSpatial.
Implemented in GModelSpatialRadialShell, GModelSpatialRadialDisk, GModelSpatialRadialGeneralGauss, GModelSpatialRadialRing, GModelSpatialRadialGauss, GModelSpatialRadialProfile, GModelSpatialRadialProfileDMBurkert, GModelSpatialRadialProfileDMEinasto, GModelSpatialRadialProfileDMZhao, and GModelSpatialRadialProfileGauss.
|
pure virtual |
Clones object.
Creates a deep copy of the object and returns a pointer to the object.
Implements GModelSpatial.
Implemented in GModelSpatialRadialShell, GModelSpatialRadialDisk, GModelSpatialRadialGeneralGauss, GModelSpatialRadialRing, GModelSpatialRadialGauss, GModelSpatialRadialProfile, GModelSpatialRadialProfileDMBurkert, GModelSpatialRadialProfileDMEinasto, GModelSpatialRadialProfileDMZhao, and GModelSpatialRadialProfileGauss.
|
inlinevirtual |
Return class code.
Returns the code GModelSpatialRadial of the class.
Implements GModelSpatial.
Definition at line 125 of file GModelSpatialRadial.hpp.
References GMODEL_SPATIAL_RADIAL.
|
pure virtual |
Implements GModelSpatial.
Implemented in GModelSpatialRadialShell, GModelSpatialRadialDisk, GModelSpatialRadialGeneralGauss, GModelSpatialRadialRing, GModelSpatialRadialGauss, and GModelSpatialRadialProfile.
|
inline |
Return coordinate system.
Returns "CEL" for a celestial coordinate system and "GAL" for a Galactic coordinate system.
Definition at line 190 of file GModelSpatialRadial.hpp.
References is_celestial().
Referenced by cta_psf_radial_kerns_delta::cta_psf_radial_kerns_delta().
|
protected |
Copy class members.
[in] | model | Radial spatial model. |
Definition at line 399 of file GModelSpatialRadial.cpp.
References m_dir, m_last_lat, m_last_lon, m_lat, m_lon, and GModelSpatial::m_pars.
Referenced by GModelSpatialRadial(), and operator=().
const GSkyDir & GModelSpatialRadial::dir | ( | void | ) | const |
Return position of radial spatial model.
Returns the sky direction of the radial spatial model.
Definition at line 297 of file GModelSpatialRadial.cpp.
References is_celestial(), GSkyDir::lb_deg(), m_dir, m_last_lat, m_last_lon, m_lat, m_lon, GSkyDir::radec_deg(), and GOptimizerPar::value().
Referenced by GModelSpatialRadialProfile::contains(), GModelSpatialRadialGauss::contains(), GModelSpatialRadialGeneralGauss::contains(), GModelSpatialRadialDisk::contains(), GModelSpatialRadialRing::contains(), GModelSpatialRadialShell::contains(), cta_psf_radial_kerns_delta::cta_psf_radial_kerns_delta(), eval(), GModelSpatialRadialDisk::GModelSpatialRadialDisk(), GModelSpatialRadialGauss::GModelSpatialRadialGauss(), GModelSpatialRadialGeneralGauss::GModelSpatialRadialGeneralGauss(), GModelSpatialRadialProfileGauss::GModelSpatialRadialProfileGauss(), GModelSpatialRadialRing::GModelSpatialRadialRing(), GModelSpatialRadialShell::GModelSpatialRadialShell(), GCOMResponse::irf_radial(), GResponse::irf_radial(), GCTAResponseCube::irf_radial(), GCTAResponseIrf::irf_radial(), GModelSpatialRadialProfile::mc(), GModelSpatialRadialGauss::mc(), GModelSpatialRadialGeneralGauss::mc(), GModelSpatialRadialDisk::mc(), GModelSpatialRadialRing::mc(), GModelSpatialRadialShell::mc(), mc_norm(), GCTAResponseIrf::nroi_radial(), GModelSpatialRadialProfile::set_region(), GModelSpatialRadialGauss::set_region(), GModelSpatialRadialDisk::set_region(), GModelSpatialRadialGeneralGauss::set_region(), GModelSpatialRadialRing::set_region(), and GModelSpatialRadialShell::set_region().
void GModelSpatialRadial::dir | ( | const GSkyDir & | dir | ) |
Set position of radial spatial model.
[in] | dir | Sky direction of radial spatial model. |
Sets the sky direction of the radial spatial model.
Definition at line 333 of file GModelSpatialRadial.cpp.
References GSkyDir::b_deg(), GSkyDir::dec_deg(), is_celestial(), GSkyDir::l_deg(), m_lat, m_lon, GSkyDir::ra_deg(), and GOptimizerPar::value().
|
pure virtual |
Implemented in GModelSpatialRadialShell, GModelSpatialRadialDisk, GModelSpatialRadialGeneralGauss, GModelSpatialRadialRing, GModelSpatialRadialGauss, and GModelSpatialRadialProfile.
Referenced by com_radial_kerns_rho::eval(), eval(), cta_psf_radial_kerns_phi::eval(), cta_irf_radial_kern_rho::eval(), cta_nroi_radial_kern_rho::eval(), cta_psf_radial_kern_rho::eval(), and cta_psf_radial_kern_phi::eval().
|
virtual |
Return model value.
[in] | photon | Incident Photon. |
[in] | gradients | Compute gradients? |
Evaluates the radial spatial model value for a specific incident photon
.
If the gradients
flag is true the method will also compute the parameter gradients for all model parameters.
Implements GModelSpatial.
Definition at line 174 of file GModelSpatialRadial.cpp.
References GPhoton::dir(), dir(), GSkyDir::dist(), GPhoton::energy(), eval(), and GPhoton::time().
|
protected |
Delete class members.
Definition at line 423 of file GModelSpatialRadial.cpp.
Referenced by GModelSpatialRadialProfileGauss::clear(), GModelSpatialRadialProfileDMBurkert::clear(), GModelSpatialRadialProfileDMZhao::clear(), GModelSpatialRadialProfileDMEinasto::clear(), GModelSpatialRadialGauss::clear(), GModelSpatialRadialRing::clear(), GModelSpatialRadialDisk::clear(), GModelSpatialRadialGeneralGauss::clear(), GModelSpatialRadialShell::clear(), operator=(), and ~GModelSpatialRadial().
|
protected |
Initialise class members.
Definition at line 359 of file GModelSpatialRadial.cpp.
References GSkyDir::clear(), GOptimizerPar::clear(), GOptimizerPar::fix(), GOptimizerPar::gradient(), GOptimizerPar::has_grad(), m_dir, m_last_lat, m_last_lon, m_lat, m_lon, GModelSpatial::m_pars, GOptimizerPar::name(), GOptimizerPar::scale(), and GOptimizerPar::unit().
Referenced by GModelSpatialRadialProfileGauss::clear(), GModelSpatialRadialProfileDMBurkert::clear(), GModelSpatialRadialProfileDMZhao::clear(), GModelSpatialRadialProfileDMEinasto::clear(), GModelSpatialRadialGauss::clear(), GModelSpatialRadialRing::clear(), GModelSpatialRadialDisk::clear(), GModelSpatialRadialGeneralGauss::clear(), GModelSpatialRadialShell::clear(), GModelSpatialRadial(), and operator=().
|
inlineprotected |
Check if model holds celestial coordinates.
Definition at line 202 of file GModelSpatialRadial.hpp.
References m_lon, and GOptimizerPar::name().
Referenced by coordsys(), and dir().
|
inlinevirtual |
Signals whether radial model is energy dependent.
Signals whether the radial model is energy dependent. This method always returns false.
Definition at line 140 of file GModelSpatialRadial.hpp.
|
inlinevirtual |
Signals whether radial model is time dependent.
Signals whether the radial model is time dependent. This method always returns false.
Definition at line 155 of file GModelSpatialRadial.hpp.
|
pure virtual |
Implements GModelSpatial.
Implemented in GModelSpatialRadialShell, GModelSpatialRadialDisk, GModelSpatialRadialGeneralGauss, GModelSpatialRadialRing, GModelSpatialRadialGauss, and GModelSpatialRadialProfile.
|
inlinevirtual |
Return normalization of radial source for Monte Carlo simulations.
[in] | dir | Centre of simulation cone. |
[in] | radius | Radius of simulation cone (degrees). |
Returns the normalization for a radial source within a circular region. The normalization is 1 if the radial source falls within the circle defined by dir
and radius
, 0 otherwise.
Implements GModelSpatial.
Definition at line 173 of file GModelSpatialRadial.hpp.
References dir(), GSkyDir::dist_deg(), norm(), and theta_max().
|
virtual |
Assignment operator.
[in] | model | Radial spatial model. |
Definition at line 131 of file GModelSpatialRadial.cpp.
References copy_members(), free_members(), init_members(), and GModelSpatial::operator=().
Referenced by GModelSpatialRadialProfile::operator=(), GModelSpatialRadialGauss::operator=(), GModelSpatialRadialRing::operator=(), GModelSpatialRadialDisk::operator=(), GModelSpatialRadialGeneralGauss::operator=(), and GModelSpatialRadialShell::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 GModelSpatial.
Implemented in GModelSpatialRadialShell, GModelSpatialRadialRing, GModelSpatialRadialDisk, GModelSpatialRadialGeneralGauss, GModelSpatialRadialGauss, GModelSpatialRadialProfileDMBurkert, GModelSpatialRadialProfileDMEinasto, GModelSpatialRadialProfileDMZhao, GModelSpatialRadialProfileGauss, and GModelSpatialRadialProfile.
|
virtual |
Read model from XML element.
[in] | xml | XML element. |
GException::model_invalid_parnum | Invalid number of model parameters found in XML element. |
GException::model_invalid_parnames | Invalid model parameter names found in XML element. |
Reads the radial source location and position angle information from an XML element in the following format
<spatialModel type="..."> <parameter name="RA" scale="1" value="83.6331" min="-360" max="360" free="0" /> <parameter name="DEC" scale="1" value="22.0145" min="-90" max="90" free="0" /> ... </spatialModel>
or
<spatialModel type="..."> <parameter name="GLON" scale="1" value="184.5575" min="-360" max="360" free="0" /> <parameter name="GLAT" scale="1" value="-5.7843" min="-90" max="90" free="0" /> ... </spatialModel>
Implements GModelSpatial.
Reimplemented in GModelSpatialRadialShell, GModelSpatialRadialRing, GModelSpatialRadialDisk, GModelSpatialRadialGeneralGauss, GModelSpatialRadialGauss, GModelSpatialRadialProfileDMBurkert, GModelSpatialRadialProfileDMEinasto, GModelSpatialRadialProfileDMZhao, and GModelSpatialRadialProfileGauss.
Definition at line 216 of file GModelSpatialRadial.cpp.
References G_READ, m_lat, m_lon, GModelPar::read(), gammalib::xml_get_par(), and gammalib::xml_has_par().
Referenced by GModelSpatialRadial(), GModelSpatialRadialProfile::GModelSpatialRadialProfile(), GModelSpatialRadialProfileGauss::read(), GModelSpatialRadialProfileDMZhao::read(), GModelSpatialRadialProfileDMBurkert::read(), GModelSpatialRadialProfileDMEinasto::read(), GModelSpatialRadialGauss::read(), GModelSpatialRadialDisk::read(), GModelSpatialRadialGeneralGauss::read(), GModelSpatialRadialRing::read(), and GModelSpatialRadialShell::read().
|
protectedpure virtual |
Implements GModelSpatial.
Implemented in GModelSpatialRadialShell, GModelSpatialRadialRing, GModelSpatialRadialGeneralGauss, GModelSpatialRadialDisk, GModelSpatialRadialGauss, and GModelSpatialRadialProfile.
|
pure virtual |
Implemented in GModelSpatialRadialShell, GModelSpatialRadialRing, GModelSpatialRadialDisk, GModelSpatialRadialGeneralGauss, GModelSpatialRadialGauss, GModelSpatialRadialProfile, GModelSpatialRadialProfileDMBurkert, GModelSpatialRadialProfileDMEinasto, GModelSpatialRadialProfileDMZhao, and GModelSpatialRadialProfileGauss.
Referenced by cta_irf_radial_kern_rho::eval(), cta_nroi_radial_kern_rho::eval(), cta_psf_radial_kern_rho::eval(), cta_psf_radial_kern_phi::eval(), GCOMResponse::irf_radial(), GResponse::irf_radial(), GCTAResponseIrf::irf_radial(), mc_norm(), GCTAResponseIrf::nroi_radial(), and GCTAResponseCube::psf_radial().
|
virtual |
Write model into XML element.
[in] | xml | XML element into which model information is written. |
Depending on the coordinate system, write the radial source information into an XML element with the following format
<spatialModel type="..."> <parameter name="RA" scale="1" value="83.6331" min="-360" max="360" free="0" /> <parameter name="DEC" scale="1" value="22.0145" min="-90" max="90" free="0" /> ... </spatialModel>
or
<spatialModel type="PointSource"> <parameter name="GLON" scale="1" value="184.5575" min="-360" max="360" free="0" /> <parameter name="GLAT" scale="1" value="-5.7843" min="-90" max="90" free="0" /> ... </spatialModel>
Implements GModelSpatial.
Reimplemented in GModelSpatialRadialShell, GModelSpatialRadialRing, GModelSpatialRadialDisk, GModelSpatialRadialGeneralGauss, GModelSpatialRadialGauss, GModelSpatialRadialProfileDMBurkert, GModelSpatialRadialProfileDMEinasto, GModelSpatialRadialProfileDMZhao, and GModelSpatialRadialProfileGauss.
Definition at line 272 of file GModelSpatialRadial.cpp.
References G_WRITE, m_lat, m_lon, GOptimizerPar::name(), GModelSpatial::type(), GModelPar::write(), gammalib::xml_check_type(), and gammalib::xml_need_par().
Referenced by GModelSpatialRadialProfileGauss::write(), GModelSpatialRadialProfileDMEinasto::write(), GModelSpatialRadialProfileDMBurkert::write(), GModelSpatialRadialProfileDMZhao::write(), GModelSpatialRadialGauss::write(), GModelSpatialRadialDisk::write(), GModelSpatialRadialGeneralGauss::write(), GModelSpatialRadialRing::write(), and GModelSpatialRadialShell::write().
|
mutableprotected |
Sky direction representing parameters.
Definition at line 111 of file GModelSpatialRadial.hpp.
Referenced by copy_members(), dir(), and init_members().
|
mutableprotected |
Last latitude.
Definition at line 113 of file GModelSpatialRadial.hpp.
Referenced by copy_members(), dir(), and init_members().
|
mutableprotected |
Last longitude.
Definition at line 112 of file GModelSpatialRadial.hpp.
Referenced by copy_members(), dir(), and init_members().
|
protected |
Declination or Galactic latitude (deg)
Definition at line 108 of file GModelSpatialRadial.hpp.
Referenced by copy_members(), dir(), GModelSpatialRadialGauss::eval(), GModelSpatialRadialDisk::GModelSpatialRadialDisk(), GModelSpatialRadialGauss::GModelSpatialRadialGauss(), GModelSpatialRadialGeneralGauss::GModelSpatialRadialGeneralGauss(), GModelSpatialRadialRing::GModelSpatialRadialRing(), GModelSpatialRadialShell::GModelSpatialRadialShell(), GModelSpatialRadialGauss::init_members(), init_members(), read(), and write().
|
protected |
Right Ascension or Galactic longitude (deg)
Definition at line 107 of file GModelSpatialRadial.hpp.
Referenced by copy_members(), dir(), GModelSpatialRadialGauss::eval(), GModelSpatialRadialDisk::GModelSpatialRadialDisk(), GModelSpatialRadialGauss::GModelSpatialRadialGauss(), GModelSpatialRadialGeneralGauss::GModelSpatialRadialGeneralGauss(), GModelSpatialRadialRing::GModelSpatialRadialRing(), GModelSpatialRadialShell::GModelSpatialRadialShell(), GModelSpatialRadialGauss::init_members(), init_members(), is_celestial(), read(), and write().