mirror of
https://bitbucket.org/cosmicvoids/vide_public.git
synced 2025-07-04 15:21:11 +00:00
added error handling on read of sselection function file
This commit is contained in:
parent
f190968a81
commit
ea3faa2e4c
1 changed files with 8 additions and 3 deletions
|
@ -44,7 +44,14 @@ def getSurveyProps(maskFile, zmin, zmax, selFunMin, selFunMax, portion, selectio
|
||||||
selFunMax *= 3000
|
selFunMax *= 3000
|
||||||
volume = area * (zmax**3 - zmin**3) / 3
|
volume = area * (zmax**3 - zmin**3) / 3
|
||||||
|
|
||||||
if selectionFuncFile != None:
|
if selectionFuncFile == None:
|
||||||
|
nbar = 1.0
|
||||||
|
|
||||||
|
elif not os.access(selectionFuncFile, os.F_OK):
|
||||||
|
print " Warning, selection function file %s not found, using default of uniform selection." % selectionFuncFile
|
||||||
|
nbar = 1.0
|
||||||
|
|
||||||
|
else:
|
||||||
selfunc = np.genfromtxt(selectionFuncFile)
|
selfunc = np.genfromtxt(selectionFuncFile)
|
||||||
selfunc = np.array(selfunc)
|
selfunc = np.array(selfunc)
|
||||||
selfunc[:,0] = selfunc[:,0]/100.
|
selfunc[:,0] = selfunc[:,0]/100.
|
||||||
|
@ -72,8 +79,6 @@ def getSurveyProps(maskFile, zmin, zmax, selFunMin, selFunMax, portion, selectio
|
||||||
|
|
||||||
nbar = ntotal / area / nbar
|
nbar = ntotal / area / nbar
|
||||||
|
|
||||||
else:
|
|
||||||
nbar = 1.0
|
|
||||||
|
|
||||||
#print "PROPERTIES: ", volume, nbar
|
#print "PROPERTIES: ", volume, nbar
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue