Cartesian Outputs

While running the THESAN simulations we output high time cadence Cartesian outputs of the full particle data onto a regular Cartesian grid using a first order Particle-In-Cell approach. THESAN-1 uses a 10243 grid while the medium resolution runs use 5123 grids, setting the cell sizes to ∼93 and ∼186 ckpc, respectively. For THESAN-1, we also provide a coarse-grained version of the Cartesian output on a 5123 grid, to enable a faithful comparison with the medium-resolution runs. While most of the quantities like the gas and stellar density, ionization fraction, and temperature are binned on a regular spatial grid, observables like the 21 cm emission and Lyman-alpha luminosities are binned in redshift space which accounts for Doppler shifting due to the peculiar velocities of the galaxies (i.e. individual gas cells). This redshift-space binning is carried out assuming the observed direction is aligned with the +z axis. The Cartesian outputs are written every ∼2.8 Myr amounting to about 400 snapshots over the duration of the simulation. These lower resolution higher time-cadence outputs are ideal for studying the large scale properties of the reionization process.

The main grids are written about every 2.8 Myr, compared with about 11 Myr between full snapshots. A flattened grid uses C order, with the z coordinate changing fastest. Use the Cartesian output number when selecting a grid, even if a snapshot has a similar redshift. The release overview shows the two output sequences together.

We now provide the full list of Cartesian output quantities. The main simulation attributes are provided in the Header HDF5 group:
Header Attributes
Attribute Dimensions Units Description
BoxSize 1 ckpc/h\text{ckpc} / h Spatial extent of the periodic box (in comoving units).
HubbleParam 1 100km/s/Mpc100\,\text{km/s/Mpc} Hubble constant (little hh in standard units).
NumFiles 1 - Number of subfiles per output.
NumPixels 1 - Number of pixels (cells) in each Cartesian dimension.
Omega0 1 - The cosmological density parameter for matter.
OmegaBaryon 1 - The cosmological density parameter for baryonic matter.
OmegaLambda 1 - The cosmological density parameter for the cosmological constant.
Redshift 1 - The redshift corresponding to the current output.
Time 1 - The scale factor a=1/(1+z)a=1/(1+z) corresponding to the current output.
UnitLength_in_cm 1 - Code length units in cm.
UnitMass_in_g 1 - Code mass units in g.
UnitVelocity_in_cm_per_s 1 - Code velocity units in cm/s.
The following HDF5 datasets are on 3D spatial grids:
Spatial Grid Datasets
Attribute Dimensions Units Description
Density N (1010M⊙/h)/(ckpc/h)3(10^{10}\,\text{M}_{\odot} / h) / (\text{ckpc} / h)^3 Comoving gas mass density (calculated as gas mass/volume).
DensityStars N (1010M⊙/h)/(ckpc/h)3(10^{10}\,\text{M}_{\odot} / h) / (\text{ckpc} / h)^3 Comoving stellar mass density (calculated as stellar mass/volume).
DensityDust N (1010M⊙/h)/(ckpc/h)3(10^{10}\,\text{M}_{\odot} / h) / (\text{ckpc} / h)^3 Comoving dust mass density (calculated as dust mass/volume).
DensityMetals N (1010M⊙/h)/(ckpc/h)3(10^{10}\,\text{M}_{\odot} / h) / (\text{ckpc} / h)^3 Comoving metal mass density (calculated as metal mass/volume).
HII_Fraction N - Ionized hydrogen fraction nHI/nHn_\mathrm{HI} / n_\mathrm{H} (mass-weighted).
HeIII_Fraction N - Doubly ionized helium fraction nHeIII/nHn_\mathrm{HeIII} / n_\mathrm{H} (mass-weighted).
Temperature N K\text{K} Gas temperature (mass-weighted).
IonEnergy N (1010M⊙/h)⋅(km/s)2(10^{10}\,\text{M}_{\odot} / h) \cdot (\text{km/s})^2 Ionizing radiation energy, EionE_\mathrm{ion}.
IonFlux N,3 (1010M⊙/h)⋅(km/s)3(10^{10}\,\text{M}_{\odot} / h) \cdot (\text{km/s})^3 Ionizing radiation flux, 𝐅=(Fx,Fy,Fz)\mathbf{F} = (F_x,F_y,F_z).

Note: The IonEnergy and IonFlux fields are not densities. They are also affected by the reduced speed of light c̃=0.2c\tilde{c} = 0.2\,c. For example, after converting to cgs units the photo-ionization integral would be ΓHI=c̃σHI𝙸𝚘𝚗𝙴𝚗𝚎𝚛𝚐𝚢/𝙼𝚎𝚊𝚗𝙿𝚑𝚘𝚝𝚘𝚗𝙴𝚗𝚎𝚛𝚐𝚢/𝚅𝚘𝚡𝚎𝚕𝚅𝚘𝚕𝚞𝚖𝚎\Gamma_\mathrm{HI} = \tilde{c} \sigma_\mathrm{HI} \mathtt{IonEnergy} / \mathtt{MeanPhotonEnergy} / \mathtt{VoxelVolume}.

The following HDF5 datasets are on redshift-distorted spatial grids:
Spectral Grid Datasets
Attribute Dimensions Units Description
DensityHI N (1010M⊙/h)/(ckpc/h)3(10^{10}\,\text{M}_{\odot} / h) / (\text{ckpc} / h)^3 Comoving HI mass density (calculated as 0.76×xHI×0.76 \times x_\mathrm{HI} \times gas mass/volume) for the 21 cm emission.
IonLuminosityStars N (1010M⊙/kpc)⋅(km/s)3(10^{10}\,\text{M}_{\odot} / \text{kpc}) \cdot (\text{km/s})^3 Ionizing luminosity emitted by stars.
IonLuminosityAGN N (1010M⊙/kpc)⋅(km/s)3(10^{10}\,\text{M}_{\odot} / \text{kpc}) \cdot (\text{km/s})^3 Ionizing luminosity emitted by AGN.
LyaLuminosityRec N (1010M⊙/kpc)⋅(km/s)3(10^{10}\,\text{M}_{\odot} / \text{kpc}) \cdot (\text{km/s})^3 Lyman-alpha luminosity from resolved recombination emission.
LyaLuminosityCol N (1010M⊙/kpc)⋅(km/s)3(10^{10}\,\text{M}_{\odot} / \text{kpc}) \cdot (\text{km/s})^3 Lyman-alpha luminosity from collisional excitation emission.
StarFormationRate N M⊙/yr\text{M}_{\odot} / \text{yr} Instantaneous star formation rate of this voxel.

Note: The IonLuminosity, LyaLuminosity, and StarFormationRate fields are not densities.

Similar to snapshots and group catalogs the Cartesian data are split into multiple files named as: output/cartesian_NNN/cartesian_NNN.CCC.hdf5, where NNN is the left-zero-padded Cartesian output number, and CCC is the left-zero-padded chunk file number. The three-dimensional grid is flattened into a C-ordered array (with the z-axis increasing fastest) and then split into chunks each saved in a different HDF5 file. For convenience, we provide example python code to read the Density field:
Read the density grid

This reads the complete density field. A 1024³ grid of 32-bit values requires 4 GiB for the array. For a small sample, see reading a virtual dataset.

from pathlib import Path
import h5py
import numpy as np

def read_render(snap=300, ren_dir="Thesan-1/output"):
    """Assemble the Cartesian density grid from its numbered HDF5 chunks."""
    prefix = f"cartesian_{snap:03d}"
    directory = Path(ren_dir) / prefix
    files = sorted(directory.glob(f"{prefix}.*.hdf5"),
                   key=lambda path: int(path.name.split(".")[-2]))
    if not files:
        raise FileNotFoundError(directory)
    with h5py.File(files[0]) as first:
        header = first["Header"].attrs
        n = int(header["NumPixels"])
        count = int(header["NumFiles"])
        density = np.empty(n**3, dtype=first["Density"].dtype)

    if [int(path.name.split(".")[-2]) for path in files] != list(range(count)):
        raise ValueError("One or more Cartesian chunks are missing")
    offset = 0
    for path in files:
        with h5py.File(path) as chunk:
            field = chunk["Density"]
            end = offset + field.size
            density[offset:end] = field[:]
            offset = end
    if offset != density.size:
        raise ValueError("The chunks do not cover the full grid")
    return density.reshape(n, n, n)