SpectrumResult¶
-
class
gammapy.spectrum.SpectrumResult(model, points)[source]¶ Bases:
objectSpectrum analysis results.
Contains best fit model and flux points.
Parameters: model :
SpectralModelBest Fit model
points :
FluxPoints, optionalFlux points
Attributes Summary
flux_point_residualsResiduals. Methods Summary
plot(energy_range[, energy_unit, flux_unit, …])Plot spectrum. Attributes Documentation
-
flux_point_residuals¶ Residuals.
Defined as
(points - model) / modelReturns: residuals :
numpy.ndarrayResiduals
residuals_err :
numpy.ndarrayResiduals error
Methods Documentation
-
plot(energy_range, energy_unit='TeV', flux_unit='cm-2 s-1 TeV-1', energy_power=0, fit_kwargs={}, butterfly_kwargs={}, point_kwargs={}, fig_kwargs={})[source]¶ Plot spectrum.
Plot best fit model, flux points and residuals.
Parameters: energy_range :
QuantityEnergy range for the plot
energy_unit : str,
Unit, optionalUnit of the energy axis
flux_unit : str,
Unit, optionalUnit of the flux axis
energy_power : int
Power of energy to multiply flux axis with
fit_kwargs : dict, optional
forwarded to
gammapy.spectrum.models.SpectralModel.plot()butterfly_kwargs : dict, optional
forwarded to
gammapy.spectrum.models.SpectralModel.plot_error()point_kwargs : dict, optional
forwarded to
gammapy.spectrum.FluxPoints.plot()fig_kwargs : dict, optional
forwarded to
matplotlib.pyplot.figure()Returns: ax0 :
AxesSpectrum plot axis
ax1 :
AxesResiduals plot axis
-