Add gas and stellar Lyα emission
Use the TNG50 demo galaxy from the point-source example to calculate three Lyα components: diffuse-gas recombination, collisional excitation, and stellar emission from unresolved H II regions. Compare their intrinsic and escaping light before adding dust.
Emission model
The relative contributions depend on gas temperature and ionization state, recent star formation, and the aperture used to measure the escaping light.
| Component | Physical process | THOR recipe |
|---|---|---|
| Gas recombination | Electrons recombine with H II; radiative cascades produce Lyα | Lya_recB_emissivity |
| Collisional excitation | Electrons excite neutral hydrogen; radiative decay produces Lyα | Lya_collexc_emissivity |
| Stellar emission | Stellar ionizing photons produce Lyα through recombinations in unresolved H II regions | Lya_StellarParticle_Luminosity |
Diffuse gas
For the diffuse-emission prescriptions, see Byrohl & Nelson (2023) and references therein. THOR evaluates the volume emissivities in \(\mathrm{erg\,s^{-1}\,cm^{-3}}\):
Here \(E_\alpha\) is the Lyα photon energy, \(\alpha_B\) the case-B recombination
coefficient, \(f_{\alpha,B}\) the fraction of recombinations producing Lyα, and
\(q_\alpha\) the effective collisional-excitation coefficient. Cell luminosities
are emissivity times physical cell volume. Collisional emission needs both
electrons and neutral hydrogen and is strongly temperature dependent.
Case B assumes ionizing photons from recombinations to the ground state are
absorbed locally. We use the snapshot's temperature, neutral fraction, and
electron abundance and keep them fixed during Lyα transport.
Because TNG's star-forming gas follows an effective equation of state based on
Springel & Hernquist (2003), we restrict
diffuse emission to gas cells with StarFormationRate == 0. Young stellar
sources account for unresolved H II regions, while all gas remains in the
scattering medium.
Stellar emission
When individual H II regions are unresolved, we estimate stellar Lyα emission from young stars' expected ionizing output, assuming local absorption and conversion to Lyα through recombinations.
We estimate recent star formation from the initial masses of stellar particles younger than 10 Myr:
and zero for older stars. We set lya_sfr_window_yr: 1.0e7 and apply no extra
attenuation (lya_sfr_frac: 1.0).
For age- and metallicity-dependent ionizing outputs, use BPASS_Lya_Luminosity
with a prepared BPASS table instead.
It converts ionizing photon rate \(Q_{\rm H}\) to
\(L_\alpha=f_\alpha E_\alpha Q_{\rm H}\), with default bpass_f_lya_per_ion: 0.68.
Prepare and run
Use the THOR and plotting setup and the
demo galaxy cutout. This example
needs no additional reference tables or stellar preprocessing.
Work in the directory containing tng50-halo625-gas-stars-v2.hdf5 and save the
downloads below there.
Download all three complete configurations into this directory:
| Download | Output directory |
|---|---|
| lya-recombination.yaml | output-lya-recombination |
| lya-collisional.yaml | output-lya-collisional |
| lya-stellar.yaml | output-lya-stellar |
OMP_NUM_THREADS=8 thor lya-recombination.yaml
OMP_NUM_THREADS=8 thor lya-collisional.yaml
OMP_NUM_THREADS=8 thor lya-stellar.yaml
For a GPU run with the generic build, change device: cpu to device: gpu
in each configuration and launch with ACPP_VISIBILITY_MASK=cuda.
Rerunning a configuration overwrites its previous outputs. These runs can take longer than the point-source example because a few photons undergo many scatterings before escaping.
We include sources contributing at least 99% of each component's luminosity and normalize photon packet weights to their combined luminosity. See the emission model reference for configuration details.
Gas spectra use local thermal broadening. The stellar emission spectrum is a Gaussian with σ = 30 km/s, representing an assumed unresolved line width. All sources launch in the local gas frame, including those at stellar positions; the galaxy's bulk motion is retained. The runs use Smith15 acceleration, no dust, and no Hubble flow. With the gas state fixed, transfer is linear in source luminosity, so the three results can be summed.
Compare the components
Download plot_lya_components.py and thorplot.py into the same directory:
For the supplied settings, the retained sources emit:
| Component | Intrinsic luminosity [\(\mathrm{erg\,s^{-1}}\)] |
|---|---|
| Gas recombination | \(6.75 \times 10^{40}\) |
| Collisional excitation | \(2.37 \times 10^{41}\) |
| Stellar emission | \(1.19 \times 10^{42}\) |
The upper row projects the intrinsic emission; the lower row shows the escaping
light toward +z estimated by peeling. All panels share a surface-brightness
scale in \(\mathrm{erg\,s^{-1}\,cm^{-2}\,arcsec^{-2}}\), at observer_redshift: 0.
This is the undimmed conversion for the local snapshot, without an instrumental response.
The map covers the central region; transport and source selection use the
larger cutout.
The stellar sources are compact, while the intrinsic gas emission already extends across the disk. Resonant scattering spreads the stellar light into a broader halo.
The spectra show the apparent luminosity per velocity interval viewed along +z, within 10 and 30 kpc.
The script also prints emitted and escaped luminosities and the all-direction photon escape fraction. The latter uses summed photon-rate weights and should be close to one in this dust-free setup. See packet weights for photon-rate weighting and luminosity conversion. Spectral bins cover ±10 Å; the figure displays the central ±1,000 km/s.
To improve sampling, increase nphotons_per_unit_lum in each source block;
these recipes use \(10^{42}\) erg/s as their native luminosity unit. To check
the faint-source selection, set lum_threshold_fraction: -1 and compare the
result. See source settings
for packet-allocation limits.
Continue with dust absorption and scattering using these same three components.