Skip to content

Commit

Permalink
commit docs dev version
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Jul 27, 2023
1 parent 18bc001 commit c372cb5
Show file tree
Hide file tree
Showing 806 changed files with 1,209 additions and 1,135 deletions.
Binary file modified docs/dev/.doctrees/api/gammapy.data.Observations.doctree
Binary file not shown.
Binary file modified docs/dev/.doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/dev/.doctrees/index.doctree
Binary file not shown.
Binary file modified docs/dev/.doctrees/tutorials/analysis-1d/cta_sensitivity.doctree
Binary file not shown.
Binary file not shown.
Binary file modified docs/dev/.doctrees/tutorials/analysis-1d/sed_fitting.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified docs/dev/.doctrees/tutorials/analysis-2d/detect.doctree
Binary file not shown.
Binary file modified docs/dev/.doctrees/tutorials/analysis-2d/modeling_2D.doctree
Binary file not shown.
Binary file modified docs/dev/.doctrees/tutorials/analysis-2d/ring_background.doctree
Binary file not shown.
Binary file not shown.
Binary file modified docs/dev/.doctrees/tutorials/analysis-3d/analysis_3d.doctree
Binary file not shown.
Binary file modified docs/dev/.doctrees/tutorials/analysis-3d/analysis_mwl.doctree
Binary file not shown.
Binary file not shown.
Binary file modified docs/dev/.doctrees/tutorials/analysis-3d/event_sampling.doctree
Binary file not shown.
Binary file not shown.
Binary file modified docs/dev/.doctrees/tutorials/analysis-3d/flux_profiles.doctree
Binary file not shown.
Binary file not shown.
Binary file modified docs/dev/.doctrees/tutorials/analysis-3d/simulate_3d.doctree
Binary file not shown.
Binary file modified docs/dev/.doctrees/tutorials/analysis-time/light_curve.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified docs/dev/.doctrees/tutorials/api/astro_dark_matter.doctree
Binary file not shown.
Binary file modified docs/dev/.doctrees/tutorials/api/catalog.doctree
Binary file not shown.
Binary file modified docs/dev/.doctrees/tutorials/api/datasets.doctree
Binary file not shown.
Binary file modified docs/dev/.doctrees/tutorials/api/fitting.doctree
Binary file not shown.
Binary file modified docs/dev/.doctrees/tutorials/api/makers.doctree
Binary file not shown.
Binary file modified docs/dev/.doctrees/tutorials/api/maps.doctree
Binary file not shown.
Binary file modified docs/dev/.doctrees/tutorials/api/mask_maps.doctree
Binary file not shown.
Binary file modified docs/dev/.doctrees/tutorials/api/model_management.doctree
Binary file not shown.
Binary file modified docs/dev/.doctrees/tutorials/api/models.doctree
Binary file not shown.
Binary file modified docs/dev/.doctrees/tutorials/api/sg_execution_times.doctree
Binary file not shown.
Binary file modified docs/dev/.doctrees/tutorials/data/cta.doctree
Binary file not shown.
Binary file modified docs/dev/.doctrees/tutorials/data/fermi_lat.doctree
Binary file not shown.
Binary file modified docs/dev/.doctrees/tutorials/data/hawc.doctree
Binary file not shown.
Binary file modified docs/dev/.doctrees/tutorials/data/hess.doctree
Binary file not shown.
Binary file modified docs/dev/.doctrees/tutorials/data/sg_execution_times.doctree
Binary file not shown.
Binary file modified docs/dev/.doctrees/tutorials/scripts/sg_execution_times.doctree
Binary file not shown.
Binary file modified docs/dev/.doctrees/tutorials/starting/analysis_1.doctree
Binary file not shown.
Binary file modified docs/dev/.doctrees/tutorials/starting/analysis_2.doctree
Binary file not shown.
Binary file modified docs/dev/.doctrees/tutorials/starting/overview.doctree
Binary file not shown.
Binary file modified docs/dev/.doctrees/tutorials/starting/sg_execution_times.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file modified docs/dev/_downloads/432ee3a608125ae95df2e8d950f07716/dl3-1.pdf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified docs/dev/_downloads/84424d59ec624940199b69d87a792d50/index-1.pdf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified docs/dev/_downloads/c6bad13b7bd034ce07497e4d5025d5d2/edisp-1.pdf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified docs/dev/_images/plot_spiral_arms.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/dev/_images/sphx_glr_light_curve_simulation_001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/dev/_images/sphx_glr_light_curve_simulation_002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/dev/_images/sphx_glr_light_curve_simulation_thumb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/dev/_images/sphx_glr_plot_constant_temporal_001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/dev/_images/sphx_glr_plot_constant_temporal_thumb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/dev/_images/sphx_glr_plot_linear_temporal_001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/dev/_images/sphx_glr_plot_linear_temporal_thumb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/dev/_images/sphx_glr_plot_powerlaw_temporal_001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/dev/_images/sphx_glr_plot_powerlaw_temporal_thumb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/dev/_images/sphx_glr_plot_sine_temporal_001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/dev/_images/sphx_glr_plot_sine_temporal_thumb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/dev/_images/sphx_glr_simulate_3d_001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/dev/_images/sphx_glr_simulate_3d_002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/dev/_images/sphx_glr_simulate_3d_thumb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/dev/_images/sphx_glr_spectral_analysis_rad_max_005.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/dev/_modules/gammapy/analysis/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@

$("#version_switcher_menu").append(node);
// replace dropdown button text with the preferred display name of
// this version, rather than using sphinx's 1.2.dev453+g5764a25fc variable.
// this version, rather than using sphinx's 1.2.dev467+g738109e43 variable.
// also highlight the dropdown entry for the currently-viewed
// version's entry
if (entry.version == "dev") {
Expand Down
2 changes: 1 addition & 1 deletion docs/dev/_modules/gammapy/analysis/core.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@

$("#version_switcher_menu").append(node);
// replace dropdown button text with the preferred display name of
// this version, rather than using sphinx's 1.2.dev453+g5764a25fc variable.
// this version, rather than using sphinx's 1.2.dev467+g738109e43 variable.
// also highlight the dropdown entry for the currently-viewed
// version's entry
if (entry.version == "dev") {
Expand Down
2 changes: 1 addition & 1 deletion docs/dev/_modules/gammapy/astro/darkmatter/spectra.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@

$("#version_switcher_menu").append(node);
// replace dropdown button text with the preferred display name of
// this version, rather than using sphinx's 1.2.dev453+g5764a25fc variable.
// this version, rather than using sphinx's 1.2.dev467+g738109e43 variable.
// also highlight the dropdown entry for the currently-viewed
// version's entry
if (entry.version == "dev") {
Expand Down
2 changes: 1 addition & 1 deletion docs/dev/_modules/gammapy/astro/darkmatter/utils.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@

$("#version_switcher_menu").append(node);
// replace dropdown button text with the preferred display name of
// this version, rather than using sphinx's 1.2.dev453+g5764a25fc variable.
// this version, rather than using sphinx's 1.2.dev467+g738109e43 variable.
// also highlight the dropdown entry for the currently-viewed
// version's entry
if (entry.version == "dev") {
Expand Down
2 changes: 1 addition & 1 deletion docs/dev/_modules/gammapy/astro/population/simulate.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@

$("#version_switcher_menu").append(node);
// replace dropdown button text with the preferred display name of
// this version, rather than using sphinx's 1.2.dev453+g5764a25fc variable.
// this version, rather than using sphinx's 1.2.dev467+g738109e43 variable.
// also highlight the dropdown entry for the currently-viewed
// version's entry
if (entry.version == "dev") {
Expand Down
2 changes: 1 addition & 1 deletion docs/dev/_modules/gammapy/astro/population/spatial.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@

$("#version_switcher_menu").append(node);
// replace dropdown button text with the preferred display name of
// this version, rather than using sphinx's 1.2.dev453+g5764a25fc variable.
// this version, rather than using sphinx's 1.2.dev467+g738109e43 variable.
// also highlight the dropdown entry for the currently-viewed
// version's entry
if (entry.version == "dev") {
Expand Down
2 changes: 1 addition & 1 deletion docs/dev/_modules/gammapy/astro/population/velocity.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@

$("#version_switcher_menu").append(node);
// replace dropdown button text with the preferred display name of
// this version, rather than using sphinx's 1.2.dev453+g5764a25fc variable.
// this version, rather than using sphinx's 1.2.dev467+g738109e43 variable.
// also highlight the dropdown entry for the currently-viewed
// version's entry
if (entry.version == "dev") {
Expand Down
2 changes: 1 addition & 1 deletion docs/dev/_modules/gammapy/astro/source/pulsar.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@

$("#version_switcher_menu").append(node);
// replace dropdown button text with the preferred display name of
// this version, rather than using sphinx's 1.2.dev453+g5764a25fc variable.
// this version, rather than using sphinx's 1.2.dev467+g738109e43 variable.
// also highlight the dropdown entry for the currently-viewed
// version's entry
if (entry.version == "dev") {
Expand Down
2 changes: 1 addition & 1 deletion docs/dev/_modules/gammapy/astro/source/pwn.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@

$("#version_switcher_menu").append(node);
// replace dropdown button text with the preferred display name of
// this version, rather than using sphinx's 1.2.dev453+g5764a25fc variable.
// this version, rather than using sphinx's 1.2.dev467+g738109e43 variable.
// also highlight the dropdown entry for the currently-viewed
// version's entry
if (entry.version == "dev") {
Expand Down
2 changes: 1 addition & 1 deletion docs/dev/_modules/gammapy/astro/source/snr.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@

$("#version_switcher_menu").append(node);
// replace dropdown button text with the preferred display name of
// this version, rather than using sphinx's 1.2.dev453+g5764a25fc variable.
// this version, rather than using sphinx's 1.2.dev467+g738109e43 variable.
// also highlight the dropdown entry for the currently-viewed
// version's entry
if (entry.version == "dev") {
Expand Down
2 changes: 1 addition & 1 deletion docs/dev/_modules/gammapy/catalog/core.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@

$("#version_switcher_menu").append(node);
// replace dropdown button text with the preferred display name of
// this version, rather than using sphinx's 1.2.dev453+g5764a25fc variable.
// this version, rather than using sphinx's 1.2.dev467+g738109e43 variable.
// also highlight the dropdown entry for the currently-viewed
// version's entry
if (entry.version == "dev") {
Expand Down
2 changes: 1 addition & 1 deletion docs/dev/_modules/gammapy/catalog/fermi.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@

$("#version_switcher_menu").append(node);
// replace dropdown button text with the preferred display name of
// this version, rather than using sphinx's 1.2.dev453+g5764a25fc variable.
// this version, rather than using sphinx's 1.2.dev467+g738109e43 variable.
// also highlight the dropdown entry for the currently-viewed
// version's entry
if (entry.version == "dev") {
Expand Down
2 changes: 1 addition & 1 deletion docs/dev/_modules/gammapy/catalog/gammacat.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@

$("#version_switcher_menu").append(node);
// replace dropdown button text with the preferred display name of
// this version, rather than using sphinx's 1.2.dev453+g5764a25fc variable.
// this version, rather than using sphinx's 1.2.dev467+g738109e43 variable.
// also highlight the dropdown entry for the currently-viewed
// version's entry
if (entry.version == "dev") {
Expand Down
2 changes: 1 addition & 1 deletion docs/dev/_modules/gammapy/catalog/hawc.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@

$("#version_switcher_menu").append(node);
// replace dropdown button text with the preferred display name of
// this version, rather than using sphinx's 1.2.dev453+g5764a25fc variable.
// this version, rather than using sphinx's 1.2.dev467+g738109e43 variable.
// also highlight the dropdown entry for the currently-viewed
// version's entry
if (entry.version == "dev") {
Expand Down
2 changes: 1 addition & 1 deletion docs/dev/_modules/gammapy/catalog/hess.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@

$("#version_switcher_menu").append(node);
// replace dropdown button text with the preferred display name of
// this version, rather than using sphinx's 1.2.dev453+g5764a25fc variable.
// this version, rather than using sphinx's 1.2.dev467+g738109e43 variable.
// also highlight the dropdown entry for the currently-viewed
// version's entry
if (entry.version == "dev") {
Expand Down
2 changes: 1 addition & 1 deletion docs/dev/_modules/gammapy/catalog/lhaaso.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@

$("#version_switcher_menu").append(node);
// replace dropdown button text with the preferred display name of
// this version, rather than using sphinx's 1.2.dev453+g5764a25fc variable.
// this version, rather than using sphinx's 1.2.dev467+g738109e43 variable.
// also highlight the dropdown entry for the currently-viewed
// version's entry
if (entry.version == "dev") {
Expand Down
2 changes: 1 addition & 1 deletion docs/dev/_modules/gammapy/data/data_store.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@

$("#version_switcher_menu").append(node);
// replace dropdown button text with the preferred display name of
// this version, rather than using sphinx's 1.2.dev453+g5764a25fc variable.
// this version, rather than using sphinx's 1.2.dev467+g738109e43 variable.
// also highlight the dropdown entry for the currently-viewed
// version's entry
if (entry.version == "dev") {
Expand Down
2 changes: 1 addition & 1 deletion docs/dev/_modules/gammapy/data/event_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@

$("#version_switcher_menu").append(node);
// replace dropdown button text with the preferred display name of
// this version, rather than using sphinx's 1.2.dev453+g5764a25fc variable.
// this version, rather than using sphinx's 1.2.dev467+g738109e43 variable.
// also highlight the dropdown entry for the currently-viewed
// version's entry
if (entry.version == "dev") {
Expand Down
2 changes: 1 addition & 1 deletion docs/dev/_modules/gammapy/data/filters.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@

$("#version_switcher_menu").append(node);
// replace dropdown button text with the preferred display name of
// this version, rather than using sphinx's 1.2.dev453+g5764a25fc variable.
// this version, rather than using sphinx's 1.2.dev467+g738109e43 variable.
// also highlight the dropdown entry for the currently-viewed
// version's entry
if (entry.version == "dev") {
Expand Down
2 changes: 1 addition & 1 deletion docs/dev/_modules/gammapy/data/gti.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@

$("#version_switcher_menu").append(node);
// replace dropdown button text with the preferred display name of
// this version, rather than using sphinx's 1.2.dev453+g5764a25fc variable.
// this version, rather than using sphinx's 1.2.dev467+g738109e43 variable.
// also highlight the dropdown entry for the currently-viewed
// version's entry
if (entry.version == "dev") {
Expand Down
2 changes: 1 addition & 1 deletion docs/dev/_modules/gammapy/data/hdu_index_table.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@

$("#version_switcher_menu").append(node);
// replace dropdown button text with the preferred display name of
// this version, rather than using sphinx's 1.2.dev453+g5764a25fc variable.
// this version, rather than using sphinx's 1.2.dev467+g738109e43 variable.
// also highlight the dropdown entry for the currently-viewed
// version's entry
if (entry.version == "dev") {
Expand Down
2 changes: 1 addition & 1 deletion docs/dev/_modules/gammapy/data/obs_table.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@

$("#version_switcher_menu").append(node);
// replace dropdown button text with the preferred display name of
// this version, rather than using sphinx's 1.2.dev453+g5764a25fc variable.
// this version, rather than using sphinx's 1.2.dev467+g738109e43 variable.
// also highlight the dropdown entry for the currently-viewed
// version's entry
if (entry.version == "dev") {
Expand Down
35 changes: 32 additions & 3 deletions docs/dev/_modules/gammapy/data/observations.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@

$("#version_switcher_menu").append(node);
// replace dropdown button text with the preferred display name of
// this version, rather than using sphinx's 1.2.dev453+g5764a25fc variable.
// this version, rather than using sphinx's 1.2.dev467+g738109e43 variable.
// also highlight the dropdown entry for the currently-viewed
// version's entry
if (entry.version == "dev") {
Expand Down Expand Up @@ -266,6 +266,7 @@ <h1>Source code for gammapy.data.observations</h1><div class="highlight"><pre>
<span class="kn">import</span> <span class="nn">collections.abc</span>
<span class="kn">import</span> <span class="nn">copy</span>
<span class="kn">import</span> <span class="nn">inspect</span>
<span class="kn">import</span> <span class="nn">itertools</span>
<span class="kn">import</span> <span class="nn">logging</span>
<span class="kn">import</span> <span class="nn">warnings</span>
<span class="kn">from</span> <span class="nn">itertools</span> <span class="kn">import</span> <span class="n">zip_longest</span>
Expand Down Expand Up @@ -885,7 +886,9 @@ <h1>Source code for gammapy.data.observations</h1><div class="highlight"><pre>
<span class="sd"> &quot;&quot;&quot;</span>

<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">observations</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_observations</span> <span class="o">=</span> <span class="n">observations</span> <span class="ow">or</span> <span class="p">[]</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_observations</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">for</span> <span class="n">obs</span> <span class="ow">in</span> <span class="n">observations</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">obs</span><span class="p">)</span>

<span class="k">def</span> <span class="fm">__getitem__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">key</span><span class="p">):</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_observations</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">index</span><span class="p">(</span><span class="n">key</span><span class="p">)]</span>
Expand All @@ -895,12 +898,20 @@ <h1>Source code for gammapy.data.observations</h1><div class="highlight"><pre>

<span class="k">def</span> <span class="fm">__setitem__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">key</span><span class="p">,</span> <span class="n">obs</span><span class="p">):</span>
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">obs</span><span class="p">,</span> <span class="n">Observation</span><span class="p">):</span>
<span class="k">if</span> <span class="n">obs</span> <span class="ow">in</span> <span class="bp">self</span><span class="p">:</span>
<span class="n">log</span><span class="o">.</span><span class="n">warning</span><span class="p">(</span>
<span class="sa">f</span><span class="s2">&quot;Observation with obs_id </span><span class="si">{</span><span class="n">obs</span><span class="o">.</span><span class="n">obs_id</span><span class="si">}</span><span class="s2"> already belongs to Observations.&quot;</span>
<span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_observations</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">index</span><span class="p">(</span><span class="n">key</span><span class="p">)]</span> <span class="o">=</span> <span class="n">obs</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">TypeError</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;Invalid type: </span><span class="si">{</span><span class="nb">type</span><span class="p">(</span><span class="n">obs</span><span class="p">)</span><span class="si">!r}</span><span class="s2">&quot;</span><span class="p">)</span>

<div class="viewcode-block" id="Observations.insert"><a class="viewcode-back" href="../../../api/gammapy.data.Observations.html#gammapy.data.Observations.insert">[docs]</a> <span class="k">def</span> <span class="nf">insert</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">idx</span><span class="p">,</span> <span class="n">obs</span><span class="p">):</span>
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">obs</span><span class="p">,</span> <span class="n">Observation</span><span class="p">):</span>
<span class="k">if</span> <span class="n">obs</span> <span class="ow">in</span> <span class="bp">self</span><span class="p">:</span>
<span class="n">log</span><span class="o">.</span><span class="n">warning</span><span class="p">(</span>
<span class="sa">f</span><span class="s2">&quot;Observation with obs_id </span><span class="si">{</span><span class="n">obs</span><span class="o">.</span><span class="n">obs_id</span><span class="si">}</span><span class="s2"> already belongs to Observations.&quot;</span>
<span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_observations</span><span class="o">.</span><span class="n">insert</span><span class="p">(</span><span class="n">idx</span><span class="p">,</span> <span class="n">obs</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">TypeError</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;Invalid type: </span><span class="si">{</span><span class="nb">type</span><span class="p">(</span><span class="n">obs</span><span class="p">)</span><span class="si">!r}</span><span class="s2">&quot;</span><span class="p">)</span></div>
Expand Down Expand Up @@ -977,7 +988,25 @@ <h1>Source code for gammapy.data.observations</h1><div class="highlight"><pre>
<span class="p">[</span><span class="n">obs</span> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">obs</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="k">if</span> <span class="n">labels</span><span class="p">[</span><span class="n">k</span><span class="p">]</span> <span class="o">==</span> <span class="n">label</span><span class="p">]</span>
<span class="p">)</span>
<span class="n">obs_groups</span><span class="p">[</span><span class="sa">f</span><span class="s2">&quot;group_</span><span class="si">{</span><span class="n">label</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">observations</span>
<span class="k">return</span> <span class="n">obs_groups</span></div></div>
<span class="k">return</span> <span class="n">obs_groups</span></div>

<div class="viewcode-block" id="Observations.from_stack"><a class="viewcode-back" href="../../../api/gammapy.data.Observations.html#gammapy.data.Observations.from_stack">[docs]</a> <span class="nd">@classmethod</span>
<span class="k">def</span> <span class="nf">from_stack</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">observations_list</span><span class="p">):</span>
<span class="c1"># TODO : Do more check when stacking observations when we have metadata.</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Create a new `Observations` instance by concatenating a list of `Observations` objects.</span>

<span class="sd"> Parameters</span>
<span class="sd"> ----------</span>
<span class="sd"> observations_list : list of `~gammapy.data.Observations`</span>
<span class="sd"> The list of `Observations` to stack.</span>

<span class="sd"> Returns</span>
<span class="sd"> -------</span>
<span class="sd"> observations : `~gammapy.data.Observations`</span>
<span class="sd"> The `Observations` object resulting from the stacking of all the `Observations` in `observation_list`.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">obs</span> <span class="o">=</span> <span class="n">itertools</span><span class="o">.</span><span class="n">chain</span><span class="p">(</span><span class="o">*</span><span class="n">observations_list</span><span class="p">)</span>
<span class="k">return</span> <span class="bp">cls</span><span class="p">(</span><span class="nb">list</span><span class="p">(</span><span class="n">obs</span><span class="p">))</span></div></div>


<span class="k">class</span> <span class="nc">ObservationChecker</span><span class="p">(</span><span class="n">Checker</span><span class="p">):</span>
Expand Down
Loading

0 comments on commit c372cb5

Please sign in to comment.