xstar-tools: AI-Assisted Modernization of the XSTAR Photoionization Code
2026-11-02 –, Seminar Room 2

Modernizing established astronomical software requires preserving scientific behavior while improving portability, maintainability, and integration with modern workflows. We present xstar-tools, an open-source modernization of the FORTRAN XSTAR photoionization code through an AI-assisted software development. The project progressed from a pure Python implementation to an independent C++ engine with Python interfaces and native tools for generating XSPEC spectral tables.

Large language models assisted our code development, memory and runtime optimization, testing, and documentation under human supervision. Scientific qualification used FORTRAN XSTAR as the authoritative reference and examined atomic level populations, heating and cooling rates, convergence trajectories, radiative transfer, spectra, and output products. Validation combined numerical acceptance criteria with exact comparisons against accepted baselines. Qualification diagnostics exposed subtle differences in floating-point accumulation order, atomic level indexing, and the association of physical quantities with output records. Revised implementations were accepted only after passing the relevant qualification checks, with optimization changes additionally evaluated for memory use and runtime.

The xstar-tools suite also incorporates serial and local multiprocess execution, optional MPI execution for high-performance computing, and XSPEC table generation. Native packages are qualified on Linux, macOS, and Windows, with distribution through PyPI and conda-forge on supported platforms. These capabilities facilitate deployment and integration into other scientific applications while retaining the established XSTAR physical framework.

We discuss practical lessons from AI-assisted modernization, emphasizing the role of reference implementations, human evaluation, traceable diagnostics, and reproducible acceptance criteria in producing scientifically trustworthy software. Future development of xstar-tools will extend the framework toward post-processing hydrodynamic simulations.


Code repository: https://github.com/xstar-tools/xstar-tools

See also:

Ash Danehkar is a Scientist in Astronomy at the Science and Technology Institute (STI) of the Universities Space Research Association (USRA). He previously held research positions at Eureka Scientific (2022–2025), the University of Michigan (2019–2021), and the Harvard–Smithsonian Center for Astrophysics (2015–2018). He received his Ph.D. in Physics and Astronomy from Macquarie University, Australia (2014), an M.Sc. in Plasma Physics from Queen's University Belfast, UK (2009), and an M.Sc. in Computational Engineering from the University of Rostock, Germany (2007). His research interests include observational astronomy, computational astrophysics, active galactic nuclei, and ionized nebulae, in addition to AI-assisted code development, deep learning, and AI agents for astronomy in NASA's Office of Data Science and Informatics (ODSI) in the Marshall Space Flight Center (MSFC) Astrophysics Branch (ST12).

This speaker also appears in: