postprocessing/los/rays_NNN.hdf5
We provide 150 random lines of sight for each THESAN-1 snapshot from 054 through 080. They start at random positions within the simulation box and follow random directions for 100 cMpc, using periodic boundary conditions to wrap around the box when necessary. On Globus, select rays_NNN.hdf5 in los. The production copy places the same random rays under los/random_origin/.
File Reference
The lines of sight for each snapshot are stored in a separate HDF5 file. General information is stored in the attributes of the Header group, including the length of each ray (RayLength_cMpc). The gas fields and segment lengths follow the traversal order of each ray.
Header Attributes
| Attribute | Dimensions | Units | Description |
|---|---|---|---|
| BoxSize | 1 | Spatial extent of the periodic box (in comoving units). | |
| HubbleParam | 1 | - | Little , defined as |
| MultipleOrigins | 1 | - | Flag indicating that the LOS have different origins within the simulation box. |
| 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. |
| RayImpact | 1 | - | Meaningless for the current configuration. |
| RayLength | 1 | Length of the LOS. | |
| RayLength_cMpc | 1 | cMpc | Length of the LOS in . |
| RaySphere | 1 | - | Meaningless for the current configuration. |
| Redshift | 1 | - | The redshift corresponding to the current snapshot. |
| 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. |
Datasets and Groups
| Dataset | Dim. | Units | Description |
|---|---|---|---|
| Density | group | Gas density in the Voronoi cell. Internal units. | |
| ElectronAbundance | group | - | Electron abundance, defined as , 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. ) in the cell. |
| HeI_Fraction | group | - | HeI fraction (i.e. ) in the cell. Note: the denominator is , rather than . |
| HeII_Fraction | group | - | HeII fraction (i.e. ) in the cell. Note: the denominator is , rather than . |
| InternalEnergy | group | Internal energy of the gas in the Voronoi cell. | |
| MagneticField | group | (h/a²) √UnitPressure | Three-dimensional magnetic field. |
| PhotonDensity | group | 1063 photons / (ckpc/h)³ | Photon number density in each of the three ionizing bands. In the sampled random-ray files the group’s to_cgs includes the inverse volume only. To obtain a physical density in cm⁻³, multiply the stored value by 1063 (h / [a × UnitLength_in_cm])³. |
| RayOrigins | (Nlos,3) | Starting point of the LOS. | |
| RayEndings | (Nlos,3) | End point of the LOS. Note that this does not include the box wrapping due to PBC, so this value can nominally lie outside of the simulation box, although the rays include PBC.. | |
| RaySegments | group | Length of each segment composing the LOS. These segments are the intersection of the LOS with the Voronoi tesselation. | |
| StarFormationRate | group | Star Fromation Rate of the gas. | |
| Velocity | group | Spatial velocity. Multiply this value by to obtain peculiar velocity. |
The CSV contains the first 512 segments of ray 0. To reproduce the distance coordinate in cMpc, take np.cumsum(length) - 0.5 * length after converting segment lengths as shown below.
Measure the neutral fraction along a ray
Paths in this example are relative to Thesan-1/postprocessing/.
import h5py
import numpy as np
with h5py.File("los/rays_054.hdf5") as f:
length = f["RaySegments/0"][:] / (1000 * f["Header"].attrs["HubbleParam"])
x_hi = f["HI_Fraction/0"][:]
print("length [cMpc]:", f"{length.sum():.5g}")
print("path-weighted neutral fraction:", f"{np.average(x_hi, weights=length):.5g}")
Output from THESAN-1
length [cMpc]: 100 path-weighted neutral fraction: 0.26355