Lightcone-like Sightlines

postprocessing/los_lc/rays_lc.hdf5

We provide 300 lightcone-like lines of sight for THESAN-1. We use a stepwise-constant approximation to build them by combining segments from the same z-aligned line of sight at different snapshots. The portion taken from each snapshot spans the light-travel distance between that snapshot and the next. For the last snapshot (080, z ≈ 5.5), we use the full length of the line of sight, equal to the simulation box size (95.5 cMpc). We use periodic boundary conditions. The gas is held at its snapshot state within each piece, and all 300 lines of sight are stored in one file.

Root Attributes
Attribute Dimensions Units Description
BoxSize 1 ckpc/h\text{ckpc} / h Spatial extent of the periodic box (in comoving units).
HubbleParam 1 - Little hh, defined as h=H0/(100km/s/Mpc)h = H_0 / (100 \text{km}/\text{s}/\text{Mpc})
NumRays 1 - Number of LOS stored in the file.
Omega0 1 - The cosmological density parameter for matter.
OmegaBaryon 1 - The cosmological density parameter for baryons.
UnitLength_in_cm 1 - Length unit used in the simulation, expressed in comoving cm.
UnitMass_in_g 1 - Mass unit used in the simulation, expressed in g.
UnitVelocity_in_cm_per_s 1 - Velocity unit used in the simulation, expressed in comoving cm / s.
Within each LOS file, the properties extracted along the LOS are saved in a number of groups, each one containing a dataset for each ray (named simply with a progressive number, starting from 0). These values are directly extracted from the simulation cell crossed by the ray, and saved as they are. This means that the units and considerations made for such fields (see Snapshots) apply directly to the ray fields. Additionally, LOS properties are saved in a mix of groups (with the same format just described) and datasets. Both are described in the table below. We distinguish groups from dataset in the dimensions column.
Datasets and Groups
Dataset Dim. Units Description
Density group 1010M⊙h2/ckpc310^{10} \text{M}_\odot h^2 / \text{ckpc}^3 Gas density in the Voronoi cell. Internal units.
ElectronAbundance group - Electron abundance, defined as ne/nHn_e / n_H, in each Voronoi cell.
GFM_DustMetallicity group - Dust-to-metal ratio in each Voronoi cell.
GFM_Metallicity group - Gas-phase metallicity in each Voronoi cell.
GFM_Metals group - For each ray, contains the mass fraction of nine species: H, He, C, N, O, Ne, Mg, Si, Fe (in this order). Each one is the dimensionless ratio of mass in that species to the total gas cell mass.
HI_Fraction group - HI fraction (i.e. nHI/nHn_{HI} / n_H ) in the cell.
HeI_Fraction group - HeI fraction (i.e. nHeI/nHn_{HeI} / n_H ) in the cell. Note: the denominator is nHn_H, rather than nHen_{He}.
HeII_Fraction group - HeII fraction (i.e. nHeII/nHn_{HeII} / n_H ) in the cell. Note: the denominator is nHn_H, rather than nHen_{He}.
InternalEnergy group (km/s)2(\text{km}/\text{s})^2 Internal energy of the gas in the Voronoi cell.
MagneticField group (h/a²) √UnitPressureThree-dimensional magnetic field.
PhotonDensity group 1063 photons / (ckpc/h)³ Density of photons in the cells in the three spectral bands tracked in Thesan.
Pixel_Position group BoxSize 3D coordinates in the simulation box (in units of BoxSize) of the segment, including periodic boundary conditions.
RayDirections (Nlos,3) - Direction of each LOS.
RayOrigins (Nlos,3) ckpc/h\text{ckpc}/h Starting point of the LOS.
RaySegments group ckpc/h\text{ckpc}/h Length of each segment composing the LOS. These segments are the intersection of the LOS with the Voronoi tesselation.
Redshift group Redshift of each segment. Notice that this is the redshift the segment would have if the LOS was extracted from a real lightcone (i.e. without piecewise-constant approximation). To know the actual redshift, see the field 'Snapshot'.
Snapshot group Snapshot from which each segment was extracted.
StarFormationRate group M⊙/yr\text{M}_\odot / \text{yr} Star Fromation Rate of the gas.
Velocity group kma/s\text{km} \sqrt{a} /\text{s} Spatial velocity. Multiply this value by a\sqrt{a} to obtain peculiar velocity.

Using the sightlines

The release paper lists the changes from the fixed-redshift files. In particular, the lightcone has no RayEndings dataset. Use the per-segment snapshot field to identify the simulation output that supplied the gas. The redshift assigned along the lightcone tracks position on the ray and can vary within one snapshot segment.

Select a redshift interval

Run from the downloaded Thesan-1/postprocessing directory. The release filenames and geometry are given in Appendix A of Garaldi et al..

import h5py
import numpy as np

with h5py.File("los_lc/rays_lc.hdf5") as f:
    z = f["Redshift/0"][:]
    snap = f["Snapshot/0"][:]
    length = f["RaySegments/0"][:]
    neutral = f["HI_Fraction/0"][:]
    assert z.shape == snap.shape == length.shape == neutral.shape
    use = (z >= 5.9) & (z < 6.1)
    print("contributing snapshots:", np.unique(snap[use]))
    print("path-weighted neutral fraction:", np.average(neutral[use], weights=length[use]))