aboutsummaryrefslogtreecommitdiffstats
path: root/mass_profile/wang2012_model.hpp
diff options
context:
space:
mode:
authorAaron LI <aaronly.me@gmail.com>2016-05-27 22:47:24 +0800
committerAaron LI <aaronly.me@gmail.com>2016-05-27 22:47:24 +0800
commitffd178e0bd72562a3c2cff9747b6e656edc881dc (patch)
tree8800b7b5b2e8bc3df1a6760df5cd54eaaa686702 /mass_profile/wang2012_model.hpp
parent5c35fad9240fb42c1371c721e0b2af7379bd9ea0 (diff)
downloadchandra-acis-analysis-ffd178e0bd72562a3c2cff9747b6e656edc881dc.tar.bz2
Add mass_profile tools
* These tools are mainly use to calculate the total gravitational mass profile, as well as the intermediate products (e.g., surface brightness profile fitting, gas density profile, NFW fitting, etc.) * There are additional tools for calculating the luminosity and flux. * These tools mainly developed by Junhua GU, and contributed by Weitian (Aaron) LI, and Zhenghao ZHU.
Diffstat (limited to 'mass_profile/wang2012_model.hpp')
-rw-r--r--mass_profile/wang2012_model.hpp67
1 files changed, 67 insertions, 0 deletions
diff --git a/mass_profile/wang2012_model.hpp b/mass_profile/wang2012_model.hpp
new file mode 100644
index 0000000..c678970
--- /dev/null
+++ b/mass_profile/wang2012_model.hpp
@@ -0,0 +1,67 @@
+/**
+ \file wang2012_model.hpp
+ \brief Jingying Wang's model
+ \author Jingying Wang
+ */
+
+
+#ifndef WANG2012_MODEL
+#define WANG2012_MODEL
+#define OPT_HEADER
+#include <core/fitter.hpp>
+#include <cmath>
+
+namespace opt_utilities
+{
+ template <typename T>
+ class wang2012_model
+ :public model<T,T,std::vector<T>,std::string>
+ {
+ private:
+ model<T,T,std::vector<T> >* do_clone()const
+ {
+ return new wang2012_model<T>(*this);
+ }
+
+ const char* do_get_type_name()const
+ {
+ return "1d power law";
+ }
+ public:
+ wang2012_model()
+ {
+ this->push_param_info(param_info<std::vector<T> >("A",5,0,500));
+ this->push_param_info(param_info<std::vector<T> >("n",1.66,0,10));
+ this->push_param_info(param_info<std::vector<T> >("xi",0.45,0,1));
+ this->push_param_info(param_info<std::vector<T> >("a2",1500,0,1e8));
+ this->push_param_info(param_info<std::vector<T> >("a3",50,0,1e8));
+ this->push_param_info(param_info<std::vector<T> >("beta",0.49,0.1,0.7));
+ this->push_param_info(param_info<std::vector<T> >("T0",0,0,10));
+
+ }
+
+ T do_eval(const T& x,const std::vector<T>& param)
+ {
+ T A=param[0];
+ T n=param[1];
+ T xi=param[2];
+ T a2=param[3];
+ T a3=param[4];
+ T beta=param[5];
+ T T0=param[6];
+ return A*(pow(x,n)+xi*a2)/(pow(x,n)+a2)/pow(1+x*x/a3/a3,beta)+T0;
+ //return A*(pow(x,n)+a1)/(pow(x,n)+1)/pow(1+x*x/a3/a3,beta)+T0;
+ }
+
+ private:
+ std::string do_get_information()const
+ {
+ return "";
+ }
+ };
+}
+
+
+
+#endif
+//EOF