# 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

ndarray – one-dimensional array with the frequency values.

data\

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

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()


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.

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. newaxes (Axes) – The plot axes.