mirror of
https://bitbucket.org/cosmicvoids/vide_public.git
synced 2025-07-04 15:21:11 +00:00
Merge branch 'master' of https://bitbucket.org/cosmicvoids/void_identification
This commit is contained in:
commit
c6dd08bd7d
5 changed files with 318 additions and 257 deletions
|
@ -76,7 +76,7 @@ from void_python_tools.backend.classes import *
|
|||
|
||||
continueRun = False # set to True to enable restarting aborted jobs
|
||||
startCatalogStage = 1
|
||||
endCatalogStage = 4
|
||||
endCatalogStage = 3
|
||||
|
||||
startAPStage = 1
|
||||
endAPStage = 1
|
||||
|
@ -170,15 +170,21 @@ newSample.addStack(0.0, 5.0, 90, 95, False, False)
|
|||
LIGHT_SPEED*lbox, zVsDX, zVsDY)-zBox
|
||||
dzSafe = 0.03
|
||||
else:
|
||||
boxWidthZ = lbox*100./LIGHT_SPEED
|
||||
boxWidthZ = np.interp(vp.angularDiameter(zBox,Om=Om)+100. / \
|
||||
LIGHT_SPEED*lbox, zVsDX, zVsDY)-zBox
|
||||
#boxWidthZ = lbox*100./LIGHT_SPEED
|
||||
dzSafe = 0.0
|
||||
|
||||
for iSlice in xrange(numSlices):
|
||||
sliceMin = zBox + dzSafe + iSlice*(boxWidthZ-dzSafe)/numSlices
|
||||
sliceMax = zBox + dzSafe + (iSlice+1)*(boxWidthZ-dzSafe)/numSlices
|
||||
sliceMin = zBox + dzSafe + iSlice*(boxWidthZ-2.*dzSafe)/numSlices
|
||||
sliceMax = zBox + dzSafe + (iSlice+1)*(boxWidthZ-2.*dzSafe)/numSlices
|
||||
|
||||
sliceMinMpc = sliceMin*LIGHT_SPEED/100.
|
||||
sliceMaxMpc = sliceMax*LIGHT_SPEED/100.
|
||||
if useLightCone:
|
||||
sliceMinMpc = sliceMin*LIGHT_SPEED/100.
|
||||
sliceMaxMpc = sliceMax*LIGHT_SPEED/100.
|
||||
else:
|
||||
sliceMinMpc = LIGHT_SPEED/100.*vp.angularDiameter(sliceMin, Om=Om)
|
||||
sliceMaxMpc = LIGHT_SPEED/100.*vp.angularDiameter(sliceMax, Om=Om)
|
||||
|
||||
sliceMin = "%0.2f" % sliceMin
|
||||
sliceMax = "%0.2f" % sliceMax
|
||||
|
@ -316,7 +322,7 @@ for thisSubSample in sorted(subSamples, reverse=True):
|
|||
else:
|
||||
outFile.write(line)
|
||||
|
||||
outFile.write("-99 -99 -99 -99 -99\n")
|
||||
outFile.write("-99 -99 -99 -99 -99 -99 -99\n")
|
||||
inFile.close()
|
||||
outFile.close()
|
||||
|
||||
|
@ -337,7 +343,7 @@ for thisSubSample in sorted(subSamples, reverse=True):
|
|||
|
||||
outFile.write("%d %e %e %e 0. 0. 0.\n" % (i, x,y,z))
|
||||
|
||||
outFile.write("-99 -99 -99 -99 -99\n")
|
||||
outFile.write("-99 -99 -99 -99 -99 -99 -99\n")
|
||||
outFile.close()
|
||||
|
||||
prevSubSample = thisSubSample
|
||||
|
@ -427,7 +433,7 @@ if (args.halos or args.all) and haloFileBase != "":
|
|||
# write to output file
|
||||
outFile.write("%d %e %e %e %e %e %e\n" %(iHalo,x,y,z,vz,vy,vx))
|
||||
|
||||
outFile.write("-99 -99 -99 -99 -99\n")
|
||||
outFile.write("-99 -99 -99 -99 -99 -99 -99\n")
|
||||
inFile.close()
|
||||
outFile.close()
|
||||
|
||||
|
@ -528,3 +534,5 @@ if (args.hod or args.all) and haloFileBase != "":
|
|||
outFileName = catalogDir+"/"+sampleName+".dat"
|
||||
os.system("mv %s/hod.mock %s" % (catalogDir, outFileName))
|
||||
os.system("rm %s/hod.*" % catalogDir)
|
||||
|
||||
print " Done!"
|
||||
|
|
|
@ -247,7 +247,7 @@ def launchZobov(sample, binPath, zobovDir=None, logDir=None, continueRun=None,
|
|||
os.unlink(vozScript)
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
def launchPrune(sample, binPath, thisDataPortion=None,
|
||||
def launchPrune(sample, binPath,
|
||||
summaryFile=None, logFile=None, zobovDir=None,
|
||||
continueRun=None):
|
||||
|
||||
|
@ -274,7 +274,6 @@ def launchPrune(sample, binPath, thisDataPortion=None,
|
|||
sample.boxLen <= 1.e-1:
|
||||
periodicLine += "z"
|
||||
periodicLine += "' "
|
||||
periodicLine = ""
|
||||
|
||||
if not (continueRun and (jobSuccessful(logFile, "NetCDF: Not a valid ID\n") \
|
||||
or jobSuccessful(logFile, "Done!\n"))):
|
||||
|
@ -287,7 +286,6 @@ def launchPrune(sample, binPath, thisDataPortion=None,
|
|||
cmd += " --extraInfo=" + zobovDir+"/zobov_slice_"+str(sampleName)+\
|
||||
".par"
|
||||
cmd += " --tolerance=1.0"
|
||||
cmd += " --dataPortion=" + thisDataPortion
|
||||
cmd += " --mockIndex=" + str(mockIndex)
|
||||
cmd += " --maxCentralDen=" + str(maxDen)
|
||||
cmd += " --zMin=" + str(sample.zRange[0])
|
||||
|
@ -296,27 +294,8 @@ def launchPrune(sample, binPath, thisDataPortion=None,
|
|||
cmd += " --numVoids=" + str(numVoids)
|
||||
cmd += observationLine
|
||||
cmd += periodicLine
|
||||
cmd += " --output=" + zobovDir+"/voidDesc_"+\
|
||||
str(thisDataPortion)+"_"+\
|
||||
str(sampleName)+".out"
|
||||
cmd += " --outCenters=" + zobovDir+"/barycenters_"+\
|
||||
str(thisDataPortion)+"_"+\
|
||||
str(sampleName)+".out"
|
||||
cmd += " --outInfo=" + zobovDir+"/centers_"+\
|
||||
str(thisDataPortion)+"_"+\
|
||||
str(sampleName)+".out"
|
||||
cmd += " --outNoCutInfo=" + zobovDir+"/centers_nocut_"+\
|
||||
str(thisDataPortion)+"_"+\
|
||||
str(sampleName)+".out"
|
||||
cmd += " --outSkyPositions=" + zobovDir+"/sky_positions_"+\
|
||||
str(thisDataPortion)+"_"+\
|
||||
str(sampleName)+".out"
|
||||
cmd += " --outShapes=" + zobovDir+"/shapes_"+\
|
||||
str(thisDataPortion)+"_"+\
|
||||
str(sampleName)+".out"
|
||||
cmd += " --outDistances=" + zobovDir+"/boundaryDistances_"+\
|
||||
str(thisDataPortion)+"_"+\
|
||||
str(sampleName)+".out"
|
||||
cmd += " --outputDir=" + zobovDir
|
||||
cmd += " --sampleName=" + str(sampleName)
|
||||
cmd += " &> " + logFile
|
||||
f=file("run_prune.sh",mode="w")
|
||||
f.write(cmd)
|
||||
|
@ -956,7 +935,7 @@ def launchFit(sample, stack, logFile=None, voidDir=None, figDir=None,
|
|||
return
|
||||
|
||||
numVoids = int(open(voidDir+"/num_voids.txt", "r").readline())
|
||||
if numVoids < 15:
|
||||
if numVoids < 10:
|
||||
print "not enough voids to fit; skipping!"
|
||||
fp = open(voidDir+"/NOFIT", "w")
|
||||
fp.write("not enough voids: %d \n" % numVoids)
|
||||
|
@ -1334,8 +1313,9 @@ def launchHubble(dataPortions=None, dataSampleList=None, logDir=None,
|
|||
plotTitle = "all samples, incoherent "+\
|
||||
thisDataPortion+" voids (systematics corrected)"
|
||||
else:
|
||||
plotTitle = "all samples, "+thisDataPortion+\
|
||||
" voids (systematics corrected)"
|
||||
#plotTitle = "all samples, "+thisDataPortion+\
|
||||
# " voids (systematics corrected)"
|
||||
plotTitle = setName + "(sysematics corrected)"
|
||||
vp.do_all_obs(zbase, allExpList, aveDistList,
|
||||
rlist, plotTitle=plotTitle, sampleNames=shortSampleNames,
|
||||
plotAve=True, mulfac = 1.16,
|
||||
|
@ -1429,7 +1409,9 @@ def launchLikelihood(dataPortions=None, logDir=None, workDir=None,
|
|||
OmStart = 0.0,
|
||||
OmEnd = 1.0,
|
||||
biasStart = 1.0,
|
||||
biasEnd = 1.2,
|
||||
biasEnd = 1.32,
|
||||
#biasStart = 1.15,
|
||||
#biasEnd = 1.17,
|
||||
outputBase = workDir+"/1dlikelihoods_"+thisDataPortion+"_",
|
||||
useBinAve = False)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue