Пример #1
0
     model=BrokenPowerLawSpectralModel(
         index1=1.5 * u.Unit(""),
         index2=2.5 * u.Unit(""),
         amplitude=4 / u.cm ** 2 / u.s / u.TeV,
         ebreak=0.5 * u.TeV,
     ),
     val_at_2TeV=u.Quantity(0.125, "cm-2 s-1 TeV-1"),
     integral_1_10TeV=u.Quantity(0.45649740094103286, "cm-2 s-1"),
     eflux_1_10TeV=u.Quantity(0.9669999668731384, "TeV cm-2 s-1"),
 ),
 dict(
     name="sbpl",
     model=SmoothBrokenPowerLawSpectralModel(
         index1=1.5 * u.Unit(""),
         index2=2.5 * u.Unit(""),
         amplitude=4 / u.cm ** 2 / u.s / u.TeV,
         ebreak=0.5 * u.TeV,
         reference=1 * u.TeV,
         beta=1,
     ),
     val_at_2TeV=u.Quantity(0.28284271247461906, "cm-2 s-1 TeV-1"),
     integral_1_10TeV=u.Quantity(0.9956923907948155, "cm-2 s-1"),
     eflux_1_10TeV=u.Quantity(2.2372256145972207, "TeV cm-2 s-1"),
 ),
 dict(
     name="sbpl-hard",
     model=SmoothBrokenPowerLawSpectralModel(
         index1=2.5 * u.Unit(""),
         index2=1.5 * u.Unit(""),
         amplitude=4 / u.cm ** 2 / u.s / u.TeV,
         ebreak=0.5 * u.TeV,
         reference=1 * u.TeV,
Пример #2
0
"""

# %%
# Example plot
# ------------
# Here is an example plot of the model:

from astropy import units as u
import matplotlib.pyplot as plt
from gammapy.modeling.models import Models, SkyModel, SmoothBrokenPowerLawSpectralModel

energy_bounds = [0.1, 100] * u.TeV
model = SmoothBrokenPowerLawSpectralModel(
    index1=1.5,
    index2=2.5,
    amplitude="1e-12 TeV-1 cm-2 s-1",
    ebreak="1 TeV",
    reference="1 TeV",
    beta=1,
)
model.plot(energy_bounds)
plt.grid(which="both")

# %%
# YAML representation
# -------------------
# Here is an example YAML file using the model:

model = SkyModel(spectral_model=model, name="smooth-broken-power-law-model")
models = Models([model])

print(models.to_yaml())