aug analyzes ASDEX Upgrade (AUG) discharges with LBO injections. It reads the
traces (-imp, -rest) and profiles (-lboN), detects and characterizes each
injection, fits the impurity confinement time
the figures.
Current version: 0.5.0 (see the changelog).
| Page | Contents |
|---|---|
| Installation and quick start | this page |
Data and reading (aug.io) |
file format, folder tree, REGIME_MAP, QC |
Shot and GroupShots |
the main objects and their methods |
Injection pipeline (aug.analysis, aug.models) |
the method step by step, table columns, flags |
Figures (aug.plot) |
plotting functions |
Comparing species (aug.analysis.compare) |
shape metrics, rise, and normalized τ |
Plasma parameters (aug.analysis.plasma) |
τ_E, H98, I_RMP, edge gradients per injection |
W44+ with Aurora (aug.analysis.atomic) |
W ionization balance, the W44 line window, toy LBO |
LBO simulation with Aurora (aug.analysis.aurora_lbo) |
full Aurora transport and fitting D, v to the measured curves |
| Changelog | changes by version |
Installation
The pyproject.toml is in asdex-upgrade/, not at the repo root. The project
uses uv:
cd /ruta/a/tokamak-uc-repo/asdex-upgrade
uv sync # crea .venv, instala aug -e y todo lo demás
Quick start
from aug import GroupShots
group = GroupShots.from_directory(DATA_PATH, name="AUG") # escanea carpetas + QC de archivos
group.summary() # un renglón por shot
group.flagged # shots con archivos malos (ej. #38884)
shot = group[39428]
t, I_W = shot.emission() # emisión física de la línea de núcleo (W44_133 con signo corregido)
shot.find_injections() # inyecciones de -lboN.txt + detectadas en la señal
res = shot.analyze_injections() # pipeline completo -> InjectionSet
res.table[["inj", "t_onset", "t_onset_to_peak_ms",
"tau_1exp_ms", "tau_slow_2exp_ms", "recommended", "tau_imp_ms", "flags"]]
# todo el dataset (Fe, Ni, Mo, W)
res_all = group.analyze_injections()
res_all.table.to_csv("tau_por_inyeccion.csv", index=False)
# figuras
from aug.plot.injections import plot_decay_fits, plot_aligned_injections
plot_decay_fits(res_all, res_all.table.query("species == 'Fe'"))
The notebook asdex-upgrade/notebooks/09W4/09W4.ipynb has a complete,
commented example.
Layout
src/aug/
├── __init__.py Shot, GroupShots, Spectrum
├── shot.py Shot: one discharge
├── groups.py GroupShots: a collection of Shot
├── spectrum.py Spectrum (EUV; format still pending)
├── io/
│ ├── traces.py read_imp, read_rest, build_catalog, REGIME_MAP, DEFAULT_SIGNALS
│ ├── profiles.py read_lbo, read_lbo_profiles
│ └── qc.py check_files (Trace= header and MD5 duplicates)
├── analysis/
│ ├── injections.py find_injections, characterize_injection, analyze_shot, ...
│ ├── compare.py comparison_table, decay_shape, multiline_timing, ...
│ ├── plasma.py parameter_table, profile_gradients, h98_scaling, ...
│ ├── atomic.py load_w_atom_data, w44_profile_metrics, toy_lbo_signal, ...
│ └── aurora_lbo.py make_sim, run_lbo, fit_injection (full Aurora)
├── models/
│ └── exponential.py fit_single_exp, fit_double_exp, select_decay_model, ...
└── plot/
├── shot.py single-shot figures (legacy v0.1)
├── group.py group figures (legacy v0.1)
└── injections.py injection pipeline figures (v0.2)