45 #define G_READ "GModelSpatialRadialProfileDMZhao::read(GXmlElement&)"
46 #define G_WRITE "GModelSpatialRadialProfileDMZhao::write(GXmlElement&)"
153 if (
this != &model) {
261 if (theta_max < theta) {
427 result.append(
"=== GModelSpatialRadialProfileDMZhao ===");
432 for (
int i = 0; i <
size(); ++i) {
649 integral.max_iter(25);
654 std::vector<double> bounds;
655 bounds.push_back(los_min);
656 bounds.push_back(los_max);
660 double value = integral.romberg(bounds);
709 double g = los * los;
808 const double minradian = 0.0;
809 const int npoints = 200;
813 double dr = (angle - minradian) / npoints;
816 for (
int i = 0; i < npoints; ++i) {
817 double r = minradian + (i * dr);
virtual double theta_min(void) const
Return minimum model radius (in radians)
double scale_radius(void) const
Return scale radius.
GModelPar m_alpha
Power index, inverse transition region width.
GModelPar m_beta
Power index, slope at >> m_scale_radius.
const std::string & name(void) const
Return parameter name.
GModelPar m_gamma
Power index, slope at << m_scale_radius.
virtual void read(const GXmlElement &xml)
Read model from XML element.
XML element node class interface definition.
double gradient(void) const
Return parameter gradient.
int size(void) const
Return number of parameters.
void free_members(void)
Delete class members.
void write(GXmlElement &xml) const
Set or update parameter attributes in XML element.
GVector cos(const GVector &vector)
Computes cosine of vector elements.
virtual GModelSpatialRadialProfileDMZhao * clone(void) const
Clone radial DMZhao profile model.
GModelPar m_scale_radius
Scale radius of halo profile.
double max(void) const
Return parameter maximum boundary.
const GModelSpatialRadialDisk g_radial_disk_seed
virtual void clear(void)
Clear radial DMZhao profile model.
GIntegral class interface definition.
Interface definition for the spatial model registry class.
double min(void) const
Return parameter minimum boundary.
void init_members(void)
Initialise class members.
virtual void write(GXmlElement &xml) const
Write model into XML element.
void init_members(void)
Initialise class members.
const double & scale(void) const
Return parameter scale.
GVector sqrt(const GVector &vector)
Computes square root of vector elements.
bool has_grad(void) const
Signal if parameter gradient is computed analytically.
void free_members(void)
Delete class members.
void free_members(void)
Delete class members.
void free(void)
Free a parameter.
double mass_density(const double &radius) const
Calculate Halo Mass Density.
std::vector< GModelPar * > m_pars
Parameter pointers.
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.
virtual GModelSpatialRadialProfileDMZhao & operator=(const GModelSpatialRadialProfileDMZhao &model)
Assignment operator.
Dark Matter Zhao profile model class interface definition.
double angle(const GVector &a, const GVector &b)
Computes angle between vectors.
virtual double profile_value(const double &theta) const
Radial profile.
std::string type(void) const
Return model type.
void xml_check_parnum(const std::string &origin, const GXmlElement &xml, const int &number)
Checks number of parameters.
void copy_members(const GModelSpatialRadialProfileDMZhao &model)
Copy class members.
GModelPar m_core_radius
Core radius.
void init_members(void)
Initialise class members.
void update(void) const
Update precomputation cache.
virtual void write(GXmlElement &xml) const
Write model into XML element.
double m_last_scale_radius
GModelPar m_scale_density
Scale density of halo profile.
double m_last_scale_density
void free_members(void)
Delete class members.
GModelPar m_halo_distance
Distance from earth to halo center.
std::string m_type
Spatial model type.
double jfactor(const double &angle) const
Calculate J-factor.
GModelSpatialRadialProfileDMZhao(void)
Void constructor.
void read(const GXmlElement &xml)
Extract parameter attributes from XML element.
double value(void) const
Return parameter value.
virtual GModelSpatialRadialProfile & operator=(const GModelSpatialRadialProfile &model)
Assignment operator.
double scale_density(void) const
Return scale density.
GVector pow(const GVector &vector, const double &power)
Computes tanh of vector elements.
const std::string & unit(void) const
Return parameter unit.
Exception handler interface definition.
GModelPar m_theta_min
Minimum theta angle.
virtual double theta_max(void) const
Return maximum model radius (in radians)
void init_members(void)
Initialise class members.
double m_scale_density_squared
virtual ~GModelSpatialRadialProfileDMZhao(void)
Destructor.
std::string parformat(const std::string &s, const int &indent=0)
Convert string in parameter format.
GVector atan(const GVector &vector)
Computes arctan of vector elements.
double eval(const double &los)
Kernel for zhao halo density profile squared.
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.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print information.
Mathematical function definitions.
GModelPar m_theta_max
Maximum theta angle.
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.