From ddcb971eaeaf5b374220891edfdb828cb2afc96f Mon Sep 17 00:00:00 2001 From: "Paul M. Sutter" Date: Tue, 4 Jun 2024 11:19:07 +0200 Subject: [PATCH] placed mergingThreshold parameter in defaults file --- .../example_observation.py | 4 ++-- .../example_simulation/example_simulation.py | 2 +- python_source/backend/launchers.py | 5 +++-- python_source/vide_pipeline/defaults.py | 22 ++++++++++++++++--- .../vide_pipeline/vide_prepare_simulation.py | 12 +++++----- 5 files changed, 30 insertions(+), 15 deletions(-) diff --git a/examples/example_observation/example_observation.py b/examples/example_observation/example_observation.py index 5f93b89..8b89e40 100644 --- a/examples/example_observation/example_observation.py +++ b/examples/example_observation/example_observation.py @@ -44,10 +44,10 @@ workDir = basePath #workDir = os.path.join(basePath,"example_observation") # output directory for log files -logDir = os.path.join(basePath,"logs","example_observation") +logDir = os.path.join(workDir,"logs","example_observation") # output directory for figures -figDir = os.path.join(basePath,"figs","example_observation") +figDir = os.path.join(workDir,"figs","example_observation") # optimization: maximum number of parallel threads to use numZobovThreads = 2 diff --git a/examples/example_simulation/example_simulation.py b/examples/example_simulation/example_simulation.py index 3d562b4..db9a84e 100644 --- a/examples/example_simulation/example_simulation.py +++ b/examples/example_simulation/example_simulation.py @@ -74,7 +74,7 @@ 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 +mergingThreshold = 0.2 # prefix to give all outputs prefix = "sim_" diff --git a/python_source/backend/launchers.py b/python_source/backend/launchers.py index 29ce9c1..6263114 100644 --- a/python_source/backend/launchers.py +++ b/python_source/backend/launchers.py @@ -47,7 +47,7 @@ LIGHT_SPEED = 299792.458 # ----------------------------------------------------------------------------- def launchPrep(sample, binPath, workDir=None, inputDataDir=None, zobovDir=None, figDir=None, logFile=None, useComoving=False, - continueRun=None,regenerate=False): + continueRun=None, regenerate=False): if sample.dataType == "observation": sampleName = sample.fullName @@ -323,7 +323,8 @@ def launchPrep(sample, binPath, workDir=None, inputDataDir=None, # ----------------------------------------------------------------------------- def launchZobov(sample, binPath, zobovDir=None, logDir=None, continueRun=None, - numZobovDivisions=None, numZobovThreads=None, mergingThreshold=0.2): + numZobovDivisions=None, numZobovThreads=None, + mergingThreshold=0.2): sampleName = sample.fullName diff --git a/python_source/vide_pipeline/defaults.py b/python_source/vide_pipeline/defaults.py index 96fb27f..b552865 100644 --- a/python_source/vide_pipeline/defaults.py +++ b/python_source/vide_pipeline/defaults.py @@ -23,12 +23,23 @@ import os # ----------------------------------------------------------------------------- # DEFAULT CONFIGURATION +# the overall name for your dataset datasetName = "" +# where to start and end the VIDE pipeline +# stages: +# 1 : extract redshift slices from data +# 2 : void extraction using zobov +# 3 : removal of small voids and voids near the edge startCatalogStage = 1 endCatalogStage = 3 + +# if True, will scan log files for last known completed state and run from there continueRun = True +# re-build the inputs? +regenerateFlag = False + # directory for the input simulation/observational particle files catalogDir = os.getenv("HOME")+"/workspace/Voids/catalog/" @@ -36,9 +47,9 @@ catalogDir = os.getenv("HOME")+"/workspace/Voids/catalog/" hodPath = os.getenv("HOME")+"/projects/Voids/hod/HOD.x" # where to put the final void catalog, figures, and output logs -voidOutputDir = os.getenv("HOME")+"/workspace/Voids//" -figDir = os.getenv("PWD")+"/../figs/" -logDir = os.getenv("PWD")+"/../logs/" +workDir = os.getenv("PWD")+"/output/" +figDir = os.getenv("PWD")+"/figs/" +logDir = os.getenv("PWD")+"/logs/" # where to place the pipeline scripts scriptDir = os.getenv("PWD")+"/scripts//" @@ -127,6 +138,11 @@ haloFilePosRescale = 1.0 # rescaling necessary to get Mpc/h numZobovDivisions = 2 numZobovThreads = 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 = 1.e-9 + # simulation information numPart = 512*512*512 lbox = 999.983 # Mpc/h diff --git a/python_source/vide_pipeline/vide_prepare_simulation.py b/python_source/vide_pipeline/vide_prepare_simulation.py index 02499ee..0fe2753 100644 --- a/python_source/vide_pipeline/vide_prepare_simulation.py +++ b/python_source/vide_pipeline/vide_prepare_simulation.py @@ -53,7 +53,7 @@ parser.add_argument('--parm', dest='parm', args = parser.parse_args() -defaultsFile = "@CMAKE_SOURCE_DIR@/python_source/pipeline/defaults.py" +defaultsFile = "@CMAKE_SOURCE_DIR@/python_source/vide_pipeline/defaults.py" parms = imp.load_source("name", defaultsFile) globals().update(vars(parms)) @@ -148,7 +148,7 @@ def getNickName(setName, sampleName): #------------------------------------------------------------------------------ -# for given dataset parameters, outputs a script for use with analyzeVoids +# for given dataset parameters, outputs a script for use with VIDE pipeline def writeScript(setName, dataFileNameBase, dataFormat, scriptDir, catalogDir, fileNums, redshifts, numSubvolumes, numSlices, useVel, lbox, minRadius, omegaM, subsample=1.0, @@ -167,10 +167,6 @@ from backend.classes import * continueRun = {continueRun} # set to True to enable restarting aborted jobs startCatalogStage = {startCatalogStage} endCatalogStage = {endCatalogStage} - -regenerateFlag = False - -mergingThreshold = 1e-9 dataSampleList = [] """ @@ -190,12 +186,14 @@ logDir = "{logDir}/{setName}/" numZobovDivisions = {numZobovDivisions} numZobovThreads = {numZobovThreads} +mergingThreshold = {mergingThreshold} """ scriptFile.write(dataInfo.format(setName=setName, figDir=figDir, logDir=logDir, voidOutputDir=voidOutputDir, inputDataDir=catalogDir, numZobovDivisions=numZobovDivisions, - numZobovThreads=numZobovThreads)) + numZobovThreads=numZobovThreads, + mergingThreshold=mergingThreshold)) sampleInfo = """