diff --git a/examples/example_observation/example_observation.py b/examples/example_observation/example_observation.py index 15ead2d..67c8268 100644 --- a/examples/example_observation/example_observation.py +++ b/examples/example_observation/example_observation.py @@ -101,7 +101,7 @@ newSample = Sample( # width of redshift boundaries to flag edge galaxies # (interpreted as boundaryWidth*(zMax-zMin)) - boundaryWidth = 0.1, + boundaryWidth = 0.01, # leave this at -1 for mean particle separation, # or specify your own in Mpc/h diff --git a/python_source/backend/classes.py b/python_source/backend/classes.py index 1266e5b..6d179f9 100644 --- a/python_source/backend/classes.py +++ b/python_source/backend/classes.py @@ -79,6 +79,7 @@ class Sample: omegaM = 0.27 minVoidRadius = -1 fakeDensity = 0.01 + hasWeightedVolumes = False profileBinSize = 2 # Mpc autoNumInStack = -1 # set to >0 to automatically generate stacks of size N autoPartInStack = -1 # set to >0 to automatically generate stacks with N particles @@ -104,7 +105,7 @@ class Sample: zBoundary=(), zRange=(), zBoundaryMpc=(), boundaryWidth=0.1, shiftSimZ=False, minVoidRadius=-1, fakeDensity=0.01, volumeLimited=True, - numAPSlices=1, + numAPSlices=1, hasWeightedVolumes=False, includeInHubble=True, partOfCombo=False, isCombo=False, comboList=(), profileBinSize=2.0, boxLen=1024, usePecVel=False, omegaM=0.27, @@ -126,6 +127,7 @@ class Sample: self.zRange = zRange self.minVoidRadius = minVoidRadius self.fakeDensity = fakeDensity + self.hasWeightedVolumes = hasWeightedVolumes self.volumeLimited = volumeLimited self.includeInHubble = includeInHubble self.partOfCombo = partOfCombo diff --git a/python_source/backend/launchers.py b/python_source/backend/launchers.py index 5d30bf7..0b6cf2b 100644 --- a/python_source/backend/launchers.py +++ b/python_source/backend/launchers.py @@ -437,6 +437,7 @@ def launchZobov(sample, binPath, outputDir=None, logDir=None, continueRun=None, for i in range(len(vols)): vols[i] *= selfunc(redshifts[i]) + sample.hasWeightedVolumes = True volFile = outputDir+"/vol_weighted_"+sampleName+".dat" with open(volFile, mode='wb') as File: numPartTot.astype(np.int32).tofile(File) @@ -467,6 +468,7 @@ def launchZobov(sample, binPath, outputDir=None, logDir=None, continueRun=None, numPartTot.astype(np.int32).tofile(File) vols.astype(np.float32).tofile(File) + sample.hasWeightedVolumes = True volFileToUse = outputDir+"/vol_weighted_"+sampleName+".dat" else: volFileToUse = outputDir+"/vol_"+sampleName+".dat" @@ -524,6 +526,12 @@ def launchPrune(sample, binPath, periodicLine = " --periodic='" + getPeriodic(sample) + "'" + if sample.hasWeightedVolumes: + volFileLine = " --partVol=" + outputDir+"/vol_weighted_"+\ + str(sampleName)+".dat" + else: + volFileLine = " --partVol=" + outputDir+"/vol_"+str(sampleName)+".dat" + if useComoving: useComovingFlag = " --useComoving" else: @@ -548,11 +556,9 @@ def launchPrune(sample, binPath, cmd += " --voidDesc=" + outputDir+"/voidDesc_"+str(sampleName)+".out" cmd += " --void2Zone="+outputDir+"/voidZone_"+str(sampleName)+".dat" cmd += " --zone2Part=" + outputDir+"/voidPart_"+str(sampleName)+".dat" - cmd += " --partVol=" + outputDir+"/vol_"+str(sampleName)+".dat" cmd += " --partAdj=" + outputDir+"/adj_"+str(sampleName)+".dat" cmd += " --partEdge=" + outputDir+"galaxy_edge_flags.txt" - cmd += " --extraInfo=" + outputDir+"/zobov_slice_"+str(sampleName)+\ - ".par" + cmd += " --extraInfo=" + outputDir+"/zobov_slice_"+str(sampleName)+".par" cmd += " --tolerance=" + str(boundaryTolerance) cmd += " --mockIndex=" + str(mockIndex) cmd += " --maxCentralDen=" + str(maxDen) @@ -562,6 +568,7 @@ def launchPrune(sample, binPath, cmd += " --numVoids=" + str(numVoids) cmd += observationLine cmd += periodicLine + cmd += volFileLine cmd += useComovingFlag cmd += " --omegaM=" + str(sample.omegaM) cmd += " --outputDir=" + outputDir