postprocessing/Lya/Lya_NNN.hdf5
The group and subhalo arrays follow catalog order. Use the conversion attributes on the dataset. The production directory includes 000–081. For propagation outside galaxies, see the guide to velocity-resolved Lyα transmission.
File Reference
For all snapshots we produce Lyα catalogs directly mirroring the friends-of-friends (FoF) halo catalogs and SUBFIND subhalo catalogs. These post-processing files provide supplemental data for each group and subhalo, corresponding to identifications of dark matter halos and galaxies, respectively. There is a single HDF5 file for each snapshot named Lya_[file].hdf5 containing the following groups: Header, Group, Subhalo, Inner, Outer, and Total. For convenience, these contain information about the simulation, group/subhalo sums, and global sums of various luminosities over all groups, subhaloes, inner/outer "fuzz" of unbound particles, and the entire simulation box. Full details are given in Section 3 of Smith et al. (2022).
Header HDF5 group:
Header Attributes
| Attribute | Dimensions | Units | Description |
|---|---|---|---|
| BoxSize | 1 | Spatial extent of the periodic box (in comoving units). | |
| EscapeFraction | 1 | - | Birth cloud escape fraction. |
| HubbleParam | 1 | Hubble constant (little in standard units). | |
| Ngroups_Total | 1 | - | Total number of FoF groups in the entire catalog. |
| Nsubgroups_Total | 1 | - | Number of SUBFIND subgroups in the entire catalog. |
| 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 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. |
Group and Subhalo HDF5 groups:
Group and Subhalo
| Attribute | Dimensions | Units | Description |
|---|---|---|---|
| 1216LumStars | N | Stellar continuum spectral luminosity at 1216 Å. | |
| 1500LumStars | N | Stellar continuum spectral luminosity at 1500 Å. | |
| 2500LumStars | N | Stellar continuum spectral luminosity at 2500 Å. | |
| IonLumAGN | N | Ionizing luminosity from active galactic nuclei (AGN). | |
| LyaLum | N | Total Lyα luminosity (). | |
| LyaLumCol | N | Lyα luminosity from resolved collisional excitation emission. | |
| LyaLumRec | N | Lyα luminosity from resolved recombination emission. | |
| LyaLumStars | N | Lyα luminosity from unresolved HII regions. | |
| LyaPos | N | Center of Lyα luminosity position, computed as the sum of the luminosity weighted relative coordinates of all member stars/cells. Comoving coordinate. | |
| LyaVel | N | Center of Lyα luminosity peculiar velocity, computed as the sum of the luminosity weighted relative velocities of all member stars/cells. | |
| LyaVelDisp | N | Center of Lyα luminosity one-dimensional velocity dispersion, computed as the luminosity weighted standard deviation of velocities of all member stars/cells divided by . |
Note: The Subhalo_NoSFR HDF5 group contains luminosities based on the exact star particle ages, whereas Subhalo uses a noise reduction technique to reinterpret ages to be more consistent with the star-formation rate (SFR). The simulations employ stochastic sampling to determine when new star particles are created, with comparable mass resolutions for star and gas particles. The age discretization leads to characteristically bursty star-formation histories (SFHs) in marginally resolved haloes. To extend the reliability of halo-by-halo predictions for galaxies at the faint-end of the luminosity function we employ the following SFH smoothing procedure. We first calculate the total mass of young stars () in each subhalo and combine this with the instantaneous SFR to define a duration over which we expect these stars to have formed: . In the event that this duration is longer than we reassign the young stars as having all been formed with a constant SFR with the expected ages. This is done with 100 equal age bins in the interval , retaining the mass and metallicity distribution of each stellar population. This prescription helps us to smooth out an artificial bump around or , corresponding to newly spawned star particles in low mass haloes, while the rest of the luminosities are essentially unaltered.
Group, Subhalo, Inner, Outer, and Total
| Attribute | Dimensions | Units | Description |
|---|---|---|---|
| Tot1216LumStars | 1 | Stellar continuum spectral luminosity at 1216 Å. | |
| Tot1500LumStars | 1 | Stellar continuum spectral luminosity at 1500 Å. | |
| Tot2500LumStars | 1 | Stellar continuum spectral luminosity at 2500 Å. | |
| TotIonLumAGN | 1 | Ionizing luminosity from active galactic nuclei (AGN). | |
| TotLyaLum | 1 | Total Lyα luminosity (). | |
| TotLyaLumCol | 1 | Lyα luminosity from resolved collisional excitation emission. | |
| TotLyaLumEoS | 1 | Lyα luminosity subtotal associated with equation of state (EoS) cells. | |
| TotLyaLumRec | 1 | Lyα luminosity from resolved recombination emission. | |
| TotLyaLumStars | 1 | Lyα luminosity from unresolved HII regions. |
Read the emission catalog
import numpy as np
import h5py
c = 2.99792458e10 # Speed of light [cm/s]
h = 6.626069573e-27 # Planck's constant [erg/s]
pc = 3.085677581467192e18 # Units: 1 pc = 3e18 cm
angstrom = 1e-8 # One angstrom in cm
Mpc = 1e6 * pc
lambda_1216 = 1215.67 * angstrom
lambda_1500 = 1500. * angstrom # Continuum wavelength [cm]
R_10pc = 10. * pc # Reference distance for continuum [cm]
fnu_1500_fac = lambda_1500**2 / (4. * np.pi * c * R_10pc**2 * angstrom)
E_AGN = 5.29e-11 # Mean photon energy [erg]
E_Lya = h * c / lambda_1216 # Lyman-alpha energy [erg]
def read_Lya(snap=70, sim_dir='Thesan-1'):
Lya_filename = f'{sim_dir}/postprocessing/Lya/Lya_{snap:03d}.hdf5'
with h5py.File(Lya_filename, 'r') as f:
g = f['Header']
s = {'snap': snap}
for key in ['BoxSize', 'EscapeFraction', 'Omega0', 'OmegaBaryon', 'OmegaLambda', 'HubbleParam', 'Time', 'Redshift']:
s[key] = g.attrs[key]
h = g.attrs['HubbleParam']
a = g.attrs['Time']
z = g.attrs['Redshift']
UnitLength_in_cm = g.attrs['UnitLength_in_cm']
UnitMass_in_g = g.attrs['UnitMass_in_g']
UnitVelocity_in_cm_per_s = g.attrs['UnitVelocity_in_cm_per_s']
UnitTime_in_s = UnitLength_in_cm / UnitVelocity_in_cm_per_s
UnitEnergy_in_cgs = UnitMass_in_g * UnitVelocity_in_cm_per_s * UnitVelocity_in_cm_per_s
UnitLum_in_cgs = UnitEnergy_in_cgs / UnitTime_in_s
length_to_cgs = a * UnitLength_in_cm / h
s['BoxSize_cMpc'] = s['BoxSize'] * length_to_cgs / (a * Mpc) # Box size [cMpc]
s['V_box_cMpc3'] = s['BoxSize_cMpc']**3 # Box volume [cMpc^3]
s['Lya'] = UnitLum_in_cgs * f['Subhalo']['LyaLum'][:].astype(np.float64) # Lya = LyaCol + LyaRec + LyaStars
s['L1500'] = UnitLum_in_cgs * f['Subhalo']['1500LumStars'][:].astype(np.float64) # erg/s/Angstrom
with np.errstate(divide='ignore'): # Zero continuum gives an infinite magnitude.
s['M1500'] = -2.5 * np.log10(fnu_1500_fac * s['L1500']) - 48.6 # Continuum absolute magnitude
s['NdotAGN'] = UnitLum_in_cgs * f['Subhalo']['IonLumAGN'][:].astype(np.float64) / E_AGN # AGN ionizing photon rate [photons/s]
s['NdotStars'] = UnitLum_in_cgs * f['Subhalo']['LyaLumStars'][:].astype(np.float64) / (0.68 * E_Lya * (1. - s['EscapeFraction'])) # Star ionizing photon rate [photons/s]
return s
Convert an intrinsic line luminosity to cgs
Paths in this example are relative to Thesan-1/postprocessing/.
import h5py
with h5py.File("Lya/Lya_080.hdf5") as f:
lum = f["Subhalo/LyaLum"]
print("intrinsic luminosity [erg/s]:", f"{lum[42] * lum.attrs['to_cgs']:.5e}")
Output from THESAN-1
intrinsic luminosity [erg/s]: 2.89528e+39