コード例 #1
0
def plot_spectrum(spec, config):
    """ Plot spectra for each of the spectrum dimensions (e.g. energy)

    Args:
      Spec (:class:`echidna.core.spectra.Spectra`): Spectrum object to
        be plotted
      config (:class:`SpectraConfig`): configuration object
    """
    for v in config.getpars():
        plot.plot_projection(spec, v)
コード例 #2
0
def plot_spectrum(spec):
    """ Plot spectra for each of the three spectrum dimensions:
      Energy, radius and time

    Args:
      Spec (:class:`echidna.core.spectra.Spectra`): Spectrum object to
        be plotted
    """
    plot.plot_projection(spec, 0)
    plot.plot_projection(spec, 1)
    plot.plot_projection(spec, 2)
コード例 #3
0
# Another useful way to inspect the `Spectra` created is to plot it. Support
# is available within echidna to plot using either `ROOT` or `matplotlib`
# and there are some useful plotting functions available in the `plot` an
# `plot_root` modules.

# In[ ]:

    import echidna.output.plot as plot
    import echidna.output.plot_root as plot_root

# To plot the projection of the spectrum on the `energy_mc` axis:

# In[ ]:

    fig1 = plot.plot_projection(spectrum, "energy_mc",
                                fig_num=1, show_plot=False)

# and to plot the projection on the `radial_mc` axis, this time using root:

# In[ ]:

    plot_root.plot_projection(spectrum, "radial_mc", fig_num=2)

# We can also project onto two dimensions and plot a surface:

# In[ ]:

    fig_3 = plot.plot_surface(spectrum, "energy_mc", "radial_mc",
                              fig_num=3, show_plot=False)

# ## Convolution and cuts