Papers
Topics
Authors
Recent
2000 character limit reached

PySME and MARCS Atmospheres in Spectroscopy

Updated 3 December 2025
  • PySME with MARCS Atmospheres is a spectral synthesis framework that combines Python-based spectral analysis with extensive MARCS model grids to accurately determine stellar parameters and abundances under LTE and NLTE conditions.
  • It employs high-fidelity trilinear interpolation across a wide range of effective temperatures, gravities, and metallicities to construct reliable, hybrid atmospheric models for radiative transfer.
  • Integrating precomputed NLTE departure coefficients for key elements, the approach delivers precise abundance corrections and internally consistent stellar analyses even for large samples.

PySME with MARCS atmospheres refers to the use of the Python Spectroscopy Made Easy (PySME) radiative-transfer and spectral synthesis code in conjunction with MARCS model atmosphere grids for the analysis and determination of stellar parameters and abundances. This approach forms the backbone of rigorous spectroscopic investigations into late-type stellar atmospheres under both local thermodynamic equilibrium (LTE) and non-LTE (NLTE) conditions. PySME provides robust mechanisms for high-fidelity interpolation, line synthesis, and integration of NLTE departure coefficients, yielding precision abundance corrections across broad stellar parameter spaces.

1. PySME and MARCS Atmosphere Grid Architecture

PySME is an open-source Python implementation of the SME spectral synthesis framework, retaining the original radiative-transfer, ionization equilibrium, and opacity calculation engines in C++/FORTRAN for computational efficiency (Wehrhahn et al., 2022). Its core design enables seamless access to extensive pre-computed model grids, foremost among which are the MARCS model atmospheres.

MARCS atmospheres span a wide parameter space:

  • Effective temperature: 3000KTeff8000K3000\,\mathrm{K} \leq T_{\mathrm{eff}} \leq 8000\,\mathrm{K} (in steps as fine as 100K100\,\mathrm{K})
  • Surface gravity: 0.5logg+5.5-0.5 \leq \log g \leq +5.5 (step size 0.25\sim 0.25 dex)
  • Metallicity: 5.0[Fe/H]+1.0-5.0 \leq [\mathrm{Fe/H}] \leq +1.0 (step size $0.25$ dex)
  • Microturbulence standard value: ξ=1kms1\xi = 1\,\mathrm{km\,s^{-1}}

The atmospheric structure files contain depth-dependent stratifications of T(τ)T(\tau), electron pressure Pe(τ)P_e(\tau), and continuous opacity κc(τ)\kappa_c(\tau), available for both plane-parallel and spherical geometries. PySME locates and caches these grids, either fetching them automatically from the PySME data server or accepting local custom grids via the user's specification (Wehrhahn et al., 2022, Nunnari et al., 27 Nov 2025).

2. Interpolation and Atmospheric Structure Construction

To enable spectral synthesis at arbitrary stellar parameters, PySME performs trilinear interpolation of atmospheric quantities across the MARCS grid (Nunnari et al., 27 Nov 2025):

  • Eight adjacent models surrounding the target (Teff,logg,[Fe/H])(T_{\mathrm{eff}}, \log g, [\mathrm{Fe/H}]) are retrieved.
  • For any variable X(τ)X(\tau) (e.g., temperature, electron density), the interpolated value is given by

X(τ;T,g,M)=i=01j=01k=01wijkXijk(τ),X(\tau;T,g,M) = \sum_{i=0}^1 \sum_{j=0}^1 \sum_{k=0}^1 w_{ijk} X_{ijk}(\tau),

with weights defined by the fractional distance from each grid axis.

  • The result is a hybrid model atmosphere (either plane-parallel or spherical per user specification) which is passed to the radiative transfer solver (Wehrhahn et al., 2022).

PySME restricts interpolation strictly to the valid grid bounds, ensuring trust-region compliance and avoiding extrapolation artifacts.

3. NLTE Integration and Departure Coefficient Grids

For precise abundance analysis, PySME can incorporate precomputed NLTE departure coefficients—which map the actual atomic level populations ni(τ)n_i(\tau) to their LTE values via ni(τ)=bi(τ)niLTE(τ)n_i(\tau) = b_i(\tau) n_i^{\mathrm{LTE}}(\tau). These coefficients, calculated at each depth for extensive sets of transitions (e.g., Na I, Mg I/II, Al I/II), are provided by external grids (notably Balder and Amarsi et al. 2020), covering exactly the MARCS parameter space (Lind et al., 2022).

During synthesis, PySME interpolates bl(τ)b_l(\tau) and bu(τ)b_u(\tau) (lower and upper levels, respectively) for each species and depth point, dynamically adjusting line opacities and source functions:

  • Absorption: κνNLTE=κνLTEblblref\kappa_\nu^{\mathrm{NLTE}} = \kappa_\nu^{\mathrm{LTE}} \dfrac{b_l}{b_l^{\mathrm{ref}}}
  • Emissivity: jνNLTE=jνLTEbuburefj_\nu^{\mathrm{NLTE}} = j_\nu^{\mathrm{LTE}} \dfrac{b_u}{b_u^{\mathrm{ref}}}

In NLTE, the source function is modified to SνbublBν(T)S_\nu \approx \dfrac{b_u}{b_l} B_\nu(T), where Bν(T)B_\nu(T) is the Planck function (Nunnari et al., 27 Nov 2025, Lind et al., 2022).

4. Radiative Transfer and Spectral Synthesis Workflow

PySME solves the 1D, stationary radiative transfer equation

dIνds=κνIν+jν,\frac{dI_\nu}{ds} = -\kappa_\nu I_\nu + j_\nu,

using a Bezier-spline formal solver. The total opacity κν\kappa_\nu includes both continuum and line contributions, with the emergent intensity built up over many frequency points for each target line (Wehrhahn et al., 2022).

Line broadening is treated by summing thermal Doppler width, microturbulent velocity, and damping terms (Voigt profile), plus post-synthesis convolution for macroturbulence and instrumental broadening. Synthetic spectra are produced and numerically integrated to yield equivalent widths WλW_\lambda for each transition.

The abundance determination proceeds by fitting the observed spectrum Fobs(λ)F_{\mathrm{obs}}(\lambda) with the synthetic Fsyn(λ;p)F_{\mathrm{syn}}(\lambda;\mathbf{p}), minimizing

χ2=i,λ[Fobs(λi)Fsyn(λi;p)]2σi2,\chi^2 = \sum_{i,\lambda} \frac{\big[F_{\mathrm{obs}}(\lambda_i) - F_{\mathrm{syn}}(\lambda_i; \mathbf{p}) \big]^2}{\sigma_i^2},

where p\mathbf{p} represents the vector of free parameters, including Teff,logg,[Fe/H],ξ,vmac,T_{\mathrm{eff}}, \log g, [\mathrm{Fe/H}], \xi, v_{\mathrm{mac}}, and elemental abundances (Nunnari et al., 27 Nov 2025).

5. Abundance Corrections: LTE versus NLTE

Abundance corrections are central to PySME’s application on MARCS atmospheres. For any line:

  • LTE and NLTE curves-of-growth are computed using synthetic equivalent widths for a range of abundances A(X)=Aref+{1.0,,+1.0}A(X) = A_{\mathrm{ref}} + \{-1.0, \ldots, +1.0\} dex.
  • The LTE abundance ALTEA_{\mathrm{LTE}} and NLTE abundance ANLTEA_{\mathrm{NLTE}} are inferred by interpolating the appropriate curve at the observed equivalent width WobsW_{\mathrm{obs}}.
  • The abundance correction is ΔANLTE=ANLTEALTE\Delta A_{\mathrm{NLTE}} = A_{\mathrm{NLTE}} - A_{\mathrm{LTE}} (Lind et al., 2022). Multilinear interpolation in the correction grid (Teff,logg,[Fe/H],ξ)(T_{\mathrm{eff}}, \log g, [\mathrm{Fe/H}], \xi) allows direct lookup for arbitrary stellar parameters.

