diff --git a/python_source/voidUtil/catalogUtil.py b/python_source/voidUtil/catalogUtil.py index ef14dfa..0aca19a 100644 --- a/python_source/voidUtil/catalogUtil.py +++ b/python_source/voidUtil/catalogUtil.py @@ -453,7 +453,7 @@ def loadVoidCatalog(sampleDir, dataPortion="central", loadParticles=True, catalog.part[iEdge].edgeFlag = edgeFlags[iEdge] else: print(" Edge file not found!") - catalog.part[:].edgeFlag = 0 + #catalog.part[:].edgeFlags = 0 print(" Loading volumes...") if sample.hasWeightedVolumes: @@ -485,22 +485,13 @@ def loadVoidCatalog(sampleDir, dataPortion="central", loadParticles=True, print(" Sanity checking adjacenies...") - nBad = 0 - ## TEST - writing bad galaxies to file - #badGalFile = open("badgal.txt", "w") for p in range(numPart): catalog.part[p].nadjs = len(catalog.part[p].adjs) nHave = len(catalog.part[p].adjs) 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 (catalog.part[p].edgeFlag == 0): - # badGalFile.write("%e %e %e\n" % (catalog.part[p].x, catalog.part[p].y, catalog.part[p].z)) - # nBad += 1 + if (nHave != nExpected and catalog.part[p].edgeFlag == 0): + print(" Error for particle %d: Have %d adj, expected %d (flag: %d)" % (p, nHave, nExpected, catalog.part[p].edgeFlag)) - #print("NUMBER OF BAD GALAXIES: %d" % nBad) - #badGalFile.close() - - print(" Loading zone-void membership info...") zoneFile = sampleDir+"/voidZone_"+sample.fullName+".dat" catalog.void2Zones = [] diff --git a/python_source/voidUtil/plotUtil.py b/python_source/voidUtil/plotUtil.py index c6cf85b..18674a1 100644 --- a/python_source/voidUtil/plotUtil.py +++ b/python_source/voidUtil/plotUtil.py @@ -305,7 +305,7 @@ def plotVoidCells(catalog, # ----------------------------------------------------------------------------- def plotVoronoi(catalog, - voidID, + voidIndex=-1, figDir="./", plotName="voronoi", 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) # 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 # plotName: name to prefix to all outputs @@ -327,7 +327,7 @@ def plotVoronoi(catalog, print(" Selecting particles...") - if (voidID == -1): + if (voidIndex == -1): xmin = plotCenter[0]-plotWidth[0]/2. xmax = plotCenter[0]+plotWidth[0]/2. ymin = plotCenter[1]-plotWidth[1]/2. @@ -348,9 +348,10 @@ def plotVoronoi(catalog, #ax.set_ylim(ymin,ymax) #ax_set.zlim(zmin,zmax) else: + voidID = catalog.voids[voidIndex].voidID partList = getVoidPart(catalog, voidID) - plotCenter = catalog.voids[voidID].macrocenter - plotRadius = catalog.voids[voidID].radius + plotCenter = catalog.voids[voidIndex].macrocenter + plotRadius = catalog.voids[voidIndex].radius xmin = plotCenter[0]-plotRadius xmax = plotCenter[0]+plotRadius