diff --git a/python_source/backend/launchers.py b/python_source/backend/launchers.py index e14fe79..ccb77e1 100644 --- a/python_source/backend/launchers.py +++ b/python_source/backend/launchers.py @@ -115,10 +115,8 @@ def launchPrep(sample, binPath, workDir=None, inputDataDir=None, # compute mean particle separation log.write("\nFlagging edge galaxies.\n") - (boxVol, nbar) = getSurveyProps(sample.maskFile, sample.zRange[0], - sample.zRange[1], sample.zRange[0], sample.zRange[1], "all", - sample.omegaM, useComoving=useComoving) - + (boxVol, nbar) = getSurveyProps(sample) + numTracers = int(open("total_particles.txt", "r").read()) sample.meanPartSep = (1.*numTracers/boxVol/nbar)**(-1/3.) @@ -153,9 +151,7 @@ def launchPrep(sample, binPath, workDir=None, inputDataDir=None, # compute mean particle separation # TODO - clean up this duplicate to cover all continueRun options - (boxVol, nbar) = getSurveyProps(sample.maskFile, sample.zRange[0], - sample.zRange[1], sample.zRange[0], sample.zRange[1], "all", - sample.omegaM, useComoving=useComoving) + (boxVol, nbar) = getSurveyProps(sample) numTracers = int(open("total_particles.txt", "r").read()) sample.meanPartSep = (1.*numTracers/boxVol/nbar)**(-1/3.) diff --git a/python_source/backend/surveyTools.py b/python_source/backend/surveyTools.py index ab26e97..e35af80 100644 --- a/python_source/backend/surveyTools.py +++ b/python_source/backend/surveyTools.py @@ -30,11 +30,17 @@ from backend.cosmologyTools import * __all__=['getSurveyProps', 'getNside', 'figureOutMask', 'findEdgeGalaxies'] # ----------------------------------------------------------------------------- -# returns the volume and galaxy density for a given redshit slice -def getSurveyProps(maskFile, zmin, zmax, selFunMin, selFunMax, portion, - omegaM, selectionFuncFile=None, useComoving=False): +# returns the survey volume and scaled galaxy density for a given redshit slice +def getSurveyProps(sample): - #LIGHT_SPEED = 299792.458 + maskFile = sample.maskFile + zmin = sample.zBoundary[0] + zmax = sample.zBoundary[1] + selFunMin = sample.zBoundary[0] + selFunMax = sample.zBoundary[1] + omegaM = sample.omegaM + selectionFuncFile = sample.selFunFile + useComoving = sample.useComoving mask = healpy.read_map(maskFile) area = (1.*np.size(np.where(mask > 0)) / np.size(mask)) * 4.*np.pi diff --git a/python_source/voidUtil/catalogUtil.py b/python_source/voidUtil/catalogUtil.py index 5f894b9..2d8dfcb 100644 --- a/python_source/voidUtil/catalogUtil.py +++ b/python_source/voidUtil/catalogUtil.py @@ -169,14 +169,9 @@ def getVolNorm(sampleDir): else: maskFile = sampleDir+"/"+os.path.basename(sample.maskFile) print("Using maskfile found in: " + maskFile) - props = getSurveyProps(maskFile, sample.zBoundary[0], - sample.zBoundary[1], - sample.zBoundary[0], - sample.zBoundary[1], - "all", - sample.omegaM, - selectionFuncFile=sample.selFunFile, - useComoving=sample.useComoving) + + + props = getSurveyProps(sample) surveyVol = props[0] volNormObs = nGal/surveyVol diff --git a/python_source/voidUtil/plotUtil.py b/python_source/voidUtil/plotUtil.py index f01a6c9..e0c1144 100644 --- a/python_source/voidUtil/plotUtil.py +++ b/python_source/voidUtil/plotUtil.py @@ -80,12 +80,7 @@ def plotNumberFunction(catalogList, if sample.dataType == "observation": maskFile = sample.maskFile - - boxVol = sp.getSurveyProps(maskFile, - sample.zBoundary[0], sample.zBoundary[1], - sample.zRange[0], sample.zRange[1], "all", - selectionFuncFile=sample.selFunFile, - omegaM=sample.omegaM)[0] + boxVol = sp.getSurveyProps(sample)[0] else: boxVol = sample.boxLen*sample.boxLen*(sample.zBoundaryMpc[1] - sample.zBoundaryMpc[0]) @@ -110,7 +105,7 @@ def plotNumberFunction(catalogList, lowerbound = hist - sig upperbound = hist + sig - + mean = np.log10(hist/boxVol) lowerbound = np.log10(lowerbound/boxVol) upperbound = np.log10(upperbound/boxVol) @@ -137,8 +132,8 @@ def plotNumberFunction(catalogList, linewidth=3) distList.append((binCentersToUse, mean, lower, upper)) - - plt.legend(loc = "upper right", fancybox=True, prop={'size':14}) + + plt.legend(loc = "lower left", fancybox=True, prop={'size':14}) plt.savefig(figDir+"/fig_"+plotName+".pdf", bbox_inches="tight") #plt.savefig(figDir+"/fig_"+plotName+".eps", bbox_inches="tight")