mirror of
https://bitbucket.org/cosmicvoids/vide_public.git
synced 2025-07-04 15:21:11 +00:00
changed voronoi plotting to take void index rather than ID
This commit is contained in:
parent
ad2d3722cc
commit
b79046ac22
2 changed files with 9 additions and 17 deletions
|
@ -453,7 +453,7 @@ def loadVoidCatalog(sampleDir, dataPortion="central", loadParticles=True,
|
||||||
catalog.part[iEdge].edgeFlag = edgeFlags[iEdge]
|
catalog.part[iEdge].edgeFlag = edgeFlags[iEdge]
|
||||||
else:
|
else:
|
||||||
print(" Edge file not found!")
|
print(" Edge file not found!")
|
||||||
catalog.part[:].edgeFlag = 0
|
#catalog.part[:].edgeFlags = 0
|
||||||
|
|
||||||
print(" Loading volumes...")
|
print(" Loading volumes...")
|
||||||
if sample.hasWeightedVolumes:
|
if sample.hasWeightedVolumes:
|
||||||
|
@ -485,22 +485,13 @@ def loadVoidCatalog(sampleDir, dataPortion="central", loadParticles=True,
|
||||||
|
|
||||||
|
|
||||||
print(" Sanity checking adjacenies...")
|
print(" Sanity checking adjacenies...")
|
||||||
nBad = 0
|
|
||||||
## TEST - writing bad galaxies to file
|
|
||||||
#badGalFile = open("badgal.txt", "w")
|
|
||||||
for p in range(numPart):
|
for p in range(numPart):
|
||||||
catalog.part[p].nadjs = len(catalog.part[p].adjs)
|
catalog.part[p].nadjs = len(catalog.part[p].adjs)
|
||||||
nHave = len(catalog.part[p].adjs)
|
nHave = len(catalog.part[p].adjs)
|
||||||
nExpected = nadjPerPart[p]
|
nExpected = nadjPerPart[p]
|
||||||
if (nHave != nExpected): print(" Error for particle %d: Have %d adj, expected %d (flag: %d)" % (p, nHave, nExpected, catalog.part[p].edgeFlag))
|
if (nHave != nExpected and catalog.part[p].edgeFlag == 0):
|
||||||
#if (catalog.part[p].edgeFlag == 0):
|
print(" Error for particle %d: Have %d adj, expected %d (flag: %d)" % (p, nHave, nExpected, catalog.part[p].edgeFlag))
|
||||||
# badGalFile.write("%e %e %e\n" % (catalog.part[p].x, catalog.part[p].y, catalog.part[p].z))
|
|
||||||
# nBad += 1
|
|
||||||
|
|
||||||
#print("NUMBER OF BAD GALAXIES: %d" % nBad)
|
|
||||||
#badGalFile.close()
|
|
||||||
|
|
||||||
|
|
||||||
print(" Loading zone-void membership info...")
|
print(" Loading zone-void membership info...")
|
||||||
zoneFile = sampleDir+"/voidZone_"+sample.fullName+".dat"
|
zoneFile = sampleDir+"/voidZone_"+sample.fullName+".dat"
|
||||||
catalog.void2Zones = []
|
catalog.void2Zones = []
|
||||||
|
|
|
@ -305,7 +305,7 @@ def plotVoidCells(catalog,
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
def plotVoronoi(catalog,
|
def plotVoronoi(catalog,
|
||||||
voidID,
|
voidIndex=-1,
|
||||||
figDir="./",
|
figDir="./",
|
||||||
plotName="voronoi",
|
plotName="voronoi",
|
||||||
plotCenter = (0,0,0),
|
plotCenter = (0,0,0),
|
||||||
|
@ -314,7 +314,7 @@ def plotVoronoi(catalog,
|
||||||
|
|
||||||
# plots the voronoi cells belonging to a void (or a slice if no void given)
|
# plots the voronoi cells belonging to a void (or a slice if no void given)
|
||||||
# catalog: void catalog
|
# catalog: void catalog
|
||||||
# voidID: ID of void to plot (-1 to use all particles)
|
# voidIndec: index of void to plot (-1 to use all particles)
|
||||||
# figDir: output directory for figures
|
# figDir: output directory for figures
|
||||||
# plotName: name to prefix to all outputs
|
# plotName: name to prefix to all outputs
|
||||||
|
|
||||||
|
@ -327,7 +327,7 @@ def plotVoronoi(catalog,
|
||||||
|
|
||||||
|
|
||||||
print(" Selecting particles...")
|
print(" Selecting particles...")
|
||||||
if (voidID == -1):
|
if (voidIndex == -1):
|
||||||
xmin = plotCenter[0]-plotWidth[0]/2.
|
xmin = plotCenter[0]-plotWidth[0]/2.
|
||||||
xmax = plotCenter[0]+plotWidth[0]/2.
|
xmax = plotCenter[0]+plotWidth[0]/2.
|
||||||
ymin = plotCenter[1]-plotWidth[1]/2.
|
ymin = plotCenter[1]-plotWidth[1]/2.
|
||||||
|
@ -348,9 +348,10 @@ def plotVoronoi(catalog,
|
||||||
#ax.set_ylim(ymin,ymax)
|
#ax.set_ylim(ymin,ymax)
|
||||||
#ax_set.zlim(zmin,zmax)
|
#ax_set.zlim(zmin,zmax)
|
||||||
else:
|
else:
|
||||||
|
voidID = catalog.voids[voidIndex].voidID
|
||||||
partList = getVoidPart(catalog, voidID)
|
partList = getVoidPart(catalog, voidID)
|
||||||
plotCenter = catalog.voids[voidID].macrocenter
|
plotCenter = catalog.voids[voidIndex].macrocenter
|
||||||
plotRadius = catalog.voids[voidID].radius
|
plotRadius = catalog.voids[voidIndex].radius
|
||||||
|
|
||||||
xmin = plotCenter[0]-plotRadius
|
xmin = plotCenter[0]-plotRadius
|
||||||
xmax = plotCenter[0]+plotRadius
|
xmax = plotCenter[0]+plotRadius
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue