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 Sep 20, 2024
1 parent 5ee86a1 commit 4ac57fa
Show file tree
Hide file tree
Showing 840 changed files with 4,095 additions and 959 deletions.
Binary file modified docs/dev/.doctrees/api-reference/estimators.doctree
Binary file not shown.
Binary file modified docs/dev/.doctrees/api-reference/stats.doctree
Binary file not shown.
Binary file not shown.
Binary file modified docs/dev/.doctrees/api/gammapy.estimators.FluxMetaData.doctree
Binary file not shown.
Binary file not shown.
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/sg_execution_times.doctree
Binary file not shown.
Binary file modified docs/dev/.doctrees/tutorials/analysis-1d/cta_sensitivity.doctree
Binary file not shown.
Binary file modified docs/dev/.doctrees/tutorials/analysis-1d/ebl.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 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 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/observation_clustering.doctree
Binary file not shown.
Binary file modified docs/dev/.doctrees/tutorials/api/priors.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.
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 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 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/06ba2363ac6d8e23d2098c691bbc6e58/priors.zip
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/1370bd9099a95d65461f2a665bb9decd/catalog.zip
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 modified docs/dev/_downloads/21c6356dca773bb211972068bdd8edac/irfs.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified docs/dev/_downloads/277e8d586c77a3ac9f6ad21ecdfc3485/detect.zip
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/3887251ea091cf5a495cbd0984520eec/hawc.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified docs/dev/_downloads/3edea76cb3aefe6dfce230edb07b24e2/models.zip
Binary file not shown.
Binary file modified docs/dev/_downloads/408398be7d2e8fce69b0c175dfb7db6c/hess.zip
Binary file not shown.
Binary file modified docs/dev/_downloads/42884adaf5dec1438e6da837d7acfad0/cta.zip
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.
Binary file not shown.
Binary file modified docs/dev/_downloads/4722787c7fa105f0833ba203665f472d/maps.zip
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 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 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 modified docs/dev/_downloads/920df746e67257657f5d44e868b95ff9/fitting.zip
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/ac76b976c8eed3f5e3889db8bc14cf8e/makers.zip
Binary file not shown.
Binary file not shown.
Binary file modified docs/dev/_downloads/ba616a9da5fd4ea6727cee926df2b69e/ebl.zip
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 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 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_priors_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_priors_004.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.
95 changes: 92 additions & 3 deletions docs/dev/_modules/gammapy/estimators/utils.html
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,12 @@ <h1>Source code for gammapy.estimators.utils</h1><div class="highlight"><pre>
<span class="n">PowerLawSpectralModel</span><span class="p">,</span>
<span class="n">SkyModel</span><span class="p">,</span>
<span class="p">)</span>
<span class="kn">from</span> <span class="nn">gammapy.stats</span> <span class="kn">import</span> <span class="n">compute_flux_doubling</span><span class="p">,</span> <span class="n">compute_fpp</span><span class="p">,</span> <span class="n">compute_fvar</span>
<span class="kn">from</span> <span class="nn">gammapy.stats</span> <span class="kn">import</span> <span class="p">(</span>
<span class="n">compute_flux_doubling</span><span class="p">,</span>
<span class="n">compute_fpp</span><span class="p">,</span>
<span class="n">compute_fvar</span><span class="p">,</span>
<span class="n">discrete_correlation</span><span class="p">,</span>
<span class="p">)</span>
<span class="kn">from</span> <span class="nn">gammapy.stats.utils</span> <span class="kn">import</span> <span class="n">ts_to_sigma</span>
<span class="kn">from</span> <span class="nn">.map.core</span> <span class="kn">import</span> <span class="n">FluxMaps</span>

Expand All @@ -565,6 +570,7 @@ <h1>Source code for gammapy.estimators.utils</h1><div class="highlight"><pre>
<span class="s2">&quot;compute_lightcurve_fvar&quot;</span><span class="p">,</span>
<span class="s2">&quot;compute_lightcurve_fpp&quot;</span><span class="p">,</span>
<span class="s2">&quot;compute_lightcurve_doublingtime&quot;</span><span class="p">,</span>
<span class="s2">&quot;compute_lightcurve_discrete_correlation&quot;</span><span class="p">,</span>
<span class="p">]</span>


Expand Down Expand Up @@ -1093,6 +1099,91 @@ <h1>Source code for gammapy.estimators.utils</h1><div class="highlight"><pre>



<div class="viewcode-block" id="compute_lightcurve_discrete_correlation">
<a class="viewcode-back" href="../../../api/gammapy.estimators.utils.compute_lightcurve_discrete_correlation.html#gammapy.estimators.utils.compute_lightcurve_discrete_correlation">[docs]</a>
<span class="k">def</span> <span class="nf">compute_lightcurve_discrete_correlation</span><span class="p">(</span>
<span class="n">lightcurve1</span><span class="p">,</span> <span class="n">lightcurve2</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">flux_quantity</span><span class="o">=</span><span class="s2">&quot;flux&quot;</span><span class="p">,</span> <span class="n">tau</span><span class="o">=</span><span class="kc">None</span>
<span class="p">):</span>
<span class="w"> </span><span class="sa">r</span><span class="sd">&quot;&quot;&quot;Compute the discrete correlation function for two lightcurves, or the discrete autocorrelation if only one lightcurve is provided.</span>
<span class="sd"> NaN values will be ignored in the computation in order to account for possible gaps in the data.</span>

<span class="sd"> Internally calls the `~gammapy.stats.discrete_correlation` function</span>

<span class="sd"> Parameters</span>
<span class="sd"> ----------</span>
<span class="sd"> lightcurve1 : `~gammapy.estimators.FluxPoints`</span>
<span class="sd"> The first lightcurve object.</span>
<span class="sd"> lightcurve2 : `~gammapy.estimators.FluxPoints`, optional</span>
<span class="sd"> The second lightcurve object. If not provided, the autocorrelation for the first lightcurve will be computed.</span>
<span class="sd"> Default is None.</span>
<span class="sd"> flux_quantity : str</span>
<span class="sd"> Flux quantity to use for calculation. Should be &#39;dnde&#39;, &#39;flux&#39;, &#39;e2dnde&#39; or &#39;eflux&#39;.</span>
<span class="sd"> The choice does not affect the computation. Default is &#39;flux&#39;.</span>
<span class="sd"> tau : `~astropy.units.Quantity`, optional</span>
<span class="sd"> Size of the bins to compute the discrete correlation.</span>
<span class="sd"> If None, the bin size will be double the bins of the first lightcurve. Default is None.</span>


<span class="sd"> Returns</span>
<span class="sd"> -------</span>
<span class="sd"> discrete_correlation_dict : dict</span>
<span class="sd"> Dictionary containing:</span>
<span class="sd"> &quot;bins&quot; : the array of discrete time bins</span>
<span class="sd"> &quot;discrete_correlation&quot; : discrete correlation function values</span>
<span class="sd"> &quot;discrete_correlation_err&quot; : associated error</span>

<span class="sd"> References</span>
<span class="sd"> ----------</span>
<span class="sd"> .. [Edelson1988] &quot;THE DISCRETE CORRELATION FUNCTION: A NEW METHOD FOR ANALYZING</span>
<span class="sd"> UNEVENLY SAMPLED VARIABILITY DATA&quot;, Edelson et al. (1988)</span>
<span class="sd"> https://ui.adsabs.harvard.edu/abs/1988ApJ...333..646E/abstract</span>
<span class="sd"> &quot;&quot;&quot;</span>

<span class="n">flux1</span> <span class="o">=</span> <span class="nb">getattr</span><span class="p">(</span><span class="n">lightcurve1</span><span class="p">,</span> <span class="n">flux_quantity</span><span class="p">)</span>
<span class="n">flux_err1</span> <span class="o">=</span> <span class="nb">getattr</span><span class="p">(</span><span class="n">lightcurve1</span><span class="p">,</span> <span class="n">flux_quantity</span> <span class="o">+</span> <span class="s2">&quot;_err&quot;</span><span class="p">)</span>
<span class="n">coords1</span> <span class="o">=</span> <span class="n">lightcurve1</span><span class="o">.</span><span class="n">geom</span><span class="o">.</span><span class="n">axes</span><span class="p">[</span><span class="s2">&quot;time&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">center</span>
<span class="n">axis</span> <span class="o">=</span> <span class="n">flux1</span><span class="o">.</span><span class="n">geom</span><span class="o">.</span><span class="n">axes</span><span class="o">.</span><span class="n">index_data</span><span class="p">(</span><span class="s2">&quot;time&quot;</span><span class="p">)</span>

<span class="k">if</span> <span class="n">tau</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
<span class="n">tau</span> <span class="o">=</span> <span class="p">(</span><span class="n">coords1</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span> <span class="o">-</span> <span class="n">coords1</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> <span class="o">/</span> <span class="p">(</span><span class="mf">0.5</span> <span class="o">*</span> <span class="nb">len</span><span class="p">(</span><span class="n">coords1</span><span class="p">))</span>

<span class="k">if</span> <span class="n">lightcurve2</span><span class="p">:</span>
<span class="n">flux2</span> <span class="o">=</span> <span class="nb">getattr</span><span class="p">(</span><span class="n">lightcurve2</span><span class="p">,</span> <span class="n">flux_quantity</span><span class="p">)</span>
<span class="n">flux_err2</span> <span class="o">=</span> <span class="nb">getattr</span><span class="p">(</span><span class="n">lightcurve2</span><span class="p">,</span> <span class="n">flux_quantity</span> <span class="o">+</span> <span class="s2">&quot;_err&quot;</span><span class="p">)</span>
<span class="n">coords2</span> <span class="o">=</span> <span class="n">lightcurve2</span><span class="o">.</span><span class="n">geom</span><span class="o">.</span><span class="n">axes</span><span class="p">[</span><span class="s2">&quot;time&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">center</span>
<span class="n">bins</span><span class="p">,</span> <span class="n">dcf</span><span class="p">,</span> <span class="n">dcf_err</span> <span class="o">=</span> <span class="n">discrete_correlation</span><span class="p">(</span>
<span class="n">flux1</span><span class="o">.</span><span class="n">data</span><span class="p">,</span>
<span class="n">flux_err1</span><span class="o">.</span><span class="n">data</span><span class="p">,</span>
<span class="n">flux2</span><span class="o">.</span><span class="n">data</span><span class="p">,</span>
<span class="n">flux_err2</span><span class="o">.</span><span class="n">data</span><span class="p">,</span>
<span class="n">coords1</span><span class="p">,</span>
<span class="n">coords2</span><span class="p">,</span>
<span class="n">tau</span><span class="p">,</span>
<span class="n">axis</span><span class="p">,</span>
<span class="p">)</span>

<span class="k">else</span><span class="p">:</span>
<span class="n">bins</span><span class="p">,</span> <span class="n">dcf</span><span class="p">,</span> <span class="n">dcf_err</span> <span class="o">=</span> <span class="n">discrete_correlation</span><span class="p">(</span>
<span class="n">flux1</span><span class="o">.</span><span class="n">data</span><span class="p">,</span>
<span class="n">flux_err1</span><span class="o">.</span><span class="n">data</span><span class="p">,</span>
<span class="n">flux1</span><span class="o">.</span><span class="n">data</span><span class="p">,</span>
<span class="n">flux_err1</span><span class="o">.</span><span class="n">data</span><span class="p">,</span>
<span class="n">coords1</span><span class="p">,</span>
<span class="n">coords1</span><span class="p">,</span>
<span class="n">tau</span><span class="p">,</span>
<span class="n">axis</span><span class="p">,</span>
<span class="p">)</span>

<span class="n">discrete_correlation_dict</span> <span class="o">=</span> <span class="p">{</span>
<span class="s2">&quot;bins&quot;</span><span class="p">:</span> <span class="n">bins</span><span class="p">,</span>
<span class="s2">&quot;discrete_correlation&quot;</span><span class="p">:</span> <span class="n">dcf</span><span class="p">,</span>
<span class="s2">&quot;discrete_correlation_err&quot;</span><span class="p">:</span> <span class="n">dcf_err</span><span class="p">,</span>
<span class="p">}</span>

<span class="k">return</span> <span class="n">discrete_correlation_dict</span></div>



<span class="k">def</span> <span class="nf">get_edges_fixed_bins</span><span class="p">(</span><span class="n">fluxpoint</span><span class="p">,</span> <span class="n">group_size</span><span class="p">,</span> <span class="n">axis_name</span><span class="o">=</span><span class="s2">&quot;energy&quot;</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Rebin the flux point to combine value adjacent bins.</span>

Expand Down Expand Up @@ -1380,7 +1471,6 @@ <h1>Source code for gammapy.estimators.utils</h1><div class="highlight"><pre>
<span class="n">reference_model</span> <span class="o">=</span> <span class="n">maps</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">reference_model</span>

<span class="k">if</span> <span class="n">method</span> <span class="o">==</span> <span class="s2">&quot;gaussian_errors&quot;</span><span class="p">:</span>

<span class="n">means</span> <span class="o">=</span> <span class="p">[</span><span class="n">map_</span><span class="o">.</span><span class="n">dnde</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span> <span class="k">for</span> <span class="n">map_</span> <span class="ow">in</span> <span class="n">maps</span><span class="p">]</span>
<span class="n">sigmas</span> <span class="o">=</span> <span class="p">[</span><span class="n">map_</span><span class="o">.</span><span class="n">dnde_err</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span> <span class="k">for</span> <span class="n">map_</span> <span class="ow">in</span> <span class="n">maps</span><span class="p">]</span>
<span class="c1"># compensate for the ts deviation from gaussian approximation expectation in each map</span>
Expand All @@ -1396,7 +1486,6 @@ <h1>Source code for gammapy.estimators.utils</h1><div class="highlight"><pre>
<span class="n">sigma</span> <span class="o">=</span> <span class="n">sigmas</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>

<span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="nb">len</span><span class="p">(</span><span class="n">means</span><span class="p">)):</span>

<span class="n">mean_k</span> <span class="o">=</span> <span class="n">means</span><span class="p">[</span><span class="n">k</span><span class="p">]</span><span class="o">.</span><span class="n">quantity</span><span class="o">.</span><span class="n">to_value</span><span class="p">(</span><span class="n">mean</span><span class="o">.</span><span class="n">unit</span><span class="p">)</span>
<span class="n">sigma_k</span> <span class="o">=</span> <span class="n">sigmas</span><span class="p">[</span><span class="n">k</span><span class="p">]</span><span class="o">.</span><span class="n">quantity</span><span class="o">.</span><span class="n">to_value</span><span class="p">(</span><span class="n">sigma</span><span class="o">.</span><span class="n">unit</span><span class="p">)</span>

Expand Down
3 changes: 3 additions & 0 deletions docs/dev/_modules/gammapy/modeling/models/spatial.html
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,7 @@
<h1>Source code for gammapy.modeling.models.spatial</h1><div class="highlight"><pre>
<span></span><span class="c1"># Licensed under a 3-clause BSD style license - see LICENSE.rst</span>
<span class="sd">&quot;&quot;&quot;Spatial models.&quot;&quot;&quot;</span>

<span class="kn">import</span> <span class="nn">logging</span>
<span class="kn">import</span> <span class="nn">os</span>
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
Expand Down Expand Up @@ -1969,6 +1970,8 @@ <h1>Source code for gammapy.modeling.models.spatial</h1><div class="highlight"><
<span class="n">log</span><span class="o">.</span><span class="n">warning</span><span class="p">(</span><span class="s2">&quot;Map has negative values. Check and fix this!&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="p">(</span><span class="nb">map</span><span class="o">.</span><span class="n">data</span> <span class="o">==</span> <span class="mf">0.0</span><span class="p">)</span><span class="o">.</span><span class="n">all</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="s2">&quot;Map values are all zeros. Check and fix this!&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="n">np</span><span class="o">.</span><span class="n">isnan</span><span class="p">(</span><span class="nb">map</span><span class="o">.</span><span class="n">data</span><span class="p">)</span><span class="o">.</span><span class="n">any</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="s2">&quot;Map has NaN values. Check and fix this!&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="nb">map</span><span class="o">.</span><span class="n">geom</span><span class="o">.</span><span class="n">is_image</span> <span class="ow">and</span> <span class="p">(</span><span class="nb">map</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">sum</span><span class="p">(</span><span class="n">axis</span><span class="o">=</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">))</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span><span class="o">.</span><span class="n">any</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="s2">&quot;Map values are all zeros in at least one energy bin. Check and fix this!&quot;</span>
Expand Down
Loading

0 comments on commit 4ac57fa

Please sign in to comment.