Spectrum#

class radiospectra.spectrum.Spectrum(data, *args, **kwargs)[source]#

Bases: ndarray

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:

ndarray

Examples

>>> from radiospectra.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()   

Methods Summary

peek(**matplot_args)

Plot spectrum onto a new figure.

plot([axes])

Plot spectrum onto current axes.

Methods Documentation

peek(**matplot_args)[source]#

Plot spectrum onto a new figure. :param **matplot_args: Any additional plot arguments that should be used when plotting. :type **matplot_args: dict

Returns:

Figure – A plot figure.

Examples

>>> from radiospectra.spectrum import Spectrum
>>> import numpy as np
>>> spec = Spectrum(np.linspace(1, 100, 100), np.linspace(0, 10, 100))
>>> spec.peek()  
plot(axes=None, **matplot_args)[source]#

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:

Axes – The plot axes.