From 5b7e94c4b17ab07aa12e3cbc7253290cb82afbc0 Mon Sep 17 00:00:00 2001 From: "P.M. Sutter" Date: Wed, 4 Jun 2014 22:46:26 -0500 Subject: [PATCH] more ramses fixes --- c_tools/mock/loaders/ramses_loader.cpp | 5 +---- python_tools/void_python_tools/backend/launchers.py | 6 +++--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/c_tools/mock/loaders/ramses_loader.cpp b/c_tools/mock/loaders/ramses_loader.cpp index ac4b7a4..aa7936d 100644 --- a/c_tools/mock/loaders/ramses_loader.cpp +++ b/c_tools/mock/loaders/ramses_loader.cpp @@ -95,12 +95,9 @@ public: if (id >= _num_files) return 0; - - d = loadRamsesSimu("/home/ben/phd/software/VIDE/vide_public/output_00091/", baseid, id, double_precision, load_flags); + d = loadRamsesSimu(snapshot_name.c_str(), baseid, id, double_precision, load_flags); assert(d != 0); - cout << " Id " << id << "\n"; - if (d->Id != 0) { long *uniqueID = new long[d->NumPart]; diff --git a/python_tools/void_python_tools/backend/launchers.py b/python_tools/void_python_tools/backend/launchers.py index dfec000..fa7cb4c 100644 --- a/python_tools/void_python_tools/backend/launchers.py +++ b/python_tools/void_python_tools/backend/launchers.py @@ -170,7 +170,8 @@ def launchGenerate(sample, binPath, workDir=None, inputDataDir=None, elif sample.dataFormat == "sdf": dataFileLine = "sdf " + datafile elif sample.dataFormat == "ramses": - dataFileLine = "ramses " + os.path.split(datafile)[0] + '/' # just want the output directory + ramsesId = int(os.path.split(datafile)[1][-5:len(datafile)]) # picks out the particle file (should be the output_NNNNN, then extracts the output id "NNNNN" as an integer) + dataFileLine = "ramses " + datafile + "/" else: raise ValueError("unknown dataFormat '%s'" % sample.dataFormat) @@ -186,8 +187,7 @@ def launchGenerate(sample, binPath, workDir=None, inputDataDir=None, if not sample.shiftSimZ: reshiftFlag = "preReShift" if sample.dataFormat == "ramses": - ramsesId = int((os.path.split(datafile)[1])[5:10]) # picks out the particle file (should be the part_NNNNN.outXXXXX, then extracts the output id "NNNNN" as an integer) - ramsesIdLine = "ramsesId " + ramsesId + ramsesIdLine = "ramsesId " + str(ramsesId) else: ramsesIdLine = ""