postprocessing/cross_link/cross_link.hdf5
One file contains the snapshot mappings. In the THESAN-1 production file the target group is to_Thesan-Dark-1.
Matching Haloes across Runs
Several THESAN runs share the same initial conditions but use different physical models. The cross-match files link haloes between these runs.
These files are produced in the same way as the merger trees, with the difference that haloes in coeval snapshots were linked together, rather than haloes in successive snapshots within the same simulation.
The results were then re-arranged into a HDF5 file for each simulation run.
File Format
The cross-link file for a run SIM1 contains a group for each other THESAN run (SIM2) with the same initial conditions.
These are named to_SIM2. Within each of these groups, there is one dataset for each snapshot of the simulation.
Each dataset contains a number of integer values equal to the number of subhaloes in SIM1 for that snapshot.
Each number in the dataset corresponds to the global index (see offsets) of the subhalo in SIM2 matched to the corresponding subhalo in SIM1 in the same snapshot.
This means that the subhalo with global index IDX1 in the snapshot SNAP in SIM1 is associated to the subhalo in SIM2 with global index cross_link_file/to_SIM2/snap_SNAP[IDX1].
A value of โ1 means that no counterpart was found. Check for it before using the result as a Python index. For a one-to-one sample, also look up the counterpart in the reverse catalog and require it to point back to the original subhalo.
Look up a THESAN-Dark-1 counterpart
Paths in this example are relative to Thesan-1/postprocessing/.
import h5py
with h5py.File("cross_link/cross_link.hdf5") as f:
match = int(f["to_Thesan-Dark-1/snap_080"][42])
print("THESAN-1 subhalo 42 โ", match)
Output from THESAN-1
THESAN-1 subhalo 42 โ 47