Gadget-HDF5 Functions
CSH and galaxy catalogue generation
The module gen_catalogues
contains Cython functions to generate central subhalo (CSH) and galaxy catalogues from an HDF5 Gadget-type snapshot.
- gadget.gen_catalogues.calcCSHIdxs(int[:] obj_idxs, int start_idx, int nb_shs, int csh_size, int MIN_NUMBER_PTCS)[source]
Return the indices of the particles that belong to the CSH
- Parameters
obj_idxs (int array) – array to store the indices
start_idx (int) – first index that belongs to this CSH
nb_shs ((N1,) ints) – number of SHs in each FoF-halo
csh_size ((N2,) ints) – number of DM particles in the SHs
MIN_NUMBER_PTCS (int) – minimum number of particles for CSH to be valid
- Returns
obj_idxs filled partially with indices
- Return type
int array
- gadget.gen_catalogues.calcObjCat(int[:] nb_shs, int[:] sh_len, int[:] fof_sizes, double[:] group_r200, int MIN_NUMBER_PTCS)[source]
Construct central subhalo (CSH) catalogue from FoF/SH info
Note that the indices returned in each CSH are ‘true index + 1’
- Parameters
nb_shs ((N1,) ints) – number of SHs in each FoF-halo
sh_len ((N2,) ints, N2>N1) – number of DM particles in each subhalo
fof_sizes ((N1,) ints) – number of particles in the FoF-halos
group_r200 ((N1,) doubles) – R200-radius of FoF-halos
MIN_NUMBER_PTCS (int) – minimum number of particles for CSH to be valid
- Returns
obj_cat: indices, obj_r200: R200-radii, obj_size: number of particles in each object
- Return type
int array, double array, int array
HDF5 data extraction
The module read_fof
provides parallelized functions to extract the most important data from an HDF5 FoF halo catalogue.
- gadget.read_fof.getFoFSHData(HDF5_GROUP_DEST, RVIR_OR_R200, PART_TYPE)[source]
Retrieve FoF/SH-related DM HDF5 data from the simulation box
- Parameters
HDF5_GROUP_DEST (string) – path to snapshot, halo/subhalo data
RVIR_OR_R200 (str) – ‘Rvir’ if we want quantities (e.g. D_LOGSTART) to be expressed with respect to the virial radius R_vir, ‘R200’ for the overdensity radius R_200
PART_TYPE (int) – which simulation particles to consider, 0 for gas, 1 for DM, 4 for stars
- Returns
nb_shs (# subhalos in each FoF-halo), sh_len (size of each SH), fof_sizes (size of each FoF-halo), group_r200 (R200 radius of each FoF-halo in units of cMpc/h)
- Return type
double and int arrays