PySME and MARCS Atmospheres in Spectroscopy
- 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: (in steps as fine as )
- Surface gravity: (step size dex)
- Metallicity: (step size $0.25$ dex)
- Microturbulence standard value:
The atmospheric structure files contain depth-dependent stratifications of , electron pressure , and continuous opacity , 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 are retrieved.
- For any variable (e.g., temperature, electron density), the interpolated value is given by
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 to their LTE values via . 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 and (lower and upper levels, respectively) for each species and depth point, dynamically adjusting line opacities and source functions:
- Absorption:
- Emissivity:
In NLTE, the source function is modified to , where 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
using a Bezier-spline formal solver. The total opacity 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 for each transition.
The abundance determination proceeds by fitting the observed spectrum with the synthetic , minimizing
where represents the vector of free parameters, including 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 dex.
- The LTE abundance and NLTE abundance are inferred by interpolating the appropriate curve at the observed equivalent width .
- The abundance correction is (Lind et al., 2022). Multilinear interpolation in the correction grid allows direct lookup for arbitrary stellar parameters.
Key results for different species on the PySME + MARCS framework:
- Na I: NLTE corrections negative, up to 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 , then elemental abundances with atmospheric parameters locked).
- Systematic offsets are observed when switching between LTE and NLTE:
- K
- dex
- km s
- dex
NLTE approaches with PySME + MARCS achieve typical internal precisions of $50$–$100$ K in , $0.1$ dex in , and $0.05$–$0.10$ dex in 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 , 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)