mirror of
https://bitbucket.org/cosmicvoids/vide_public.git
synced 2025-07-04 15:21:11 +00:00
carried boundary flags all the way through to pruning; cleaned up pruning routines
This commit is contained in:
parent
dd181da42a
commit
a45eca0b6e
5 changed files with 124 additions and 139 deletions
|
@ -446,6 +446,31 @@ def launchZobov(sample, binPath, outputDir=None, logDir=None, continueRun=None,
|
|||
else:
|
||||
volFileToUse = outputDir+"/vol_"+sampleName+".dat"
|
||||
|
||||
# re-weight the volumes of any edge galaxies to prevent watershed
|
||||
# from spilling outside of survey region
|
||||
if sample.dataType == "observation":
|
||||
|
||||
# read in the appropriate volume file
|
||||
with open(volFileToUse, mode="rb") as File:
|
||||
numPartTot = np.fromfile(File, dtype=np.int32,count=1)[0]
|
||||
vols = np.fromfile(File, dtype=np.float32, count=numPartTot)
|
||||
|
||||
# read in the edge flag information
|
||||
edgeFile = outputDir+"/galaxy_edge_flags.txt"
|
||||
edgeFlags = np.loadtxt(edgeFile, dtype=np.int32)
|
||||
|
||||
# set edge galaxy volumes to nearly 0 (implying very high density)
|
||||
vols[ edgeFlags>0 ] = 1.e-4
|
||||
|
||||
volFile = outputDir+"/vol_weighted_"+sampleName+".dat"
|
||||
with open(volFile, mode='wb') as File:
|
||||
numPartTot.astype(np.int32).tofile(File)
|
||||
vols.astype(np.float32).tofile(File)
|
||||
|
||||
volFileToUse = outputDir+"/vol_weighted_"+sampleName+".dat"
|
||||
else:
|
||||
volFileToUse = outputDir+"/vol_"+sampleName+".dat"
|
||||
|
||||
|
||||
cmd = [binPath+"/jozov2", \
|
||||
outputDir+"/adj_"+sampleName+".dat", \
|
||||
|
@ -525,6 +550,7 @@ def launchPrune(sample, binPath,
|
|||
cmd += " --zone2Part=" + outputDir+"/voidPart_"+str(sampleName)+".dat"
|
||||
cmd += " --partVol=" + outputDir+"/vol_"+str(sampleName)+".dat"
|
||||
cmd += " --partAdj=" + outputDir+"/adj_"+str(sampleName)+".dat"
|
||||
cmd += " --partEdge=" + outputDir+"galaxy_edge_flags.txt"
|
||||
cmd += " --extraInfo=" + outputDir+"/zobov_slice_"+str(sampleName)+\
|
||||
".par"
|
||||
cmd += " --tolerance=" + str(boundaryTolerance)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue