modeling - Models and fitting#

gammapy.modeling Package#

Models and fitting.

Functions#

select_nested_models(datasets, parameters, ...)

Compute the test statistic (TS) between two nested hypotheses.

stat_profile_ul_scipy(value_scan, stat_scan)

Compute upper limit of a parameter from a likelihood profile.

Classes#

Covariance

Parameter covariance class.

Fit

Fit class.

FitResult

Fit result class.

OptimizeResult

Optimize result object.

CovarianceResult

Covariance result object.

Parameter

A model parameter.

Parameters

Parameters container.

PriorParameter

Parameter of a Prior.

PriorParameters

Container of parameter priors.

Sampler

Sampler class.

SamplerResult

SamplerResult class.

gammapy.modeling.models Package#

Built-in models in Gammapy.

Functions#

create_cosmic_ray_spectral_model([particle])

Cosmic a cosmic ray spectral model at Earth.

create_crab_spectral_model([reference])

Create a Crab nebula reference spectral model.

create_fermi_isotropic_diffuse_model(filename)

Read Fermi isotropic diffuse model.

integrate_spectrum(func, energy_min, energy_max)

Integrate one-dimensional function using the log-log trapezoidal rule.

read_hermes_cube(filename)

Read 3d templates produced with hermes.

scale_plot_flux(flux[, energy_power])

Scale flux to plot.

Classes#

BrokenPowerLawSpectralModel

Spectral broken power-law model.

CompoundSpectralModel

Arithmetic combination of two spectral models.

ConstantFluxSpatialModel

Spatially constant flux spatial model.

ConstantSpatialModel

Spatially constant (isotropic) spatial model.

ConstantSpectralModel

Constant model.

ConstantTemporalModel

Constant temporal model.

DatasetModels

Immutable models container.

DiskSpatialModel

Constant disk model.

EBLAbsorptionNormSpectralModel

Gamma-ray absorption models.

ExpCutoffPowerLaw3FGLSpectralModel

Spectral exponential cutoff power-law model used for 3FGL.

ExpCutoffPowerLawNormSpectralModel

Norm spectral exponential cutoff power-law model.

ExpCutoffPowerLawSpectralModel

Spectral exponential cutoff power-law model.

ExpDecayTemporalModel

Temporal model with an exponential decay.

FoVBackgroundModel

Field of view background model.

GaussianSpatialModel

Two-dimensional Gaussian model.

GaussianSpectralModel

Gaussian spectral model.

GaussianTemporalModel

A Gaussian temporal profile.

GeneralizedGaussianSpatialModel

Two-dimensional Generalized Gaussian model.

GeneralizedGaussianTemporalModel

A generalized Gaussian temporal profile.

LightCurveTemplateTemporalModel

Temporal light curve model.

LinearTemporalModel

Temporal model with a linear variation.

LogParabolaNormSpectralModel

Norm spectral log parabola model.

LogParabolaSpectralModel

Spectral log parabola model.

MeyerCrabSpectralModel

Meyer 2010 log polynomial Crab spectral model.

Model

Model class that contains only methods to create a model listed in the registries.

Models

Sky model collection.

ModelBase

Model base class.

NaimaSpectralModel

A wrapper for Naima models.

PiecewiseNormSpectralModel

Piecewise spectral correction with a free normalization at each fixed energy nodes.

PiecewiseNormSpatialModel

Piecewise spatial correction with a free normalization at each fixed nodes.

PointSpatialModel

Point Source.

PowerLaw2SpectralModel

Spectral power-law model with integral as amplitude parameter.

PowerLawNormSpectralModel

Spectral power-law model with normalized amplitude parameter.

PowerLawSpectralModel

Spectral power-law model.

PowerLawTemporalModel

Temporal model with a Power Law decay.

Prior

Prior abstract base class.

GaussianPrior

One-dimensional Gaussian Prior.

GeneralizedGaussianPrior

One-dimensional Generalized Gaussian Prior.

UniformPrior

Uniform Prior.

LogUniformPrior

LogUniform Prior.

ScaleSpectralModel

Wrapper to scale another spectral model by a norm factor.

Shell2SpatialModel

Shell model with outer radius and relative width parametrization.

ShellSpatialModel

Shell model.

SineTemporalModel

Temporal model with a sinusoidal modulation.

SkyModel

Sky model component.

SmoothBrokenPowerLawSpectralModel

Spectral smooth broken power-law model.

SpatialModel

Spatial model base class.

SpectralModel

Spectral model base class.

SuperExpCutoffPowerLaw3FGLSpectralModel

Spectral super exponential cutoff power-law model used for 3FGL.

SuperExpCutoffPowerLaw4FGLDR3SpectralModel

Spectral super exponential cutoff power-law model used for 4FGL-DR3.

SuperExpCutoffPowerLaw4FGLSpectralModel

Spectral super exponential cutoff power-law model used for 4FGL-DR1 (and DR2).

TemplatePhaseCurveTemporalModel

Temporal phase curve model.

TemplateSpatialModel

Spatial sky map template model.

TemplateSpectralModel

A model generated from a table of energy and value arrays.

TemplateNDSpatialModel

A model generated from a ND map where extra dimensions define the parameter space.

TemplateNDSpectralModel

A model generated from a ND map where extra dimensions define the parameter space.

TemplateNPredModel

Background model.

TemporalModel

Temporal model base class.

Variables#

MODEL_REGISTRY

Registry of model classes

SPATIAL_MODEL_REGISTRY

Registry of spatial model classes.

SPECTRAL_MODEL_REGISTRY

Registry of spectral model classes.

TEMPORAL_MODEL_REGISTRY

Registry of temporal models classes.

EBL_DATA_BUILTIN