Spectrum

class sunpy.spectra.spectrum.Spectrum(data, freq_axis)[source] [edit on github]

Bases: numpy.ndarray

Deprecated since version 0.8: this module is being moved to radiospectra - http://docs.sunpy.org/projects/radiospectra/

Class representing a 1 dimensional spectrum.

freq_axis

one-dimensional array with the frequency values.

Type:ndarray
data\

One-dimensional array which the intensity at a particular frequency at every data-point.

Type:numpy.ndarray

Examples

>>> from sunpy.spectra.spectrum import Spectrum
>>> import numpy as np
>>> data = np.linspace(1, 100, 100)
>>> freq_axis = np.linspace(0, 10, 100)
>>> spec = Spectrum(data, freq_axis)
>>> spec.peek()   # doctest: +SKIP

Deprecated since version 0.8: this module is being moved to radiospectra - http://docs.sunpy.org/projects/radiospectra/

Methods Summary

peek(**matplot_args) Plot spectrum onto a new figure.
plot([axes]) Plot spectrum onto current axes.

Methods Documentation

peek(**matplot_args)[source] [edit on github]

Plot spectrum onto a new figure. An example is shown below.

(Source code, png, hires.png, pdf)

../_images/sunpy-spectra-spectrum-Spectrum-1.png
Parameters:**matplot_args (dict) – Any additional plot arguments that should be used when plotting.
plot(axes=None, **matplot_args)[source] [edit on github]

Plot spectrum onto current axes.

Parameters:
  • axes (Axes or None) – If provided the spectrum will be plotted on the given axes. Else the current matplotlib axes will be used.
  • **matplot_args (dict) – Any additional plot arguments that should be used when plotting.
Returns:

newaxes (Axes) – The plot axes.