diff --git a/example.py b/example.py deleted file mode 100644 index 1cd77f40b7bdd781cfab8a1358204f5f8fd7c768..0000000000000000000000000000000000000000 --- a/example.py +++ /dev/null @@ -1,70 +0,0 @@ -import numpy -import eagle -import sys -import os - - -sim='/cosma5/data/Eagle/ScienceRuns/Planck1/L0100N1504/PE/Z0p10_W1p00_E_3p0_0p3_ALPHA1p0e6_rhogas1_reposlim3p0soft_100mgas_cosma/data/' -tag='028_z000p000' - -length_EA = eagle.readArray("FOF", sim, tag, "FOF/GroupLength") -#lengthType_EA = eagle.readArray("FOF", sim_EA, tag, "FOF/GroupLengthType") -offset_EA = eagle.readArray("FOF", sim, tag, "FOF/GroupOffset") - -#print min(offset_EA), max(offset_EA) - -offset_2 = numpy.cumsum(length_EA) - -print offset_2 - -offset_2 = numpy.insert(offset_2, 0, 0) - -print offset_2 -#print min(offset_EA), max(offset_EA) - - -a[b] = c - - -R_500 = eagle.readArray("SUBFIND_GROUP", sim, tag, "FOF/Group_R_Crit500", numThreads=64) -R_2500 = eagle.readArray("SUBFIND_GROUP", sim, tag, "FOF/Group_R_Crit2500", numThreads=64) -M_500 = eagle.readArray("SUBFIND_GROUP", sim, tag, "FOF/Group_M_Crit500", numThreads=64) * 1e10 - -ratio = R_500 / R_2500 - -massBins = numpy.logspace(8.1, 15.9, 40) -ratio_count = numpy.zeros(numpy.size(massBins)) -ratio_mean = numpy.zeros(numpy.size(massBins)) -ratio2_mean = numpy.zeros(numpy.size(massBins)) - -for i in range(numpy.size(R_500)): - if M_500[i] > 1e6 and R_500[i] > 0.001 and R_2500[i] > 0.001: - bin = -1 - for j in range(numpy.size(massBins)-1): - if M_500[i] > massBins[j] and M_500[i] < massBins[j+1]: - bin = j - break - - if bin != -1: - ratio_count[bin] = ratio_count[bin] + 1 - ratio_mean[bin] = ratio_mean[bin] + ratio[i] - ratio2_mean[bin] = ratio2_mean[bin] + ratio[i]*ratio[i] - - - -for j in range(numpy.size(massBins)): - if ratio_count[j] != 0: - ratio_mean[j] = ratio_mean[j] / ratio_count[j] - ratio2_mean[j] = ratio2_mean[j] / ratio_count[j] - else: - ratio_mean[j] = 0 - ratio2_mean[j] = 0 - - -ratio_sigma = numpy.sqrt(ratio2_mean - ratio_mean * ratio_mean) - -file = open("non_parametric_100_z0p0.dat",'w') -file.write("# M_500 mean sigma count\n") -for j in range(numpy.size(massBins)-1): - file.write("%e %f %f %i\n"%(10**(0.5*(numpy.log10(massBins[j])+numpy.log10(massBins[j+1]))), ratio_mean[j], ratio_sigma[j], ratio_count[j])) -file.close() diff --git a/profile.py b/profile.py deleted file mode 100644 index 16785fe8c8aebb5b57586550911ee13fcd72dac7..0000000000000000000000000000000000000000 --- a/profile.py +++ /dev/null @@ -1,52 +0,0 @@ -import numpy -import eagle -import sys -import os - - -sim='/cosma5/data/Eagle/ScienceRuns/Planck1/L0100N1504/PE/Z0p10_W1p00_E_3p0_0p3_ALPHA1p0e6_rhogas1_reposlim3p0soft_100mgas_cosma/data/' -tag='028_z000p000' - - -R_500 = eagle.readArray("SUBFIND_GROUP", sim, tag, "FOF/Group_R_Crit500", numThreads=64) -R_2500 = eagle.readArray("SUBFIND_GROUP", sim, tag, "FOF/Group_R_Crit2500", numThreads=64) -M_500 = eagle.readArray("SUBFIND_GROUP", sim, tag, "FOF/Group_M_Crit500", numThreads=64) * 1e10 - -ratio = R_500 / R_2500 - -massBins = numpy.logspace(8.1, 15.9, 40) -ratio_count = numpy.zeros(numpy.size(massBins)) -ratio_mean = numpy.zeros(numpy.size(massBins)) -ratio2_mean = numpy.zeros(numpy.size(massBins)) - -for i in range(numpy.size(R_500)): - if M_500[i] > 1e6 and R_500[i] > 0.001 and R_2500[i] > 0.001: - bin = -1 - for j in range(numpy.size(massBins)-1): - if M_500[i] > massBins[j] and M_500[i] < massBins[j+1]: - bin = j - break - - if bin != -1: - ratio_count[bin] = ratio_count[bin] + 1 - ratio_mean[bin] = ratio_mean[bin] + ratio[i] - ratio2_mean[bin] = ratio2_mean[bin] + ratio[i]*ratio[i] - - - -for j in range(numpy.size(massBins)): - if ratio_count[j] != 0: - ratio_mean[j] = ratio_mean[j] / ratio_count[j] - ratio2_mean[j] = ratio2_mean[j] / ratio_count[j] - else: - ratio_mean[j] = 0 - ratio2_mean[j] = 0 - - -ratio_sigma = numpy.sqrt(ratio2_mean - ratio_mean * ratio_mean) - -file = open("non_parametric_100_z0p0.dat",'w') -file.write("# M_500 mean sigma count\n") -for j in range(numpy.size(massBins)-1): - file.write("%e %f %f %i\n"%(10**(0.5*(numpy.log10(massBins[j])+numpy.log10(massBins[j+1]))), ratio_mean[j], ratio_sigma[j], ratio_count[j])) -file.close()