restarting with multiple subsampling appears to work

This commit is contained in:
P.M. Sutter 2013-03-04 10:44:00 -06:00
parent eca4ef4362
commit f7b4e5076b
3 changed files with 25 additions and 19 deletions

2
pipeline/generateCatalog.py Normal file → Executable file
View file

@ -1,3 +1,4 @@
#!/usr/bin/env python
#+
# VIDE -- Void IDEntification pipeline -- ./pipeline/generateCatalog.py
# Copyright (C) 2010-2013 Guilhem Lavaux
@ -17,7 +18,6 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#+
#!/usr/bin/env python
# does full void analysis. Also generates 2d/1d stacked plots and hubble diagram

View file

@ -1,3 +1,4 @@
#!/usr/bin/env python
#+
# VIDE -- Void IDEntification pipeline -- ./python_tools/pipeline_source/prepareCatalogs.in.py
# Copyright (C) 2010-2013 Guilhem Lavaux
@ -17,7 +18,6 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#+
#!/usr/bin/env python
# prepares input catalogs based on multidark simulations
# (borrows heavily from generateMock, but doesn't hold much in memory)

View file

@ -124,21 +124,30 @@ def launchGenerate(sample, binPath, workDir=None, inputDataDir=None,
datafile = inputDataDir+"/"+sample.dataFile
# check if the final subsampling is done
lastSample = sample.subsample.split(', ')[-1]
doneLine = "Done! %5.2e\n" % float(lastSample)
if (continueRun and jobSuccessful(logFile, doneLine)):
print "already done!"
return
prevSubSample = -1
for thisSubSample in sample.subsample.split(', '):
if prevSubSample == -1:
inputParameterFlag = ""
outputFile = zobovDir+"/zobov_slice_" + sampleName + "_ss" + thisSubSample
outputFile = zobovDir+"/zobov_slice_" + sampleName + "_ss" + \
thisSubSample
keepFraction = float(thisSubSample)
subSampleLine = "subsample %g" % keepFraction
resubSampleLine = ""
else:
inputParameterFlag = "inputParameter " + zobovDir+"/zobov_slice_"+\
sampleName+"_ss"+prevSubSample+".par"
outputFile = zobovDir+"/_zobov_slice_" + sampleName + "_ss" + thisSubSample
outputFile = zobovDir+"/zobov_slice_" + sampleName + "_ss" + \
thisSubSample
keepFraction = float(thisSubSample)/float(prevSubSample)
subSampleLine += "subsample %g" % keepFraction
subSampleLine = "subsample %g" % keepFraction
resubSampleLine = "resubsample %g" % keepFraction
includePecVelString = ""
@ -191,27 +200,24 @@ def launchGenerate(sample, binPath, workDir=None, inputDataDir=None,
file(parmFile, mode="w").write(conf)
doneLine = "Done! %5.2e\n" % keepFraction
print "TEST", doneLine
if not (continueRun and jobSuccessful(logFile, doneLine)):
if (prevSubSample == -1):
cmd = "%s --configFile=%s &> %s" % (binPath,parmFile,logFile)
else:
cmd = "%s --configFile=%s &>> %s" % (binPath,parmFile,logFile)
os.system(cmd)
if not jobSuccessful(logFile, doneLine):
print "FAILED!"
exit(-1)
if (prevSubSample == -1):
cmd = "%s --configFile=%s &> %s" % (binPath,parmFile,logFile)
else:
cmd = "%s --configFile=%s &>> %s" % (binPath,parmFile,logFile)
os.system(cmd)
# remove intermediate files
if (prevSubSample != -1):
os.unlink(zobovDir+"/zobov_slice_"+sampleName+"_ss"+prevSubSample+".par")
os.unlink(zobovDir+"/zobov_slice_"+sampleName+"_ss"+prevSubSample)
doneLine = "Done! %5.2e\n" % keepFraction
if not jobSuccessful(logFile, doneLine):
print "FAILED!"
exit(-1)
prevSubSample = thisSubSample
if (continueRun and jobSuccessful(logFile, doneLine)): print "already done!"
if jobSuccessful(logFile, doneLine): print "done"
# place the final subsample