mirror of
https://bitbucket.org/cosmicvoids/vide_public.git
synced 2025-07-04 23:31:12 +00:00
Merge branch 'master' of https://bitbucket.org/cosmicvoids/vide_public
This commit is contained in:
commit
a2239750bb
2 changed files with 39 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -4,6 +4,7 @@
|
||||||
.mydepend
|
.mydepend
|
||||||
./pipeline/miscTools/*.out
|
./pipeline/miscTools/*.out
|
||||||
|
|
||||||
|
external/libsdf/libsw/Malloc.c
|
||||||
c_tools/hod/hod
|
c_tools/hod/hod
|
||||||
c_tools/zobov2/jozov2/jozov2
|
c_tools/zobov2/jozov2/jozov2
|
||||||
c_tools/zobov2/voz1b1/voz1b1_2
|
c_tools/zobov2/voz1b1/voz1b1_2
|
||||||
|
|
|
@ -492,3 +492,41 @@ def filterVoidsOnCentralDen(catalog, maxCentralDen):
|
||||||
|
|
||||||
return catalog
|
return catalog
|
||||||
|
|
||||||
|
|
||||||
|
# -----------------------------------------------------------------------------
|
||||||
|
def stackVoids(catalog, stackMode = "ball"):
|
||||||
|
|
||||||
|
# builds a stack of voids from the given catalog
|
||||||
|
# catalog: void catalog
|
||||||
|
# stackMode:
|
||||||
|
# "ball": spherical cut
|
||||||
|
# "voronoi": only void member particles
|
||||||
|
#
|
||||||
|
# returns:
|
||||||
|
# stackedPart: array of relative particle positions in the stack
|
||||||
|
|
||||||
|
rMax = 100.
|
||||||
|
periodicLine = getPeriodic(catalog.sampleInfo)
|
||||||
|
|
||||||
|
if stackMode == "ball":
|
||||||
|
partTree = getPartTree(catalog)
|
||||||
|
|
||||||
|
stackedPart = []
|
||||||
|
for void in catalog.voids:
|
||||||
|
center = void.barycenter
|
||||||
|
|
||||||
|
if stackMode == "ball":
|
||||||
|
localPart = catalog.partPos[ getBall(partTree, center, rMax) ]
|
||||||
|
else:
|
||||||
|
voidPart = getVoidPart(catalog, void.voidID)
|
||||||
|
localPart = np.zeros((3,len(voidPart)))
|
||||||
|
localPart[0,:] = getArray(localPart, 'x')
|
||||||
|
localPart[1,:] = getArray(localPart, 'y')
|
||||||
|
localPart[2,:] = getArray(localPart, 'z')
|
||||||
|
|
||||||
|
shiftedPart = shiftPart(localPart, center, periodicLine, catalog.ranges)
|
||||||
|
|
||||||
|
stackedPart.extend(shiftedPart)
|
||||||
|
|
||||||
|
return stackedPart
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue