Absorption¶
-
class
gammapy.modeling.models.
Absorption
(energy, param, data, filename=None, interp_kwargs=None)[source]¶ Bases:
object
Gamma-ray absorption models.
For more information see Absorption Spectral Model.
- Parameters
- energy
Quantity
Energy node values
- param
Quantity
Parameter node values
- data
Quantity
Model value
- filenamestr
Filename of the absorption model used for serialisation.
- interp_kwargsdict
Interpolation option passed to
ScaledRegularGridInterpolator
. By default the models are extrapolated outside the range. To prevent this and raise an error instead use interp_kwargs = {“extrapolate”: False}
- energy
Attributes Summary
Methods Summary
evaluate
(self, energy, parameter)Evaluate model for energy and parameter value.
from_dict
(data)read
(filename[, interp_kwargs])Build object from an XSPEC model.
read_builtin
(name[, interp_kwargs])Read one of the built-in absorption models.
table_model
(self, parameter)Table model for a given parameter value.
to_dict
(self)Attributes Documentation
-
tag
= 'Absorption'¶
Methods Documentation
-
classmethod
read
(filename, interp_kwargs=None)[source]¶ Build object from an XSPEC model.
Todo: Format of XSPEC binary files should be referenced at https://gamma-astro-data-formats.readthedocs.io/en/latest/
- Parameters
- filenamestr
File containing the model.
- interp_kwargsdict
Interpolation option passed to
ScaledRegularGridInterpolator
.
- Returns
- absorption
Absorption
Absorption model.
- absorption
-
classmethod
read_builtin
(name, interp_kwargs=None)[source]¶ Read one of the built-in absorption models.
- Parameters
- name{‘franceschini’, ‘dominguez’, ‘finke’}
name of one of the available model in gammapy-data
- Returns
- absorption
Absorption
Absorption model.
- absorption
References
- 1
Franceschini et al., “Extragalactic optical-infrared background radiation, its time evolution and the cosmic photon-photon opacity”, Link
- 2
Dominguez et al., ” Extragalactic background light inferred from AEGIS galaxy-SED-type fractions” Link
- 3
Finke et al., “Modeling the Extragalactic Background Light from Stars and Dust” Link
-
table_model
(self, parameter)[source]¶ Table model for a given parameter value.
- Parameters
- parameterfloat
Parameter value.
- Returns
- template_model
TemplateSpectralModel
Template spectral model.
- template_model