Gallery generated by Sphinx-Gallery
Examples gallery¶
120+ standalone scripts demonstrating tengri’s physics components, fitting workflows, and end-to-end use cases. Each card below links to a per-script page with the rendered figure, the full source, and a downloadable Jupyter notebook.
Browse by category. Cards are organised into sections — quickstart and workflows for end-to-end recipes, physics components for one-knob sweeps, inference for fitter behaviour, and use cases for paper-style figures.
How to run an example locally¶
Each script is a normal Python program:
python examples/quickstart/plot_first_fit.py
Most physics examples (dust curves, SFH shapes, AGN spectra) need only tengri’s core dependencies. Fitting examples additionally require an SSP grid — fetch one with:
import tengri
tengri.download_ssp() # default fsps_prsc_miles_chabrier; see list_known_ssps()
Advanced Topics¶
Hierarchical inference, gradient sensitivity, batch fitting, panchromatic SED with radio and X-ray components, and joint photometry + spectroscopy fitting.
AGN Models¶
AGN disc and torus SED templates.
X-ray Corona: Spectral Index vs Bolometric Luminosity 2D Sweep
QSOgen Emission Line Scaling: Rest-UV to Optical SED
SKIRTOR Clumpy Torus: Inclination and Optical Depth
Hensley & Draine 2023 Astrodust+PAH¶
Reproductions of every figure from the upstream
brandonshensley/Astrodust/notebooks/model_file_tutorial.ipynb notebook,
using tengri’s DustEmissionSEDComponent (template "astrodust")
and the canonical FITS file at doi:10.7910/DVN/3B6E6S.
Build the data with:
python scripts/build_astrodust_hdf5.py --output data/astrodust_templates.h5 --download
Reference: Hensley & Draine 2023, ApJ 948, 55 (arXiv:2208.12365).
DustEmissionSEDComponent — swap MBB / PAHspec / Astrodust
Astrodust+PAH polarized emission and polarization fraction
Dust Models¶
Attenuation laws, two-component dust, and IR emission.
Draine+2021 PAHspec: log U sweep at fixed (starlight, ion, size)
Draine+2021 PAHspec: starlight-spectrum sweep at fixed log U
IGM¶
Intergalactic medium absorption and Lyman-forest effects on observed SEDs.
Inference Methods¶
Comparing inference methods and convergence diagnostics.
Population VI scaling: time, memory, and convergence
Prior vs Posterior: Parameter Constraints from Inference
Metallicity¶
Stellar metallicity Z and α-element enhancement effects on the SED.
Multiwavelength¶
Panchromatic SED examples spanning X-ray to radio.
These short scripts complement the main tutorial notebooks — each produces a
single figure. For full narrative walkthroughs, see the notebooks/ spine.
Nebular Emission¶
Nebular emission backends comparison.
BPT Diagrams with Cue: 2D Grid in (log U, log Z_gas)
Nebular Emission: Dependence on Stellar Population Age
Photometry¶
Filter curves and photometric fitting.
Quick Start¶
Getting started with tengri — first fit and SED visualization.
Radio¶
Star-formation radio emission and the FIR–radio correlation.
Star Formation Histories¶
Parametric and stochastic star formation history models.
SFH with Double Bursts: Old and Recent Star Formation
SFH Quenching Scenarios: Constant, Exponential, Sharp, and Burst+Decay
The Wrong-SEDModel Trap: Parametric Bias in Derived Quantities
Spectroscopy¶
Spectroscopic fitting and spectral features.
Key Spectral Features as Age and Metallicity Probes
Stellar Population Synthesis¶
DSPS-based SSP grids: age, metallicity, and spectral properties.
plot_ssp_grid.py— SSP grid visualization (age, metallicity, spectrum)
Stellar Population Aging: SSP at Solar Metallicity
X-ray Emission¶
Multi-wavelength X-ray components: X-ray binaries (HMXB + LMXB), and AGN coronae.
plot_xray_sf.py— X-ray binary population from star formation rateplot_xray_agn.py— AGN X-ray spectrum and Compton reflection