Skip to content

The Atmosphere Emulator

The kurucz-a1 emulator is a neural-network surrogate for ATLAS12 atmosphere generation. It predicts the full atmospheric structure — 80 depth points of temperature, pressure, density, and opacity — from just four stellar parameters. The point of the warm start is not just speed: it lands inside ATLAS's convergence basin so the iteration descends cleanly to the tolerance. A generic grey-atmosphere cold start, by contrast, can stall in a local minimum and fail to reach the threshold within the iteration budget — producing an atmosphere that is not converged even after 30 iterations.

What the Emulator Does and Why

Warm-start vs cold-start ATLAS convergence

Why the warm start matters. Cold-starting from a generic grey atmosphere (top curve), the iteration drops for a few steps and then stalls above the convergence threshold — bouncing in a local minimum without ever crossing the dashed line. Warm-starting from the kurucz-a1 emulator's prediction (bottom curve) lands inside the convergence basin, and ATLAS descends cleanly through the threshold in ~10–15 iterations.

In traditional ATLAS12, the first iteration starts from a grey-atmosphere approximation or a previously converged model. For arbitrary stellar parameters, this guess can be poor, requiring many iterations to converge. The emulator replaces this initial guess with a data-driven prediction trained on 104,269 converged ATLAS12 models. The result is:

  • Reliable convergence: warm-starting lands inside ATLAS's convergence basin, so atlas_py reaches the tolerance in roughly 10–15 iterations. Cold starts can stall in a local minimum and never converge within the iteration budget.
  • Better stability: the warm-start is physically plausible even at the edges of the training grid.
  • No Fortran dependency: the emulator is a pure PyTorch module; no compiled Fortran code is needed.

Emulator vs. ATLAS12

The emulator predicts the converged atmospheric structure as if ATLAS12 had been run with the same scalar parameters. It captures the non-linear mapping from (\(T_{\rm eff}\), \(\log g\), [M/H], [α/M]) to the 80×6 output quantities, including the complicated feedback between temperature, opacity, and convection.

Architecture

The network is a PyTorch MLP with separate encoders for global stellar parameters and per-depth optical depth:

stellar params Teff · logg · [M/H] · [α/M] τ grid 80 optical-depth points stellar encoder 4 → 512 τ-position encoder 1 → 512 concatenate 1024-dim predictor MLP 1024 → 2048 → 2048 → 6 80 × 6 outputs RHOX,T,P,XNE,ABROSS,ACCRAD

Key details

Component Specification
Stellar encoder 4 → 512 (LayerNorm + GELU) × 2
Tau encoder 1 → 256 → 512 (GELU)
Predictor 1024 → 2048 → 2048 → 6 (GELU, 1% dropout)
Output 80 depth points × 6 quantities

The model is trained with min-max normalized inputs and log-scaled outputs (where physical quantities span many orders of magnitude). See emulator/normalization.py for the exact transform.

Training Range

The emulator was trained on a grid of 104,269 ATLAS12 models with the following bounds:

Parameter Minimum Maximum
\(T_{\rm eff}\) 2500 K 50,000 K
\(\log g\) −1.0 5.5
[M/H] −4.0 +1.5
[α/M] −0.2 +0.62

Do not extrapolate

Using the emulator outside this range is unsupported. The warm-start may be physically implausible, causing atlas_py to converge slowly or diverge. If your target lies outside these bounds, use Existing Atmosphere with an externally computed atmosphere.

Using it from Python

Loading the emulator

from emulator import load_emulator

emulator = load_emulator()

This loads the bundled weights (emulator/a_one_weights.pt) and normalization parameters (emulator/norm_params.pt) onto CPU by default.

Predicting atmospheric structure

import numpy as np

# Predict the 6 physical quantities at 80 depth points
pred = emulator.predict(
    teff=5770,
    logg=4.44,
    feh=0.0,
    afe=0.0,
)

print(pred["T"])       # shape (80,) — temperature in K
print(pred["P"])       # shape (80,) — pressure in dyn cm⁻²
print(pred["RHOX"])    # shape (80,) — mass column density

Generating a 9-column .atm array

For direct use in pykurucz.py internals, you can generate the full 9-column atmosphere array:

data = emulator.predict_atmosphere_data(
    teff=5770, logg=4.44, feh=0.0, afe=0.0, vturb=2.0
)
print(data.shape)  # (80, 9)

The columns are: RHOX, T, P, XNE, ABROSS, ACCRAD, VTURB, FLXCNV, VCONV.

Integration with atlas_py

In the standard Stellar Parameters pipeline, pykurucz.py calls emulator_warmstart_atm(...) to write the warm-start .atm file, then immediately invokes atlas_py.cli with MOLECULES ON. The emulator's prediction is treated exactly like a READ DECK6 input in Fortran ATLAS12.

Fortran parity

The emulator plays the same role as READ DECK6 in the Fortran pipeline. Validation runs confirm that starting from the emulator prediction and iterating with atlas_py yields atmospheres that are numerically consistent with Fortran ATLAS12 references.

Limitations

  • 4-parameter space: The emulator is trained on scalar [M/H] and [α/M]. Highly non-solar abundance patterns (e.g., extreme r-process or neutron-capture enhancements) are not represented in the training data. Use Existing Atmosphere for such cases.
  • 1D plane-parallel geometry: Like ATLAS12 itself, the emulator assumes a plane-parallel atmosphere. Extended giants with significant spherical extension may need 3D or spherical models.
  • LTE only: The emulator does not account for NLTE effects. If you need NLTE atmosphere structures, use an external code.

Next Steps

  • Read the Stellar Parameters guide for the full end-to-end pipeline.
  • Explore the Architecture page for implementation details of the PyTorch model.
  • Check the CLI Reference for flags that control convergence and output.