Skip to content

EBL Models

The Extragalactic Background Light (EBL) is isotropic diffuse background radiation spanning from ultraviolet to far-infrared wavelengths. When very-high-energy (VHE) gamma rays travel through the universe, they can interact with EBL photons via pair production (γ + γ → e⁺ + e⁻), causing absorption that attenuates the gamma-ray flux.

For extragalactic sources at cosmological distances, EBL absorption can significantly affect the observed gamma-ray spectrum, particularly at higher energies and larger redshifts.

You should apply EBL absorption models when:

  • Simulating extragalactic sources (redshift z > 0)
  • Working at VHE energies
  • Analyzing sources at cosmological distances
  • Comparing models to observed spectra from extragalactic transients

EBL is often negligible for:

  • Galactic sources
  • Very nearby extragalactic sources (z < 0.01)
  • Low-energy observations, but depending on redshift

sensipy includes several EBL absorption models that differ in their assumptions about star formation history, galaxy evolution, and dust properties:

ModelReference
franceschiniFranceschini et al. (2008)
franceschini_2017Franceschini & Rodighiero (2017)
dominguezDomínguez et al. (2011)
saldana-lopez_2021Saldana-Lopez et al. (2021)

The EBL absorption is characterized by the optical depth τ(E, z), where the attenuated flux is:

Fobserved(E)=Fintrinsic(E)×exp(τ(E,z))F_{\text{observed}}(E) = F_{\text{intrinsic}}(E) \times \exp(-\tau(E, z))

Higher optical depth → stronger absorption → lower observed flux.

If redshift is included in the spectral model metadata, it will be used automatically:

from sensipy.source import Source
from sensipy.util import get_data_path
import astropy.units as u
# Get path to package mock data
mock_data_path = get_data_path("mock_data/GRB_42_mock.csv")
# Load source with EBL absorption
source = Source(
filepath=str(mock_data_path),
min_energy=20 * u.GeV,
max_energy=1 * u.TeV,
ebl="franceschini" # Apply Franceschini 2008 model
)

Setting the redshiftft and updating or overriding the EBL Model

Section titled “Setting the redshiftft and updating or overriding the EBL Model”

You can change the EBL model after creating a Source object:

from sensipy.source import Source
from sensipy.util import get_data_path
# Get path to package mock data
mock_data_path = get_data_path("mock_data/GRB_42_mock.csv")
# Initially load without EBL
source = Source(filepath=str(mock_data_path))
# Add EBL absorption later
source.set_ebl_model(ebl="franceschini", z=0.3)
# Switch to a different EBL model and redshift
source.set_ebl_model(ebl="dominguez", z=0.5)
# Remove EBL absorption
source.set_ebl_model(ebl=None)

EBL model data files from gammapy are included in the sensipy package.

These files contain tabulated optical depths τ(E, z) as functions of energy and redshift. The files are automatically located when you use EBL models - no manual path configuration is needed.

If you need to access the EBL data files directly (e.g., for inspection), you can use:

from sensipy.util import get_data_path
# Get path to EBL data directory
ebl_dir = get_data_path("ebl")
print(f"EBL data location: {ebl_dir}")

sensipy will supports EBL models in the gammapy format: see here.

  1. Set the GAMMAPY_DATA environment variable

    Terminal window
    export GAMMAPY_DATA=/path/to/gammapy-data
  2. Download EBL models using Gammapy

    Terminal window
    gammapy download datasets