/
sed.rst
77 lines (57 loc) · 2.62 KB
/
sed.rst
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
.. _sed:
SED Analysis
============
The :py:meth:`~fermipy.gtanalysis.GTAnalysis.sed` method computes a
spectral energy distribution (SED) for a source by fitting the source
flux normalization in a sequence of energy bins. The normalization in
each bin is fit independently using a power-law spectrum with a fixed
index. The value of this index can be set with the ``bin_index``
parameter or allowed to vary over the energy range according to the
local slope of the global spectral model (with the ``use_local_index``
parameter). By default this method will fix the parameters of all
background components in the ROI. To leave background parameters free
in the fit set ``fix_background`` to True.
The default configuration of
:py:meth:`~fermipy.gtanalysis.GTAnalysis.sed` is defined in the *sed*
section of the configuration file:
.. csv-table:: *sed* Options
:header: Option, Default, Description
:file: ../config/sed.csv
:delim: tab
:widths: 10,10,80
The :py:meth:`~fermipy.gtanalysis.GTAnalysis.sed` method is executed
by passing the name of a source in the ROI as a single argument.
Additional keyword argument can also be provided to override the
default configuration of the method:
.. code-block:: python
# Run analysis with default energy binning
>>> sed = gta.sed('sourceA')
# Override the energy binning for the SED
>>> sed = gta.sed('sourceA',energies=[2.0,2.5,3.0,3.5,4.0,4.5,5.0], bin_index=2)
By default the method will use the energy bins of the underlying
analysis. The ``energies`` keyword argument can be used to override
the default binning with the restriction that the SED energy bins
most align with the analysis bins.
The output of the SED analysis are written to a dictionary which is
the return argument of the SED method. The output dictionary is also
saved to the ``sed`` dictionary of the `~fermipy.roi_model.Source`
instance which is written to the output file generated by
:py:meth:`~fermipy.gtanalysis.GTAnalysis.write_roi`. The following
example shows how the output dictionary can be captured from either
from the method return value or later accessed from the
`~fermipy.roi_model.ROIModel` instance:
.. code-block:: python
# Get the sed results from the return argument
>>> sed = gta.sed('sourceA')
# Get the sed results from the source object
>>> sed = gta.roi['sourceA']
The contents of the output dictionary are described below:
.. csv-table:: *sed* Output Dictionary
:header: Key, Type, Description
:file: ../config/sed_output.csv
:delim: tab
:widths: 10,10,80
Reference/API
-------------
.. automethod:: fermipy.gtanalysis.GTAnalysis.sed
:noindex: