aboutsummaryrefslogtreecommitdiffstats
path: root/mass_profile/shuffle_sbp.py
diff options
context:
space:
mode:
Diffstat (limited to 'mass_profile/shuffle_sbp.py')
-rwxr-xr-xmass_profile/shuffle_sbp.py18
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))
+