aboutsummaryrefslogtreecommitdiffstats
path: root/mass_profile/analyze_lx.py
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/analyze_lx.py
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/analyze_lx.py')
-rwxr-xr-xmass_profile/analyze_lx.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/mass_profile/analyze_lx.py b/mass_profile/analyze_lx.py
new file mode 100755
index 0000000..c3d4030
--- /dev/null
+++ b/mass_profile/analyze_lx.py
@@ -0,0 +1,32 @@
+#!/usr/bin/env python
+
+import sys
+import math
+import numpy
+
+lx1_array=[]
+lx2_array=[]
+lx3_array=[]
+for i in open('summary_lx.dat'):
+ x1,x2,x3=i.split()
+ x1=float(x1)
+ x2=float(x2)
+ x3=float(x3)
+ lx1_array.append(x1)
+ lx2_array.append(x2)
+ lx3_array.append(x3)
+
+
+lx1_array=numpy.array(lx1_array)
+lx2_array=numpy.array(lx2_array)
+lx3_array=numpy.array(lx3_array)
+
+
+f=open('lx_result.txt','w')
+f.write("Lx(bolo)= %4.2E +/- %4.2E erg/s\n"%(lx1_array[0],lx1_array.std()))
+print("Lx(bolo)= %4.2E +/- %4.2E erg/s"%(lx1_array[0],lx1_array.std()))
+f.write("Lx(0.7-7)= %4.2E +/- %4.2E erg/s\n"%(lx2_array[0],lx2_array.std()))
+print("Lx(0.7-7)= %4.2E +/- %4.2E erg/s"%(lx2_array[0],lx2_array.std()))
+f.write("Lx(0.1-2.4)= %4.2E +/- %4.2E erg/s\n"%(lx3_array[0],lx3_array.std()))
+print("Lx(0.1-2.4)= %4.2E +/- %4.2E erg/s"%(lx3_array[0],lx3_array.std()))
+