From 7c9086efb837c770f877a15ef2afba11d3a1e7dd Mon Sep 17 00:00:00 2001 From: Paul Matthew Sutter Date: Sun, 9 Feb 2014 11:42:51 +0100 Subject: [PATCH] fixed handling of maskfile and comoving coords in loadPart --- python_tools/void_python_tools/partUtil/partUtil.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/python_tools/void_python_tools/partUtil/partUtil.py b/python_tools/void_python_tools/partUtil/partUtil.py index 055d0ca..9299b04 100644 --- a/python_tools/void_python_tools/partUtil/partUtil.py +++ b/python_tools/void_python_tools/partUtil/partUtil.py @@ -27,6 +27,7 @@ from void_python_tools.backend import * import void_python_tools.apTools as vp import pickle from periodic_kdtree import PeriodicCKDTree +import os NetCDFFile = Dataset ncFloat = 'f8' @@ -95,11 +96,17 @@ def loadPart(sampleDir): boxLen = mul if isObservation == 1: - props = vp.getSurveyProps(sample.maskFile, sample.zBoundary[0], + # look for the mask file + if os.access(sample.maskFile, os.F_OK): + maskFile = sample.maskFile + else: + maskFile = sampleDir+"/"+os.path.basename(sample.maskFile) + print "Using maskfile found in:", maskFile + props = vp.getSurveyProps(maskFile, sample.zBoundary[0], sample.zBoundary[1], sample.zBoundary[0], sample.zBoundary[1], "all", - useLCDM=sample.useLCDM) + useLCDM=sample.useComoving) boxVol = props[0] volNorm = maskIndex/boxVol else: