Skip to content

Commit

Permalink
Added isolated object removal to VoidFinder Cartesian example scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
kadglass committed May 6, 2022
1 parent 724e0b5 commit 9af9932
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 16 deletions.
23 changes: 15 additions & 8 deletions example_scripts/Gadget_VoidFinder_periodic.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#-------------------------------------------------------------------------------
import numpy as np

from vast.voidfinder import find_voids
from vast.voidfinder import find_voids, wall_field_separation

from vast.voidfinder.preprocessing import load_data_to_Table
################################################################################
Expand Down Expand Up @@ -54,20 +54,27 @@
# Read in data
#-------------------------------------------------------------------------------
# Read in the simulated data
wall_coords_xyz = load_data_to_Table(sim_filename)
coords_xyz = load_data_to_Table(sim_filename)

#-------------------------------------------------------------------------------
# Restructure the data for the find_voids function
#-------------------------------------------------------------------------------
x = wall_coords_xyz['x']
y = wall_coords_xyz['y']
z = wall_coords_xyz['z']
x = coords_xyz['x']
y = coords_xyz['y']
z = coords_xyz['z']

num_gal = x.shape[0]

wall_coords_xyz = np.concatenate((x.reshape(num_gal,1),
y.reshape(num_gal,1),
z.reshape(num_gal,1)), axis=1)
coords_xyz = np.concatenate((x.reshape(num_gal,1),
y.reshape(num_gal,1),
z.reshape(num_gal,1)), axis=1)
#-------------------------------------------------------------------------------


#-------------------------------------------------------------------------------
# Remove isolated galaxies
#-------------------------------------------------------------------------------
wall_coords_xyz, field_coords_xyz = wall_field_separation(coords_xyz)
#-------------------------------------------------------------------------------
################################################################################

Expand Down
22 changes: 14 additions & 8 deletions example_scripts/Gadget_VoidFinder_xyz.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#-------------------------------------------------------------------------------
import numpy as np

from vast.voidfinder import find_voids
from vast.voidfinder import find_voids, wall_field_separation

from vast.voidfinder.preprocessing import load_data_to_Table
################################################################################
Expand Down Expand Up @@ -54,20 +54,26 @@
# Read in data
#-------------------------------------------------------------------------------
# Read in the simulated data
wall_coords_xyz = load_data_to_Table(galaxies_filename)
coords_xyz = load_data_to_Table(galaxies_filename)

#-------------------------------------------------------------------------------
# Restructure the data for the find_voids function
#-------------------------------------------------------------------------------
x = wall_coords_xyz['x']
y = wall_coords_xyz['y']
z = wall_coords_xyz['z']
x = coords_xyz['x']
y = coords_xyz['y']
z = coords_xyz['z']

num_gal = x.shape[0]

wall_coords_xyz = np.concatenate((x.reshape(num_gal,1),
y.reshape(num_gal,1),
z.reshape(num_gal,1)), axis=1)
coords_xyz = np.concatenate((x.reshape(num_gal,1),
y.reshape(num_gal,1),
z.reshape(num_gal,1)), axis=1)
#-------------------------------------------------------------------------------

#-------------------------------------------------------------------------------
# Remove isolated galaxies
#-------------------------------------------------------------------------------
wall_coords_xyz, field_coords_xyz = wall_field_separation(coords_xyz)
#-------------------------------------------------------------------------------
################################################################################

Expand Down

0 comments on commit 9af9932

Please sign in to comment.