prepared for magnitude-limited samples

This commit is contained in:
P.M. Sutter 2014-05-21 19:07:57 -05:00
parent 24e62450a8
commit 56b837899b
5 changed files with 18 additions and 15 deletions

View file

@ -79,18 +79,21 @@ newSample = Sample(
# don't change this # don't change this
dataType = "observation", dataType = "observation",
# assume volume-limites?
volumeLimited = True,
# HEALpix mask file # HEALpix mask file
maskFile = inputDataDir+"/healpix/rast_window_512.fits", 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 # max and min redshifts of galaxies in your sample
zBoundary = (0.0, 0.05), zBoundary = (0.0, 0.05),
# max and min redshifts where you want to find voids # max and min redshifts where you want to find voids
zRange = (0.0, 0.05), zRange = (0.0, 0.05),
# TODO
skyFraction = 0.19,
# leave this at -1 for mean particle separation, or # leave this at -1 for mean particle separation, or
# specify your own in Mpc/h # specify your own in Mpc/h
minVoidRadius = -1, minVoidRadius = -1,

View file

@ -25,19 +25,23 @@ import void_python_tools as ct
__all__=['getSurveyProps'] __all__=['getSurveyProps']
# returns the volume and galaxy density for a given redshit slice # 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 LIGHT_SPEED = 299792.458
mask = healpy.read_map(maskFile) mask = healpy.read_map(maskFile)
area = (1.*np.size(np.where(mask > 0)) / np.size(mask)) * 4.*np.pi 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) zmin = LIGHT_SPEED/100.*ct.angularDiameter(zmin, Om=0.27)
zmax = LIGHT_SPEED/100.*ct.angularDiameter(zmax, 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: else:
zmin = zmin * 3000 zmin = zmin * 3000
zmax = zmax * 3000 zmax = zmax * 3000
selFunMin *= 3000
selFunMax *= 3000
volume = area * (zmax**3 - zmin**3) / 3 volume = area * (zmax**3 - zmin**3) / 3
if selectionFuncFile != None: if selectionFuncFile != None:
@ -51,9 +55,6 @@ def getSurveyProps(maskFile, zmin, zmax, selFunMin, selFunMax, portion, selectio
selfuncDx = selfunc[1,0] - selfunc[0,0] selfuncDx = selfunc[1,0] - selfunc[0,0]
selfuncN = np.size(selfunc[:,0]) selfuncN = np.size(selfunc[:,0])
selFunMin *= 3000
selFunMax *= 3000
selFunMin = max(selFunMin, selfuncMin) selFunMin = max(selFunMin, selfuncMin)
selFunMax = min(selFunMax, selfuncMax) selFunMax = min(selFunMax, selfuncMax)
@ -67,7 +68,6 @@ def getSurveyProps(maskFile, zmin, zmax, selFunMin, selFunMax, portion, selectio
nbar = nbar[0] nbar = nbar[0]
ntotal = scipy.integrate.quad(fTotal, 0.0, max(selfuncUnity[:,0])) ntotal = scipy.integrate.quad(fTotal, 0.0, max(selfuncUnity[:,0]))
#ntotal = scipy.integrate.quad(f, 0.0, max(selfunc[:,0]))
ntotal = ntotal[0] ntotal = ntotal[0]
nbar = ntotal / area / nbar nbar = ntotal / area / nbar

View file

@ -68,7 +68,6 @@ class Sample:
zobovDir = "" zobovDir = ""
maskFile = "rast_window_512.fits" maskFile = "rast_window_512.fits"
selFunFile = "czselfunc.all.dr72dim.dat" selFunFile = "czselfunc.all.dr72dim.dat"
skyFraction = 0.19
zBoundary = (0.0, 0.1) zBoundary = (0.0, 0.1)
zBoundaryMpc = (0., 300) zBoundaryMpc = (0., 300)
zRange = (0.0, 0.1) zRange = (0.0, 0.1)
@ -101,7 +100,7 @@ class Sample:
minVoidRadius=-1, fakeDensity=0.01, volumeLimited=True, minVoidRadius=-1, fakeDensity=0.01, volumeLimited=True,
numAPSlices=1, numAPSlices=1,
includeInHubble=True, partOfCombo=False, isCombo=False, includeInHubble=True, partOfCombo=False, isCombo=False,
comboList=(), profileBinSize=2.0, skyFraction=0.19, comboList=(), profileBinSize=2.0,
boxLen=1024, usePecVel=False, omegaM=0.27, boxLen=1024, usePecVel=False, omegaM=0.27,
numSubvolumes=1, mySubvolume=1, dataFormat="sdss", numSubvolumes=1, mySubvolume=1, dataFormat="sdss",
useComoving=True, useComoving=True,
@ -126,7 +125,6 @@ class Sample:
self.numAPSlices = numAPSlices self.numAPSlices = numAPSlices
self.zobovDir = None self.zobovDir = None
self.profileBinSize = profileBinSize self.profileBinSize = profileBinSize
self.skyFraction = skyFraction
self.dataType = dataType self.dataType = dataType
self.boxLen = boxLen self.boxLen = boxLen
self.usePecVel = usePecVel self.usePecVel = usePecVel

View file

@ -269,7 +269,7 @@ def launchGenerate(sample, binPath, workDir=None, inputDataDir=None,
numTracers = int(open(zobovDir+"/mask_index.txt", "r").read()) numTracers = int(open(zobovDir+"/mask_index.txt", "r").read())
numTotal = int(open(zobovDir+"/total_particles.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 # save this sample's information
with open(zobovDir+"/sample_info.dat", 'w') as output: with open(zobovDir+"/sample_info.dat", 'w') as output:

View file

@ -106,7 +106,8 @@ def loadPart(sampleDir):
sample.zBoundary[1], sample.zBoundary[1],
sample.zBoundary[0], sample.zBoundary[0],
sample.zBoundary[1], "all", sample.zBoundary[1], "all",
useLCDM=sample.useComoving) selectionFuncFile=sample.selFunFile,
useComoving=sample.useComoving)
boxVol = props[0] boxVol = props[0]
volNorm = maskIndex/boxVol volNorm = maskIndex/boxVol
else: else:
@ -156,7 +157,8 @@ def getVolNorm(sampleDir):
sample.zBoundary[1], sample.zBoundary[1],
sample.zBoundary[0], sample.zBoundary[0],
sample.zBoundary[1], "all", sample.zBoundary[1], "all",
useLCDM=sample.useComoving) selectionFuncFile=sample.selFunFile,
useComoving=sample.useComoving)
boxVol = props[0] boxVol = props[0]
volNorm = maskIndex/boxVol volNorm = maskIndex/boxVol
else: else: