This repository accompanies the paper:
@misc{duque-castano2026gdaespec,
title = {Efficient reduction of stellar contamination and noise in planetary transmission spectra using neural networks},
author = {David S. Duque-Casta\~no and Lauren Flor-Torres and Jorge I. Zuluaga},
year = {2026},
eprint = {2602.10330},
archivePrefix = {arXiv},
primaryClass = {astro-ph.EP},
doi = {10.48550/arXiv.2602.10330},
url = {https://arxiv.org/abs/2602.10330}
}The code tests a General Denoising AutoEncoder (G-DAE) for transmission spectra affected by stellar contamination and observational noise. The project is organized around the two experiments discussed in the paper:
training-and-experiments/Earth_like_Atmosphere/: TRAPPIST-1e analogue, including G-DAE training, uncertainty-aware reconstruction, SPHINX/PHOENIX stellar contamination checks, and POSEIDON retrieval tests.training-and-experiments/Sub_Neptune_Atmosphere/: K2-18b analogue, including spectra generation, stellar contamination, autoencoder training, and evaluation.
The parameters of the trained models, as well as an example of how to use them, are available in model-parameters/.
| Path | Purpose |
|---|---|
| training-and-experiments/Earth_like_Atmosphere/ | Main Earth-like/TRAPPIST-1e experiment. |
| training-and-experiments/Earth_like_Atmosphere/Retrieval Tests/ | POSEIDON five-observation retrieval campaign. |
| training-and-experiments/Earth_like_Atmosphere/stellar_contamination/ | PHOENIX and SPHINX stellar-contamination curves used by the Earth-like workflow. |
| training-and-experiments/Earth_like_Atmosphere/spec_data/ | Earth-like spectral datasets derived from the referenced MultiREx example. |
| training-and-experiments/Sub_Neptune_Atmosphere/ | K2-18b/Sub-Neptune experiment. |
| model-parameters/ | Minimal notebooks and model files for applying trained G-DAE models. |
Recommended reading order:
- Start with this README.
- Open model-parameters/G-DAE-Example.ipynb for the shortest application-oriented workflow.
- Open training-and-experiments/Earth_like_Atmosphere/README.md for the TRAPPIST-1e case.
- Open training-and-experiments/Earth_like_Atmosphere/Retrieval Tests/README.md for the retrieval validation workflow.
- Open training-and-experiments/Sub_Neptune_Atmosphere/README.md for the K2-18b case.
Use training-and-experiments/Earth_like_Atmosphere/README.md for the local workflow. The shortest reading order is:
01_G-DAE.ipynb: data assembly and G-DAE training.02_G-DAE_Analysis.ipynb: reconstruction, metric, and uncertainty analysis.Retrieval Tests/README.md: POSEIDON retrieval campaign comparing G-DAE preprocessing with explicit stellar-contamination retrievals.
Use training-and-experiments/Sub_Neptune_Atmosphere/README.md. The notebooks are numbered in execution order:
01_Spectra_Generation.ipynb02_Stellar_Contamination.ipynb03_AE_Training.ipynb04_G-DAE_Evaluation.ipynb
The notebooks and scripts are scientific workflows rather than a packaged Python library. Install the shared dependencies with:
pip install -r requirements.txtPython 3.10 or newer is required. Python 3.12 is recommended for the PandExo
notebooks. The retrieval scripts must run inside an environment where
POSEIDON, MultiNest, MPI, and
mpirun are already working.
Large opacity tables and some external model grids may need to be installed or downloaded outside the repository, depending on the experiment. The README files inside each data folder describe the expected sources.
The repository includes source data, notebooks, trained models, and the
Earth-like retrieval record used in the paper workflow. Very large training
datasets, opacity tables, CIA data, and local PHOENIX grids are intentionally
ignored by .gitignore and must be restored when rerunning the corresponding
generation steps.
The repository contents fall into three categories:
- Inputs:
spec_data/,stellar_contamination/,waves.txt, opacity/CIA files, and PandExo input spectra. - Executable workflow: numbered notebooks and Python/MPI scripts.
- Generated products: trained
.kerasmodels, selected plots, and the preservedPOSEIDON_output/, logs, samples, state files, and CSV summaries from the Earth-like retrieval experiment. Large local.npzdatasets remain ignored.
This repository is released under the MIT License.
Copyright (C) 2026-present Duque-Castaño, Zuluaga, and Flor-Torres.
