diff options
author | Aaron LI <aaronly.me@gmail.com> | 2016-05-27 22:47:24 +0800 |
---|---|---|
committer | Aaron LI <aaronly.me@gmail.com> | 2016-05-27 22:47:24 +0800 |
commit | ffd178e0bd72562a3c2cff9747b6e656edc881dc (patch) | |
tree | 8800b7b5b2e8bc3df1a6760df5cd54eaaa686702 /mass_profile/shuffle_sbp.py | |
parent | 5c35fad9240fb42c1371c721e0b2af7379bd9ea0 (diff) | |
download | chandra-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/shuffle_sbp.py')
-rwxr-xr-x | mass_profile/shuffle_sbp.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/mass_profile/shuffle_sbp.py b/mass_profile/shuffle_sbp.py new file mode 100755 index 0000000..210bfb8 --- /dev/null +++ b/mass_profile/shuffle_sbp.py @@ -0,0 +1,18 @@ +#!/usr/bin/python + +import sys +import scipy + +output_file=open(sys.argv[2],'w') +for i in open(sys.argv[1]): + c,s=i.strip().split() + c=float(c) + s=float(s) + + if c>0 and s>0: + c1=-1 + while c1<=0: + c1=scipy.random.normal(0,1)*s+c + + output_file.write("%s\t%s\n"%(c1,s)) + |