44 #if defined(G_LEGACY_XML_FORMAT)
50 #define G_CONSTRUCTOR1 "GModelSpatialPointSource::GModelSpatialPointSource("\
51 "GSkyDir&, std::string&)"
52 #define G_CONSTRUCTOR2 "GModelSpatialPointSource::GModelSpatialPointSource("\
53 "double&, double&, std::string&)"
54 #define G_READ "GModelSpatialPointSource::read(GXmlElement&)"
55 #define G_WRITE "GModelSpatialPointSource::write(GXmlElement&)"
94 const std::string& type) :
122 const std::string& coordsys) :
126 if ((coordsys !=
"CEL") && (coordsys !=
"GAL")) {
127 std::string msg =
"Invalid coordinate system \""+coordsys+
"\" "
128 "specified. Please specify either \"CEL\" or "
137 if (coordsys ==
"CEL") {
173 const std::string& coordsys) :
177 if ((coordsys !=
"CEL") && (coordsys !=
"GAL")) {
178 std::string msg =
"Invalid coordinate system \""+coordsys+
"\" "
179 "specified. Please specify either \"CEL\" or "
188 if (coordsys ==
"CEL") {
276 if (
this != &model) {
350 const bool& gradients)
const
392 const double& margin)
const
395 double distance = dir.
dist(this->
dir());
512 const GTime& srcTime)
const
518 if (this->
region()->overlaps(region)) {
542 result.append(
"=== GModelSpatialPointSource ===");
547 for (
int i = 0; i <
size(); ++i) {
void free_members(void)
Delete class members.
double dist_deg(const GSkyDir &dir) const
Compute angular distance between sky directions in degrees.
double m_last_lat
Last latitude.
double dec_deg(void) const
Returns Declination in degrees.
Point source spatial model class interface definition.
const std::string & name(void) const
Return parameter name.
double gradient(void) const
Return parameter gradient.
const GSkyDir & dir(void) const
Return position of point source.
int size(void) const
Return number of parameters.
void write(GXmlElement &xml) const
Set or update parameter attributes in XML element.
virtual GModelSpatialPointSource * clone(void) const
Clone point source model.
virtual GModelSpatial & operator=(const GModelSpatial &model)
Assignment operator.
virtual double eval(const GPhoton &photon, const bool &gradients=false) const
Evaluate function.
Random number generator class.
GModelPar m_lon
Right Ascension or Galactic longitude (deg)
Interface for the circular sky region class.
double m_last_lon
Last longitude.
virtual void clear(void)
Clear point source model.
Interface definition for the spatial model registry class.
GSkyRegionCircle m_region
Bounding circle.
void copy_members(const GModelSpatialPointSource &model)
Copy class members.
Class that handles photons.
const double & scale(void) const
Return parameter scale.
bool has_grad(void) const
Signal if parameter gradient is computed analytically.
Abstract interface for the sky region class.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print point source information.
virtual ~GModelSpatialPointSource(void)
Destructor.
virtual void write(GXmlElement &xml) const
Write model into XML element.
virtual GSkyDir mc(const GEnergy &energy, const GTime &time, GRan &ran) const
Returns MC sky direction.
std::vector< GModelPar * > m_pars
Parameter pointers.
virtual double flux(const GSkyRegion ®ion, const GEnergy &srcEng=GEnergy(), const GTime &srcTime=GTime()) const
Returns model flux integrated in sky region.
void fix(void)
Fix a parameter.
GXmlElement * xml_need_par(const std::string &origin, GXmlElement &xml, const std::string &name)
Return pointer to parameter with given name in XML element.
virtual void read(const GXmlElement &xml)
Read model from XML element.
void clear(void)
Clear parameter.
Spatial model registry class definition.
double ra_deg(void) const
Returns Right Ascension in degrees.
bool is_celestial(void) const
Check if model holds celestial coordinates.
std::string type(void) const
Return model type.
void radec_deg(const double &ra, const double &dec)
Set equatorial sky direction (degrees)
void xml_check_parnum(const std::string &origin, const GXmlElement &xml, const int &number)
Checks number of parameters.
const GModelSpatialPointSource g_spatial_ptsrc_seed
Point source spatial model.
bool xml_has_par(const GXmlElement &xml, const std::string &name)
Checks if parameter with given name in XML element exists.
const GSkyRegion * region(void) const
Return boundary sky region.
void clear(void)
Clear sky direction.
void free_members(void)
Delete class members.
virtual bool contains(const GSkyDir &dir, const double &margin=0.0) const
Checks where model contains specified sky direction.
std::string m_type
Spatial model type.
void read(const GXmlElement &xml)
Extract parameter attributes from XML element.
double value(void) const
Return parameter value.
GSkyDir m_dir
Sky direction representing parameters.
const std::string & unit(void) const
Return parameter unit.
void lb_deg(const double &l, const double &b)
Set galactic sky direction (degrees)
Exception handler interface definition.
double dist(const GSkyDir &dir) const
Compute angular distance between sky directions in radians.
GModelSpatialPointSource(void)
Void constructor.
void init_members(void)
Initialise class members.
Abstract spatial model base class.
virtual void set_region(void) const
Set boundary sky region.
void init_members(void)
Initialise class members.
virtual GModelSpatialPointSource & operator=(const GModelSpatialPointSource &model)
Assignment operator.
double l_deg(void) const
Return galactic longitude in degrees.
double b_deg(void) const
Returns galactic latitude in degrees.
std::string parformat(const std::string &s, const int &indent=0)
Convert string in parameter format.
const GSkyDir & dir(void) const
Return photon sky direction.
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.
GModelPar m_lat
Declination or Galactic latitude (deg)
Mathematical function definitions.
Class that handles energies in a unit independent way.
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.
void xml_check_type(const std::string &origin, GXmlElement &xml, const std::string &type)
Checks the model type.