mirror of
https://bitbucket.org/cosmicvoids/vide_public.git
synced 2025-07-04 15:21:11 +00:00
Add an option to change the merging threshold
This commit is contained in:
parent
569a7e40e6
commit
ccc469aa6e
4 changed files with 18 additions and 8 deletions
|
@ -323,7 +323,7 @@ def launchGenerate(sample, binPath, workDir=None, inputDataDir=None,
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
def launchZobov(sample, binPath, zobovDir=None, logDir=None, continueRun=None,
|
def launchZobov(sample, binPath, zobovDir=None, logDir=None, continueRun=None,
|
||||||
numZobovDivisions=None, numZobovThreads=None):
|
numZobovDivisions=None, numZobovThreads=None, mergingThreshold=0.2):
|
||||||
|
|
||||||
sampleName = sample.fullName
|
sampleName = sample.fullName
|
||||||
|
|
||||||
|
@ -339,10 +339,10 @@ def launchZobov(sample, binPath, zobovDir=None, logDir=None, continueRun=None,
|
||||||
if sample.dataType == "observation":
|
if sample.dataType == "observation":
|
||||||
maskIndex = open(zobovDir+"/mask_index.txt", "r").read()
|
maskIndex = open(zobovDir+"/mask_index.txt", "r").read()
|
||||||
totalPart = open(zobovDir+"/total_particles.txt", "r").read()
|
totalPart = open(zobovDir+"/total_particles.txt", "r").read()
|
||||||
maxDen = 0.2*float(maskIndex)/float(totalPart)
|
maxDen = mergingThreshold*float(maskIndex)/float(totalPart)
|
||||||
else:
|
else:
|
||||||
maskIndex = -1
|
maskIndex = -1
|
||||||
maxDen = 0.2
|
maxDen = mergingThreshold
|
||||||
if numZobovDivisions == 1:
|
if numZobovDivisions == 1:
|
||||||
print(" WARNING! You are using a single ZOBOV division with a simulation. Periodic boundaries will not be respected!")
|
print(" WARNING! You are using a single ZOBOV division with a simulation. Periodic boundaries will not be respected!")
|
||||||
|
|
||||||
|
@ -466,7 +466,7 @@ def launchZobov(sample, binPath, zobovDir=None, logDir=None, continueRun=None,
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
def launchPrune(sample, binPath,
|
def launchPrune(sample, binPath,
|
||||||
summaryFile=None, logFile=None, zobovDir=None,
|
summaryFile=None, logFile=None, zobovDir=None,
|
||||||
continueRun=None, useComoving=False):
|
continueRun=None, useComoving=False, mergingThreshold=0.2):
|
||||||
|
|
||||||
sampleName = sample.fullName
|
sampleName = sample.fullName
|
||||||
|
|
||||||
|
@ -477,12 +477,12 @@ def launchPrune(sample, binPath,
|
||||||
if sample.dataType == "observation":
|
if sample.dataType == "observation":
|
||||||
mockIndex = open(zobovDir+"/mask_index.txt", "r").read()
|
mockIndex = open(zobovDir+"/mask_index.txt", "r").read()
|
||||||
totalPart = open(zobovDir+"/total_particles.txt", "r").read()
|
totalPart = open(zobovDir+"/total_particles.txt", "r").read()
|
||||||
maxDen = 0.2*float(mockIndex)/float(totalPart)
|
maxDen = mergingThreshold*float(mockIndex)/float(totalPart)
|
||||||
observationLine = " --isObservation"
|
observationLine = " --isObservation"
|
||||||
#periodicLine = " --periodic=''"
|
#periodicLine = " --periodic=''"
|
||||||
else:
|
else:
|
||||||
mockIndex = -1
|
mockIndex = -1
|
||||||
maxDen = 0.2
|
maxDen = mergingThreshold
|
||||||
observationLine = ""
|
observationLine = ""
|
||||||
|
|
||||||
periodicLine = " --periodic='" + getPeriodic(sample) + "'"
|
periodicLine = " --periodic='" + getPeriodic(sample) + "'"
|
||||||
|
|
|
@ -105,7 +105,7 @@ for sample in dataSampleList:
|
||||||
|
|
||||||
launchZobov(sample, ZOBOV_PATH, zobovDir=zobovDir, logDir=logDir,
|
launchZobov(sample, ZOBOV_PATH, zobovDir=zobovDir, logDir=logDir,
|
||||||
continueRun=continueRun, numZobovDivisions=numZobovDivisions,
|
continueRun=continueRun, numZobovDivisions=numZobovDivisions,
|
||||||
numZobovThreads=numZobovThreads)
|
numZobovThreads=numZobovThreads, mergingThreshold=mergingThreshold)
|
||||||
|
|
||||||
# -------------------------------------------------------------------------
|
# -------------------------------------------------------------------------
|
||||||
if (startCatalogStage <= 3) and (endCatalogStage >= 3) and not sample.isCombo:
|
if (startCatalogStage <= 3) and (endCatalogStage >= 3) and not sample.isCombo:
|
||||||
|
@ -119,7 +119,7 @@ for sample in dataSampleList:
|
||||||
|
|
||||||
launchPrune(sample, PRUNE_PATH,
|
launchPrune(sample, PRUNE_PATH,
|
||||||
logFile=logFile, zobovDir=zobovDir,
|
logFile=logFile, zobovDir=zobovDir,
|
||||||
useComoving=sample.useComoving, continueRun=continueRun)
|
useComoving=sample.useComoving, continueRun=continueRun, mergingThreshold=mergingThreshold)
|
||||||
|
|
||||||
# -------------------------------------------------------------------------
|
# -------------------------------------------------------------------------
|
||||||
if (startCatalogStage <= 4) and (endCatalogStage >= 4):
|
if (startCatalogStage <= 4) and (endCatalogStage >= 4):
|
||||||
|
|
|
@ -54,6 +54,11 @@ numZobovThreads = 2
|
||||||
# optimization: number of subdivisions of the box
|
# optimization: number of subdivisions of the box
|
||||||
numZobovDivisions = 2
|
numZobovDivisions = 2
|
||||||
|
|
||||||
|
# Maximum density for merging voids
|
||||||
|
# 0 (equivalent to infinitely large value) -> Merge everything (no threshold)
|
||||||
|
# 1e-9 (or smaller != 0) -> Do not merge anything
|
||||||
|
mergingThreshold = 1e-9
|
||||||
|
|
||||||
# don't change this
|
# don't change this
|
||||||
dataSampleList = []
|
dataSampleList = []
|
||||||
|
|
||||||
|
|
|
@ -71,6 +71,11 @@ numZobovThreads = 2
|
||||||
# optimization: number of subdivisions of the box
|
# optimization: number of subdivisions of the box
|
||||||
numZobovDivisions = 2
|
numZobovDivisions = 2
|
||||||
|
|
||||||
|
# maximum density for merging voids
|
||||||
|
# 0 (equivalent to infinitely large value) -> Merge everything (no threshold)
|
||||||
|
# 1e-9 (or smaller != 0) -> Do not merge anything
|
||||||
|
mergingThreshold = 1e-9
|
||||||
|
|
||||||
# prefix to give all outputs
|
# prefix to give all outputs
|
||||||
prefix = "sim_"
|
prefix = "sim_"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue