diff --git a/pipeline/datasets/example_observation.py b/pipeline/datasets/example_observation.py index f84a964..73462f9 100644 --- a/pipeline/datasets/example_observation.py +++ b/pipeline/datasets/example_observation.py @@ -79,18 +79,21 @@ newSample = Sample( # don't change this dataType = "observation", + # assume volume-limites? + volumeLimited = True, + # HEALpix mask file maskFile = inputDataDir+"/healpix/rast_window_512.fits", + # radial selection function (if not volume limited) + selFunFile = None, + # max and min redshifts of galaxies in your sample zBoundary = (0.0, 0.05), # max and min redshifts where you want to find voids zRange = (0.0, 0.05), - # TODO - skyFraction = 0.19, - # leave this at -1 for mean particle separation, or # specify your own in Mpc/h minVoidRadius = -1, diff --git a/python_tools/void_python_tools/apTools/profiles/getSurveyProps.py b/python_tools/void_python_tools/apTools/profiles/getSurveyProps.py index d66b3c6..5a3bf5d 100644 --- a/python_tools/void_python_tools/apTools/profiles/getSurveyProps.py +++ b/python_tools/void_python_tools/apTools/profiles/getSurveyProps.py @@ -25,19 +25,23 @@ import void_python_tools as ct __all__=['getSurveyProps'] # returns the volume and galaxy density for a given redshit slice -def getSurveyProps(maskFile, zmin, zmax, selFunMin, selFunMax, portion, selectionFuncFile=None, useLCDM=False): +def getSurveyProps(maskFile, zmin, zmax, selFunMin, selFunMax, portion, selectionFuncFile=None, useComoving=False): LIGHT_SPEED = 299792.458 mask = healpy.read_map(maskFile) area = (1.*np.size(np.where(mask > 0)) / np.size(mask)) * 4.*np.pi - if useLCDM: + if useComoving: zmin = LIGHT_SPEED/100.*ct.angularDiameter(zmin, Om=0.27) zmax = LIGHT_SPEED/100.*ct.angularDiameter(zmax, Om=0.27) + selFunMin = LIGHT_SPEED/100.*ct.angularDiameter(selFunMin, Om=0.27) + selFunMax = LIGHT_SPEED/100.*ct.angularDiameter(selFunMax, Om=0.27) else: zmin = zmin * 3000 zmax = zmax * 3000 + selFunMin *= 3000 + selFunMax *= 3000 volume = area * (zmax**3 - zmin**3) / 3 if selectionFuncFile != None: @@ -51,9 +55,6 @@ def getSurveyProps(maskFile, zmin, zmax, selFunMin, selFunMax, portion, selectio selfuncDx = selfunc[1,0] - selfunc[0,0] selfuncN = np.size(selfunc[:,0]) - selFunMin *= 3000 - selFunMax *= 3000 - selFunMin = max(selFunMin, selfuncMin) selFunMax = min(selFunMax, selfuncMax) @@ -67,7 +68,6 @@ def getSurveyProps(maskFile, zmin, zmax, selFunMin, selFunMax, portion, selectio nbar = nbar[0] ntotal = scipy.integrate.quad(fTotal, 0.0, max(selfuncUnity[:,0])) - #ntotal = scipy.integrate.quad(f, 0.0, max(selfunc[:,0])) ntotal = ntotal[0] nbar = ntotal / area / nbar diff --git a/python_tools/void_python_tools/backend/classes.py b/python_tools/void_python_tools/backend/classes.py index 1101a41..fb1efbf 100644 --- a/python_tools/void_python_tools/backend/classes.py +++ b/python_tools/void_python_tools/backend/classes.py @@ -68,7 +68,6 @@ class Sample: zobovDir = "" maskFile = "rast_window_512.fits" selFunFile = "czselfunc.all.dr72dim.dat" - skyFraction = 0.19 zBoundary = (0.0, 0.1) zBoundaryMpc = (0., 300) zRange = (0.0, 0.1) @@ -101,7 +100,7 @@ class Sample: minVoidRadius=-1, fakeDensity=0.01, volumeLimited=True, numAPSlices=1, includeInHubble=True, partOfCombo=False, isCombo=False, - comboList=(), profileBinSize=2.0, skyFraction=0.19, + comboList=(), profileBinSize=2.0, boxLen=1024, usePecVel=False, omegaM=0.27, numSubvolumes=1, mySubvolume=1, dataFormat="sdss", useComoving=True, @@ -126,7 +125,6 @@ class Sample: self.numAPSlices = numAPSlices self.zobovDir = None self.profileBinSize = profileBinSize - self.skyFraction = skyFraction self.dataType = dataType self.boxLen = boxLen self.usePecVel = usePecVel diff --git a/python_tools/void_python_tools/backend/launchers.py b/python_tools/void_python_tools/backend/launchers.py index 60f3359..4b38260 100644 --- a/python_tools/void_python_tools/backend/launchers.py +++ b/python_tools/void_python_tools/backend/launchers.py @@ -269,7 +269,7 @@ def launchGenerate(sample, binPath, workDir=None, inputDataDir=None, numTracers = int(open(zobovDir+"/mask_index.txt", "r").read()) numTotal = int(open(zobovDir+"/total_particles.txt", "r").read()) - meanSep = (1.*numTracers/boxVol)**(-1/3.) + meanSep = (1.*numTracers/boxVol/nbar)**(-1/3.) # save this sample's information with open(zobovDir+"/sample_info.dat", 'w') as output: diff --git a/python_tools/void_python_tools/voidUtil/catalogUtil.py b/python_tools/void_python_tools/voidUtil/catalogUtil.py index b1d3caa..ba7b1e5 100644 --- a/python_tools/void_python_tools/voidUtil/catalogUtil.py +++ b/python_tools/void_python_tools/voidUtil/catalogUtil.py @@ -106,7 +106,8 @@ def loadPart(sampleDir): sample.zBoundary[1], sample.zBoundary[0], sample.zBoundary[1], "all", - useLCDM=sample.useComoving) + selectionFuncFile=sample.selFunFile, + useComoving=sample.useComoving) boxVol = props[0] volNorm = maskIndex/boxVol else: @@ -156,7 +157,8 @@ def getVolNorm(sampleDir): sample.zBoundary[1], sample.zBoundary[0], sample.zBoundary[1], "all", - useLCDM=sample.useComoving) + selectionFuncFile=sample.selFunFile, + useComoving=sample.useComoving) boxVol = props[0] volNorm = maskIndex/boxVol else: