some small bug fixes, also prepared prunveVoids to potentially remove voids based on density contrast criteria

This commit is contained in:
P.M. Sutter 2012-11-16 09:48:02 -06:00
parent 971cf21ea2
commit 0ef211a1cc
4 changed files with 23 additions and 7 deletions

View file

@ -447,6 +447,13 @@ int main(int argc, char **argv) {
}
for (iVoid = 0; iVoid < numVoids; iVoid++) {
// TEST
//if (voids[iVoid].densCon > 1.5) {
// voids[iVoid].accepted = 0;
//}
// END TEST
if (strcmp(args_info.dataPortion_arg, "edge") == 0 &&
tolerance*voids[iVoid].maxRadius < voids[iVoid].nearestMock) {
voids[iVoid].accepted = 0;
@ -582,6 +589,6 @@ int main(int argc, char **argv) {
clock1 = clock();
printf("Done!\n");
printf("Done!");
return 0;
} // end main

View file

@ -480,6 +480,7 @@ if args.hod or args.all:
for (iRedshift, redshift) in enumerate(redshifts):
print " z = ", redshift
# these parameters come from Manera et al 2012, eq. 26
parFileName = "./hod.par"
parFile = open(parFileName, 'w')
haloFile = catalogDir+"/mdr1_halos_z"+fileNums[iRedshift]

View file

@ -17,15 +17,20 @@ import argparse
workDir = "/home/psutter2/workspace/Voids/"
figDir = "./figs"
sampleDirList = [ "multidark/md_halos/sample_md_halos_z0.03_d00/",
"multidark/md_ss0.1/sample_md_ss0.1_z0.03_d00/",
"multidark/md_hod_dr9mid/sample_md_hod_dr9mid_z0.03_d00/",
sampleDirList = [ "multidark/md_ss0.1_pv/sample_md_ss0.1_pv_z0.56_d00/",
"multidark/md_halos_pv/sample_md_halos_pv_z0.56_d00/",
"random/ran_ss0.0004/sample_ran_ss0.0004_z0.56_d00/",
"random/ran_ss0.1/sample_ran_ss0.1_z0.56_d00/",
"multidark/md_hod_dr9mid_pv/sample_md_hod_dr9mid_pv_z0.56_d00/",
"multidark/md_ss0.0004_pv/sample_md_ss0.0004_pv_z0.56_d00/",
"sdss_dr9/sample_lss.dr9cmassmid.dat/" ]
plotNameBase = "compdist"
dataPortion = "central"
obsFudgeFactor = .66 # what fraction of the volume are we *reall* capturing?
parser = argparse.ArgumentParser(description='Plot.')
parser.add_argument('--show', dest='showPlot', action='store_const',
const=True, default=False,
@ -47,6 +52,7 @@ plt.clf()
plt.xlabel("Void Radius (Mpc/h)")
plt.ylabel(r"N > R [$h^3$ Gpc$^{-3}$]")
plt.yscale('log')
plt.xlim(xmax=80.)
plotName = plotNameBase
@ -60,6 +66,7 @@ for (iSample,sample) in enumerate(dataSampleList):
sample.zBoundary[0], sample.zBoundary[1],
sample.zRange[0], sample.zRange[1], "all",
selectionFuncFile=sample.selFunFile)[0]
boxVol *= obsFudgeFactor
else:
boxVol = sample.boxLen*sample.boxLen*(sample.zBoundaryMpc[1] -
sample.zBoundaryMpc[0])
@ -84,7 +91,7 @@ for (iSample,sample) in enumerate(dataSampleList):
label=lineTitle, color=colorList[iSample],
linewidth=linewidth)
plt.legend(title = "Samples", loc = "upper right")
plt.legend(title = "Samples", loc = "upper right", prop={'size':8})
#plt.title(plotTitle)
plt.savefig(figDir+"/fig_"+plotName+".pdf", bbox_inches="tight")

View file

@ -245,7 +245,7 @@ def launchPrune(sample, binPath, thisDataPortion=None,
totalPart = open(zobovDir+"/total_particles.txt", "r").read()
maxDen = 0.2*float(mockIndex)/float(totalPart)
observationLine = " --isObservation"
periodicLine = "--periodic=''"
periodicLine = " --periodic=''"
else:
mockIndex = -1
maxDen = 0.2
@ -297,7 +297,8 @@ def launchPrune(sample, binPath, thisDataPortion=None,
cmd += " >& " + logFile
os.system(cmd)
if jobSuccessful(logFile, "NetCDF: Not a valid ID\n") or jobSuccessful(logFile, "Done!") or jobSuccessful(logFile, ""):
if jobSuccessful(logFile, "NetCDF: Not a valid ID\n") or \
jobSuccessful(logFile, "Done!"):
print "done"
else:
print "FAILED!"