+ radial profiles now full actual density from survey volume, not zobov normalization

+ getVolNorm provides both zobov normalization and average density from survey volume for observations

+ significant update and cleanup to plotting routines
This commit is contained in:
Paul M. Sutter 2025-03-04 14:07:36 -05:00
parent b79046ac22
commit 326756b2bc
8 changed files with 73 additions and 61 deletions

View file

@ -115,6 +115,8 @@ def loadPart(sampleDir):
boxLen = mul
# TODO - should use built-in volNorm function instead
#if isObservation == 1:
# # look for the mask file
# if os.access(sample.maskFile, os.F_OK):
@ -165,26 +167,29 @@ def getVolNorm(sampleDir):
boxLen = mul
#if isObservation == 1:
# # look for the mask file
# if os.access(sample.maskFile, os.F_OK):
# maskFile = sample.maskFile
# 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",
# selectionFuncFile=sample.selFunFile,
# useComoving=sample.useComoving)
# boxVol = props[0]
# volNorm = maskIndex/boxVol
#else:
boxVol = np.prod(boxLen)
volNorm = Np/boxVol
volNormObs = volNorm
return volNorm
if isObservation == 1:
# look for the mask file
if os.access(sample.maskFile, os.F_OK):
maskFile = sample.maskFile
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)
boxVol = props[0]
volNormObs = maskIndex/boxVol
return volNorm, volNormObs
# -----------------------------------------------------------------------------
@ -285,7 +290,8 @@ class Catalog:
numVoids = 0
numPartTot = 0
numZonesTot = 0
volNorm = 0
volNorm = 0 # normalization used by zobov across entire volumne
volNormObs = 0 # normalization based on average density of survey volume
boxLen = np.zeros((3))
ranges = np.zeros((3,2))
part = None
@ -328,8 +334,9 @@ def loadVoidCatalog(sampleDir, dataPortion="central", loadParticles=True,
catalog.ranges = ranges
File.close()
volNorm = getVolNorm(sampleDir)
volNorm, volNormObs = getVolNorm(sampleDir)
catalog.volNorm = volNorm
catalog.volNormObs = volNormObs
if untrimmed:
prefix = "untrimmed_"