Key results for different species on the PySME + MARCS framework:

  • Na I: NLTE corrections negative, up to 0.5-0.5 dex in metal-poor stars; line-to-line scatter reduced.
  • Mg I: NLTE corrections small (±0.05 dex); persistent ionization imbalance vs. Mg II.
  • Al I: Corrections negative for strong lines at solar metallicity, positive ($0.3$ to $0.8$ dex) in metal-poor stars; improved Al I/Al II balance (Lind et al., 2022).

6. NLTE Cepheid Pipeline and Systematic Effects

Large-scale NLTE analyses, such as the published Galactic Cepheid paper (Nunnari et al., 27 Nov 2025), leverage PySME with MARCS and full species-specific NLTE grids:

  • Atmospheric parameters are fit with PySME using a two-step routine (first fitting Teff,logg,[Fe/H],vmacT_{\mathrm{eff}}, \log g, [\mathrm{Fe/H}], v_{\mathrm{mac}}, then elemental abundances with atmospheric parameters locked).
  • Systematic offsets are observed when switching between LTE and NLTE:
    • ΔTeff68±109\langle\Delta T_{\mathrm{eff}}\rangle \approx -68\pm109 K
    • Δlogg0.04±0.18\langle\Delta \log g\rangle \approx -0.04\pm0.18 dex
    • Δξ0.15±0.11\langle\Delta \xi\rangle \approx -0.15\pm0.11 km s1^{-1}
    • Δ[Fe/H]0.03±0.08\langle\Delta [\mathrm{Fe/H}]\rangle \approx -0.03\pm0.08 dex

NLTE approaches with PySME + MARCS achieve typical internal precisions of $50$–$100$ K in TeffT_{\mathrm{eff}}, $0.1$ dex in logg\log g, and $0.05$–$0.10$ dex in [X/H][\mathrm{X/H}] for elemental abundances (Nunnari et al., 27 Nov 2025).

7. Implementation Practices, Limitations, and Practical Recommendations

PySME’s MARCS interface supports both global data-driven (automatic fetching and caching) and local custom atmospheric grids, with parameter ranges enforced as trust-region bounds. Users should select appropriate microturbulent velocity to minimize grid discretization artifacts and ensure the geometry (spherical for logg3.5\log g \lesssim 3.5, plane-parallel otherwise) matches the stellar target (Wehrhahn et al., 2022).

NLTE corrections require compatible MARCS grids and matching departure coefficient tables for the elements under paper; PySME fetches or reads these as needed. Performance is efficient, with full NLTE synthesis incurring only $10$–$20$ % overhead relative to LTE computations, permitting analysis of large samples (e.g., hundreds of stars) in practical timeframes (Nunnari et al., 27 Nov 2025).

NLTE spectroscopic pipelines based on PySME and MARCS atmospheres yield more physical and internally consistent abundance patterns, especially critical in metal-poor regimes where traditional LTE analysis can misestimate true abundances by up to $0.5$ dex (Lind et al., 2022).


Key References:

  • "Non-LTE abundance corrections for late-type stars from 2000Å to 3μm: I. Na, Mg, and Al" (Lind et al., 2022)
  • "PySME -- Spectroscopy Made Easier" (Wehrhahn et al., 2022)
  • "Classical Cepheids in the Galactic thin disk. I. Abundance gradients through NLTE spectral analysis" (Nunnari et al., 27 Nov 2025)
  • "New ATLAS9 And MARCS Model Atmosphere Grids for the Apache Point Observatory Galactic Evolution Experiment (APOGEE)" (Mészáros et al., 2012)
Slide Deck Streamline Icon: https://streamlinehq.com

Whiteboard

Forward Email Streamline Icon: https://streamlinehq.com

Follow Topic

Get notified by email when new papers are published related to PySME with MARCS Atmospheres.