modeling - Models and fitting#

gammapy.modeling Package#

Models and fitting.

Functions#

select_nested_models(datasets, parameters, ...)

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

stat_profile_ul_scipy(value_scan, stat_scan)

Compute upper limit of a parameter from a likelihood profile.

Classes#

Covariance(parameters[, data])

Parameter covariance class.

Fit([backend, optimize_opts, ...])

Fit class.

FitResult([optimize_result, covariance_result])

Fit result class.

OptimizeResult(models, nfev, total_stat, trace)

Optimize result object.

CovarianceResult([matrix])

Covariance result object.

Parameter(name, value[, unit, scale, min, ...])

A model parameter.

Parameters([parameters])

Parameters container.

PriorParameter(name, value[, unit, scale, ...])

PriorParameters([parameters])

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(...)

Read Fermi isotropic diffuse model.

integrate_spectrum(func, energy_min, energy_max)

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

scale_plot_flux(flux[, energy_power])

Scale flux to plot.

read_hermes_cube(filename)

Read 3d templates produced with hermes.

Classes#

BrokenPowerLawSpectralModel(**kwargs)

Spectral broken power-law model.

CompoundSpectralModel(model1, model2, operator)

Arithmetic combination of two spectral models.

ConstantFluxSpatialModel(**kwargs)

Spatially constant flux spatial model.

ConstantSpatialModel(**kwargs)

Spatially constant (isotropic) spatial model.

ConstantSpectralModel(**kwargs)

Constant model.

ConstantTemporalModel(**kwargs)

Constant temporal model.

DatasetModels([models, covariance_data])

Immutable models container.

DiskSpatialModel(**kwargs)

Constant disk model.

EBLAbsorptionNormSpectralModel(energy, ...)

Gamma-ray absorption models.

ExpCutoffPowerLaw3FGLSpectralModel(**kwargs)

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

ExpCutoffPowerLawNormSpectralModel([index, ...])

Norm spectral exponential cutoff power-law model.

ExpCutoffPowerLawSpectralModel(**kwargs)

Spectral exponential cutoff power-law model.

ExpDecayTemporalModel(**kwargs)

Temporal model with an exponential decay.

FoVBackgroundModel(dataset_name[, ...])

Field of view background model.

GaussianSpatialModel(**kwargs)

Two-dimensional Gaussian model.

GaussianSpectralModel(**kwargs)

Gaussian spectral model.

GaussianTemporalModel(**kwargs)

A Gaussian temporal profile.

GeneralizedGaussianSpatialModel(**kwargs)

Two-dimensional Generalized Gaussian model.

GeneralizedGaussianTemporalModel(**kwargs)

A generalized Gaussian temporal profile.

LightCurveTemplateTemporalModel(map[, ...])

Temporal light curve model.

LinearTemporalModel(**kwargs)

Temporal model with a linear variation.

LogParabolaNormSpectralModel([norm, ...])

Norm spectral log parabola model.

LogParabolaSpectralModel(**kwargs)

Spectral log parabola model.

MeyerCrabSpectralModel(**kwargs)

Meyer 2010 log polynomial Crab spectral model.

Model()

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

Models([models, covariance_data])

Sky model collection.

ModelBase(**kwargs)

Model base class.

NaimaSpectralModel(radiative_model[, ...])

A wrapper for Naima models.

PiecewiseNormSpectralModel(energy[, norms, ...])

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

PiecewiseNormSpatialModel(coords[, norms, ...])

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

PointSpatialModel(**kwargs)

Point Source.

PowerLaw2SpectralModel(**kwargs)

Spectral power-law model with integral as amplitude parameter.

PowerLawNormSpectralModel(**kwargs)

Spectral power-law model with normalized amplitude parameter.

PowerLawSpectralModel(**kwargs)

Spectral power-law model.

PowerLawTemporalModel(**kwargs)

Temporal model with a Power Law decay.

Prior(**kwargs)

Prior base class.

GaussianPrior(**kwargs)

One-dimensional Gaussian Prior.

UniformPrior(**kwargs)

Uniform Prior.

ScaleSpectralModel(model[, norm])

Wrapper to scale another spectral model by a norm factor.

Shell2SpatialModel(**kwargs)

Shell model with outer radius and relative width parametrization.

ShellSpatialModel(**kwargs)

Shell model.

SineTemporalModel(**kwargs)

Temporal model with a sinusoidal modulation.

SkyModel(spectral_model[, spatial_model, ...])

Sky model component.

SmoothBrokenPowerLawSpectralModel(**kwargs)

Spectral smooth broken power-law model.

SpatialModel(**kwargs)

Spatial model base class.

SpectralModel(**kwargs)

Spectral model base class.

SuperExpCutoffPowerLaw3FGLSpectralModel(**kwargs)

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

SuperExpCutoffPowerLaw4FGLDR3SpectralModel(...)

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

SuperExpCutoffPowerLaw4FGLSpectralModel(**kwargs)

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

TemplatePhaseCurveTemporalModel(table[, ...])

Temporal phase curve model.

TemplateSpatialModel(map[, meta, normalize, ...])

Spatial sky map template model.

TemplateSpectralModel(energy, values[, ...])

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

TemplateNDSpatialModel(map[, interp_kwargs, ...])

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

TemplateNDSpectralModel(map[, ...])

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

TemplateNPredModel(map[, spectral_model, ...])

Background model.

TemporalModel(**kwargs)

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

gammapy.modeling.models.utils Module#

Functions#

read_hermes_cube(filename)

Read 3d templates produced with hermes.