Added double-checking of flagged galaxies to ensure survey boundaries are respected. Python components of launchers now add their status to log files. Rearranged some warnings for broken tessellations due to guard point encounters, since it's not always a bad thing.

This commit is contained in:
Paul M. Sutter 2025-01-17 21:53:25 +08:00
parent 5d93a8a737
commit ad2d3722cc
5 changed files with 122 additions and 36 deletions

View file

@ -448,11 +448,12 @@ def loadVoidCatalog(sampleDir, dataPortion="central", loadParticles=True,
print(" Loading edge flags...")
edgeFlagFile = sampleDir+"/galaxy_edge_flags.txt"
if os.path.isfile(edgeFlagFile):
edgeFlags = np.genfromtxt(edgeFlagFile, dtype=np.int32, skip_header=1)
edgeFlags = np.loadtxt(edgeFlagFile, dtype=np.int32)
for iEdge in range(len(edgeFlags)):
catalog.part[iEdge].edgeFlag = edgeFlags[iEdge]
else:
print(" Edge file not found!")
catalog.part[:].edgeFlag = 0
print(" Loading volumes...")
if sample.hasWeightedVolumes:
@ -476,22 +477,29 @@ def loadVoidCatalog(sampleDir, dataPortion="central", loadParticles=True,
# but the file only stores one half of each pair, so we need to match
for p in range(numPart):
nin = np.fromfile(File, dtype=np.int32, count=1)[0]
for n in range(nin):
pAdj = np.fromfile(File, dtype=np.int32, count=1)[0]
if (p < pAdj):
catalog.part[p].adjs.append(pAdj)
catalog.part[pAdj].adjs.append(p)
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" % (p, nHave, nExpected))
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
#print("NUMBER OF BAD GALAXIES: %d" % nBad)
#badGalFile.close()
print(" Loading zone-void membership info...")
zoneFile = sampleDir+"/voidZone_"+sample.fullName+".dat"