Skip to content

Examples

The hermes-examples repository contains maintained Python programs rather than fragments copied between notebooks. Every script has --help, safe low-resolution defaults, explicit output paths, and overwrite protection.

Install the example tools

Activate the environment containing pyhermes, then:

git clone https://github.com/HERMES-SkyMaps/hermes-examples.git
cd hermes-examples
python -m pip install -e ".[test]"

Confirm the installation and data before a long calculation:

python python/10_scientific_smoke_test.py

Catalogue

Script Product Main ingredients
01_pi0_gamma_maps.py gamma-ray maps DRAGON2 p/He, H I/H2 rings, Kamae06 gamma production
02_pi0_ring_maps.py one gas-ring contribution same, with one enabled ring
03_pi0_neutrino_maps.py neutrino maps DRAGON2 p/He, gas rings, Kamae06 neutrino production
04_bremsstrahlung_maps.py bremsstrahlung maps DRAGON2 e-/e+, gas rings, Tsai74
05_inverse_compton_maps.py inverse-Compton maps DRAGON2 e-/e+, CMB/ISRF, Klein-Nishina
06_dark_matter_map.py dark-matter gamma map PPPC4DMID, generalized NFW profile
07_pi0_gamma_spectrum.py full-sky spectrum DRAGON2 p/He, gas rings, AAfrag2021
08_pi0_masked_spectrum.py region-averaged spectrum rectangular Galactic mask
09_ingredient_plots.py four-panel diagnostic CRs, photon fields, cross sections, ring geometry
10_scientific_smoke_test.py fast regression report pinned data and model values

Useful commands

# Inspect controls without starting a calculation.
python python/01_pi0_gamma_maps.py --help

# Quick atomic-gas map without plotting.
python python/01_pi0_gamma_maps.py --gas hi --nside 8 --no-plot

# Isolate molecular-gas ring 3.
python python/02_pi0_ring_maps.py --gas h2 --ring 3 --nside 16

# Production candidate: choose resolution and cache deliberately.
python python/01_pi0_gamma_maps.py \
  --nside 128 \
  --energy-gev 10 \
  --cache-bins 40 40 16

Outputs default to:

products/
├── fits/       HEALPix FITS products
└── plots/      PNG or PDF visualizations

Generated products are excluded from version control. Publish the command, versions, configuration, and selected results through an analysis-specific archive instead of committing bulky maps to the examples repository.