From 2c3fe1b35d9ee8166d6e17297aa1b91b7012c14f Mon Sep 17 00:00:00 2001 From: "P.M. Sutter" Date: Mon, 3 Dec 2012 11:00:51 -0600 Subject: [PATCH] fixed support for masked mock data sets; now skips over comments in halo catalogs --- c_tools/mock/generateFromCatalog.cpp | 2 +- pipeline/datasets/multidark.py | 1 + python_tools/pipeline_source/prepareCatalogs.in.py | 6 ++++-- python_tools/void_python_tools/backend/launchers.py | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/c_tools/mock/generateFromCatalog.cpp b/c_tools/mock/generateFromCatalog.cpp index a06d02b..04665ba 100644 --- a/c_tools/mock/generateFromCatalog.cpp +++ b/c_tools/mock/generateFromCatalog.cpp @@ -528,7 +528,7 @@ int main(int argc, char **argv) generateFromCatalog_conf_print_version(); - cout << "Loading NYU data..." << endl; + cout << "Loading data " << args_info.catalog_arg << "..." << endl; vector data; Healpix_Map o_mask; vector pixel_list; diff --git a/pipeline/datasets/multidark.py b/pipeline/datasets/multidark.py index 1d03b74..9ef2506 100644 --- a/pipeline/datasets/multidark.py +++ b/pipeline/datasets/multidark.py @@ -68,6 +68,7 @@ haloFileVXCol = 3 haloFileVYCol = 4 haloFileVZCol = 5 haloFileColSep = ',' +haloFileNumComLines = 0 # adjust these two parameters given the memory contraints on your system: # numZobovDivisions: how many sub-volumes per dimension will zobov process diff --git a/python_tools/pipeline_source/prepareCatalogs.in.py b/python_tools/pipeline_source/prepareCatalogs.in.py index 8295a7d..8040ed1 100755 --- a/python_tools/pipeline_source/prepareCatalogs.in.py +++ b/python_tools/pipeline_source/prepareCatalogs.in.py @@ -316,7 +316,8 @@ if (args.script or args.all) and haloFileBase != "": dataFile = catalogDir+haloFileBase+fileNums[0] inFile = open(dataFile, 'r') numPart = 0 - for line in inFile: + for (iLine, line) in enumerate(inFile): + if iLine < haloFileNumComLines: continue line = line.split(haloFileColSep) if minHaloMass == "none" or float(line[haloFileMCol]) > minHaloMass: numPart += 1 @@ -346,7 +347,8 @@ if (args.halos or args.all) and haloFileBase != "": dataFile = catalogDir+haloFileBase+fileNums[iRedshift] inFile = open(dataFile, 'r') numPart = 0 - for line in inFile: + for (iLine, line) in enumerate(inFile): + if iLine < haloFileNumComLines: continue line = line.split(haloFileColSep) if minHaloMass == "none" or float(line[haloFileMCol]) > minHaloMass: numPart += 1 diff --git a/python_tools/void_python_tools/backend/launchers.py b/python_tools/void_python_tools/backend/launchers.py index 6a2833d..a6f94a7 100755 --- a/python_tools/void_python_tools/backend/launchers.py +++ b/python_tools/void_python_tools/backend/launchers.py @@ -32,7 +32,7 @@ def launchGenerate(sample, binPath, workDir=None, inputDataDir=None, if sample.dataFile == "": datafile = inputDataDir+"/"+sampleName else: - datafile = sample.dataFile + datafile = inputDataDir+"/"+sample.dataFile maskFile = sample.maskFile