35#define G_READ "GModelSpatialRadial::read(GXmlElement&)"
36#define G_WRITE "GModelSpatialRadial::write(GXmlElement&)"
134 if (
this != &model) {
175 const bool& gradients)
const
181 double value =
eval(theta, photon.
energy(), photon.
time(), gradients);
Exception handler interface definition.
Abstract radial spatial model base class interface definition.
void write(GXmlElement &xml) const
Set or update parameter attributes in XML element.
void read(const GXmlElement &xml)
Extract parameter attributes from XML element.
Abstract radial spatial model base class.
void free_members(void)
Delete class members.
double m_last_lon
Last longitude.
bool is_celestial(void) const
Check if model holds celestial coordinates.
void copy_members(const GModelSpatialRadial &model)
Copy class members.
double m_last_lat
Last latitude.
GModelPar m_lon
Right Ascension or Galactic longitude (deg)
virtual void write(GXmlElement &xml) const
Write model into XML element.
virtual void read(const GXmlElement &xml)
Read model from XML element.
GModelSpatialRadial(void)
Void constructor.
void init_members(void)
Initialise class members.
GSkyDir m_dir
Sky direction representing parameters.
virtual double eval(const double &theta, const GEnergy &energy, const GTime &time, const bool &gradients=false) const =0
virtual GModelSpatialRadial & operator=(const GModelSpatialRadial &model)
Assignment operator.
const GSkyDir & dir(void) const
Return position of radial spatial model.
GModelPar m_lat
Declination or Galactic latitude (deg)
virtual ~GModelSpatialRadial(void)
Destructor.
Abstract spatial model base class.
std::string type(void) const
Return model type.
std::vector< GModelPar * > m_pars
Parameter pointers.
virtual GModelSpatial & operator=(const GModelSpatial &model)
Assignment operator.
const double & scale(void) const
Return parameter scale.
bool has_grad(void) const
Signal if parameter gradient is computed analytically.
const std::string & unit(void) const
Return parameter unit.
void fix(void)
Fix a parameter.
double gradient(void) const
Return parameter gradient.
void clear(void)
Clear parameter.
double value(void) const
Return parameter value.
const std::string & name(void) const
Return parameter name.
Class that handles photons.
const GTime & time(void) const
Return photon time.
const GSkyDir & dir(void) const
Return photon sky direction.
const GEnergy & energy(void) const
Return photon energy.
void lb_deg(const double &l, const double &b)
Set galactic sky direction (degrees)
double dec_deg(void) const
Returns Declination in degrees.
double ra_deg(void) const
Returns Right Ascension in degrees.
void radec_deg(const double &ra, const double &dec)
Set equatorial sky direction (degrees)
double b_deg(void) const
Returns galactic latitude in degrees.
void clear(void)
Clear sky direction.
double dist(const GSkyDir &dir) const
Compute angular distance between sky directions in radians.
double l_deg(void) const
Return galactic longitude in degrees.
const GXmlElement * xml_get_par(const std::string &origin, const GXmlElement &xml, const std::string &name)
Return pointer to parameter with given name in XML element.
GXmlElement * xml_need_par(const std::string &origin, GXmlElement &xml, const std::string &name)
Return pointer to parameter with given name in XML element.
bool xml_has_par(const GXmlElement &xml, const std::string &name)
Checks if parameter with given name in XML element exists.
void xml_check_type(const std::string &origin, GXmlElement &xml, const std::string &type)
Checks the model type.