spacepy.plot.spectrogram¶
Create and plot generic ‘spectrograms’ for space science. This is not a signal processing routine and does not apply Fourier transforms (or similar) to the data. The functionality provided here is the binning (and averaging) of multi-dimensional to provide a 2D output map of some quantity as a function of two parameters. An example would be particle data from a satellite mission: electron flux, at a given energy, can be binned as a function of both time and McIlwain L, then plotted as a 2D color-map, colloquially known as a spectrogram.
In many other settings ‘spectrogram’ refers to a transform of data
from the time domain to the frequency domain, and the subsequent plotting
of some quantity (e.g., power spectral density) as a function of time and
frequency. To approximate this functionality for, e.g., time-series magnetic field
data you would first calculate a the power spectral density and then use
Spectrogram
to rebin the data for visualization.
Authors: Brian Larsen and Steve Morley Institution: Los Alamos National Laboratory Contact: balarsen@lanl.gov, smorley@lanl.gov Los Alamos National Laboratory
Copyright 2011 Los Alamos National Security, LLC.
Functions
|
Plot a spectrogram given Z or X,Y,Z. |
Classes
|
This class rebins data to produce a 2D data map that can be plotted as a spectrogram |
- spacepy.plot.spectrogram.simpleSpectrogram(*args, **kwargs)[source]¶
Plot a spectrogram given Z or X,Y,Z. This is a wrapper around pcolormesh() that can handle Y being a 2d array of time dependent bins. Like in the Van Allen Probes HOPE and MagEIS data files.
- Parameters:
- *args1 or 3 arraylike
Call Signatures:
simpleSpectrogram(Z, **kwargs) simpleSpectrogram(X, Y, Z, **kwargs)
- Returns:
- axmatplotlib.axes._subplots.AxesSubplot
Matplotlib axes object that the plot is on
- Other Parameters:
- zlogbool
Plot the color with a log colorbar (default: True)
- ylogbool
Plot the Y axis with a log scale (default: True)
- alphascalar (0-1)
The alpha blending value (default: None)
- cmapstring
The name of the colormap to use (default: system default)
- vminfloat
Minimum color value (default: Z.min(), if log non-zero min)
- vmaxfloat
Maximum color value (default: Z.max())
- axmatplotlib.axes
Axes to plot the spectrogram on (default: None - new axes)
- cbbool
Plot a colorbar (default: True)
- cbtitlestring
Label to go on the colorbar (default: None)
- zero_validbool
Treat zero as a valid value on zlog plots and use same color as other under-minimum values. No effect with linear colorbar. (default: False, draw as fill)
Added in version 0.5.0.