bug fixes to plotting. prepareCatalogs now handles gadget files; prepareGadgetCatalogs now deprecated

This commit is contained in:
P.M. Sutter 2012-11-14 04:37:30 -06:00
parent afe22f71fa
commit 390fb2f4e2
4 changed files with 133 additions and 81 deletions

View file

@ -223,7 +223,7 @@ def plotNumberDistribution(workDir=None, sampleList=None, figDir=None,
plt.clf()
plt.xlabel("Void Radius (Mpc/h)")
plt.ylabel(r"N > R [h^3 Mpc^{-3}]")
plt.ylabel(r"N > R [$h^3$ Mpc$^{-3}$]")
plotTitle = setName
@ -237,13 +237,16 @@ def plotNumberDistribution(workDir=None, sampleList=None, figDir=None,
lineTitle = sampleName
if sample.dataType == "observation":
boxVol = vp.getSurveyProps(sample.maskFile, stack.zMin, stack.zMax,
boxVol = vp.getSurveyProps(sample.maskFile,
sample.zBoundary[0], sample.zBoundary[1],
sample.zRange[0], sample.zRange[1], "all",
selectionFuncFile=sample.selFunFile)[0]
else:
boxVol = sample.boxLen*sample.boxLen*(sample.zBoundaryMpc[1] -
sample.zBoundaryMpc[0])
boxVol *= 1.e-9
filename = workDir+"/sample_"+sampleName+"/centers_"+dataPortion+"_"+\
sampleName+".out"
if not os.access(filename, os.F_OK):
@ -265,9 +268,6 @@ def plotNumberDistribution(workDir=None, sampleList=None, figDir=None,
plt.legend(title = "Samples", loc = "upper right")
plt.title(plotTitle)
plt.xlim(xMin, xMax)
#plt.xlim(xMin, xMax*1.4) # make room for legend
plt.savefig(figDir+"/fig_"+plotName+".pdf", bbox_inches="tight")
plt.savefig(figDir+"/fig_"+plotName+".eps", bbox_inches="tight")
plt.savefig(figDir+"/fig_"+plotName+".png", bbox_inches="tight")