mirror of
https://bitbucket.org/cosmicvoids/vide_public.git
synced 2025-07-04 23:31:12 +00:00
restarting with multiple subsampling appears to work
This commit is contained in:
parent
eca4ef4362
commit
f7b4e5076b
3 changed files with 25 additions and 19 deletions
2
pipeline/generateCatalog.py
Normal file → Executable file
2
pipeline/generateCatalog.py
Normal file → Executable file
|
@ -1,3 +1,4 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
#+
|
#+
|
||||||
# VIDE -- Void IDEntification pipeline -- ./pipeline/generateCatalog.py
|
# VIDE -- Void IDEntification pipeline -- ./pipeline/generateCatalog.py
|
||||||
# Copyright (C) 2010-2013 Guilhem Lavaux
|
# Copyright (C) 2010-2013 Guilhem Lavaux
|
||||||
|
@ -17,7 +18,6 @@
|
||||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
# 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
|
# does full void analysis. Also generates 2d/1d stacked plots and hubble diagram
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
#+
|
#+
|
||||||
# VIDE -- Void IDEntification pipeline -- ./python_tools/pipeline_source/prepareCatalogs.in.py
|
# VIDE -- Void IDEntification pipeline -- ./python_tools/pipeline_source/prepareCatalogs.in.py
|
||||||
# Copyright (C) 2010-2013 Guilhem Lavaux
|
# Copyright (C) 2010-2013 Guilhem Lavaux
|
||||||
|
@ -17,7 +18,6 @@
|
||||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
#+
|
#+
|
||||||
#!/usr/bin/env python
|
|
||||||
|
|
||||||
# prepares input catalogs based on multidark simulations
|
# prepares input catalogs based on multidark simulations
|
||||||
# (borrows heavily from generateMock, but doesn't hold much in memory)
|
# (borrows heavily from generateMock, but doesn't hold much in memory)
|
||||||
|
|
|
@ -124,21 +124,30 @@ def launchGenerate(sample, binPath, workDir=None, inputDataDir=None,
|
||||||
|
|
||||||
datafile = inputDataDir+"/"+sample.dataFile
|
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
|
prevSubSample = -1
|
||||||
for thisSubSample in sample.subsample.split(', '):
|
for thisSubSample in sample.subsample.split(', '):
|
||||||
|
|
||||||
if prevSubSample == -1:
|
if prevSubSample == -1:
|
||||||
inputParameterFlag = ""
|
inputParameterFlag = ""
|
||||||
outputFile = zobovDir+"/zobov_slice_" + sampleName + "_ss" + thisSubSample
|
outputFile = zobovDir+"/zobov_slice_" + sampleName + "_ss" + \
|
||||||
|
thisSubSample
|
||||||
keepFraction = float(thisSubSample)
|
keepFraction = float(thisSubSample)
|
||||||
subSampleLine = "subsample %g" % keepFraction
|
subSampleLine = "subsample %g" % keepFraction
|
||||||
resubSampleLine = ""
|
resubSampleLine = ""
|
||||||
else:
|
else:
|
||||||
inputParameterFlag = "inputParameter " + zobovDir+"/zobov_slice_"+\
|
inputParameterFlag = "inputParameter " + zobovDir+"/zobov_slice_"+\
|
||||||
sampleName+"_ss"+prevSubSample+".par"
|
sampleName+"_ss"+prevSubSample+".par"
|
||||||
outputFile = zobovDir+"/_zobov_slice_" + sampleName + "_ss" + thisSubSample
|
outputFile = zobovDir+"/zobov_slice_" + sampleName + "_ss" + \
|
||||||
|
thisSubSample
|
||||||
keepFraction = float(thisSubSample)/float(prevSubSample)
|
keepFraction = float(thisSubSample)/float(prevSubSample)
|
||||||
subSampleLine += "subsample %g" % keepFraction
|
subSampleLine = "subsample %g" % keepFraction
|
||||||
resubSampleLine = "resubsample %g" % keepFraction
|
resubSampleLine = "resubsample %g" % keepFraction
|
||||||
|
|
||||||
includePecVelString = ""
|
includePecVelString = ""
|
||||||
|
@ -191,27 +200,24 @@ def launchGenerate(sample, binPath, workDir=None, inputDataDir=None,
|
||||||
|
|
||||||
file(parmFile, mode="w").write(conf)
|
file(parmFile, mode="w").write(conf)
|
||||||
|
|
||||||
doneLine = "Done! %5.2e\n" % keepFraction
|
if (prevSubSample == -1):
|
||||||
print "TEST", doneLine
|
cmd = "%s --configFile=%s &> %s" % (binPath,parmFile,logFile)
|
||||||
if not (continueRun and jobSuccessful(logFile, doneLine)):
|
else:
|
||||||
if (prevSubSample == -1):
|
cmd = "%s --configFile=%s &>> %s" % (binPath,parmFile,logFile)
|
||||||
cmd = "%s --configFile=%s &> %s" % (binPath,parmFile,logFile)
|
os.system(cmd)
|
||||||
else:
|
|
||||||
cmd = "%s --configFile=%s &>> %s" % (binPath,parmFile,logFile)
|
|
||||||
os.system(cmd)
|
|
||||||
|
|
||||||
if not jobSuccessful(logFile, doneLine):
|
|
||||||
print "FAILED!"
|
|
||||||
exit(-1)
|
|
||||||
|
|
||||||
# remove intermediate files
|
# remove intermediate files
|
||||||
if (prevSubSample != -1):
|
if (prevSubSample != -1):
|
||||||
os.unlink(zobovDir+"/zobov_slice_"+sampleName+"_ss"+prevSubSample+".par")
|
os.unlink(zobovDir+"/zobov_slice_"+sampleName+"_ss"+prevSubSample+".par")
|
||||||
os.unlink(zobovDir+"/zobov_slice_"+sampleName+"_ss"+prevSubSample)
|
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
|
prevSubSample = thisSubSample
|
||||||
|
|
||||||
if (continueRun and jobSuccessful(logFile, doneLine)): print "already done!"
|
|
||||||
if jobSuccessful(logFile, doneLine): print "done"
|
if jobSuccessful(logFile, doneLine): print "done"
|
||||||
|
|
||||||
# place the final subsample
|
# place the final subsample
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue