carried boundary flags all the way through to pruning; cleaned up pruning routines

This commit is contained in:
Paul M. Sutter 2024-06-06 20:26:47 +02:00
parent dd181da42a
commit a45eca0b6e
5 changed files with 124 additions and 139 deletions

View file

@ -161,18 +161,19 @@ def findEdgeGalaxies(galFile, maskFile, edgeGalFile, edgeMaskFile,
phi, theta = convertAngle(RA, Dec)
# check the mask edges
neighbors = healpy.get_all_neighbours(nside, theta, phi)
isOnMaskEdge = any(p == 0 for p in neighbors)
ipix = healpy.ang2pix(nside, theta, phi)
neighbors = healpy.get_all_neighbours(nside, ipix)
isOnMaskEdge = any(mask[p] == 0 for p in neighbors)
# check the redshift boundaries
tol = 0.01 # TODO: made this user-adjustable
tol = 0.05 # TODO: made this user-adjustable
zbuffer = (zmax-zmin)*tol
isOnHighZEdge = (z >= zmax-zbuffer)
isOnLowZEdge = (z <= zmin+zbuffer)
print("DOING %f %f %f %f\n" % (zbuffer, z, zmax, zmin) )
if isOnMaskEdge:
edgeFile.write("1\n")
edgeMask[ipix] = 1
elif isOnHighZEdge:
edgeFile.write("2\n")
elif isOnLowZEdge: