From e3923265d0d6949407a83726e9a9bd5d97079221 Mon Sep 17 00:00:00 2001 From: Weitian LI Date: Wed, 18 Jun 2014 22:20:59 +0800 Subject: Initial commit Added files: * mass_profile: developed by Junhua GU, modified by Weitian LI * opt_utilities: developed by Junhua GU * tools/cosmo_calc: originated from 'calc_distance', modified * scripts: scripts used to process Chandra ACIS data * files: useful files used in processing * HOWTO_chandra_acis_process.txt * README.md --- mod_ly/shuffle_T.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 mod_ly/shuffle_T.py (limited to 'mod_ly/shuffle_T.py') diff --git a/mod_ly/shuffle_T.py b/mod_ly/shuffle_T.py new file mode 100755 index 0000000..24e7393 --- /dev/null +++ b/mod_ly/shuffle_T.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]): + r,re,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\t%s\t%s\n"%(r,re,c1,s)) + -- cgit v1.2.2