gdas.plots.build_spec

gdas.plots. build_spec ( data , tmin = None , tmax = None , fmin = None , fmax = None , vmin = None , vmax = None , mode = 'fourier' , omega0 = 6 , dt = 1 , dj = 0.05 , fct = 'morlet' , stride = None , nfft = None , overlap = None , scale = 'log' , station = None , dy = None , xmin = None , xmax = None , funit = 'Hz' , tunit = 'secs' , cmap = 'inferno' , fname = None ) [source]

Plot multiplot figure with time series, PSD and spectrogram.

Parameters
data TimeSeries

Magnetic field data

tmin, tmax datetime

First and last timestamps

fmin, fmax float

Minimum and maximum frequencies

vmin, vmax float

Minimum and maximum color values

mode str

Spectrogram mode, wavelet or Fourier. Default is Fourier

omega0 int

Wavelet function parameter

dt float

Time step

dj float

Scale resolution (smaller values of dj give finer resolution)

fct str

Wavelet function (morlet,paul,dog)

stride float

Length of segment

nfft float

Length of the FFT used, if a zero padded FFT is desired.

overlap float

Length of overlapping segment

cmap str

Colormap

scale str

Plotted frequency scale. Default is “log”.

station str

Name of the station.

dy float

Half the difference between the maximum and minimum magnetic field values to be plotted. This can be used if multiple figures are made from different stations such that the plotted range of the time series is of the same size for every station.

xmin float

Minimum value in the power spectral density plot

xmax float

Maximum value in the power spectral density plot

funit strg

Frequency unit, Hz or mHz. Default is Hz.

tunit str

Time unit, secs, mins or hrs. Default is mins.

fname str

Output file name.

Notes

The matplotlib.pyplot.imshow module is used to plot the wavelet spectrogram. This module is usually used to plot raw images and assumes that the position of the cell in the input spectrogram array directly represents the position of the pixel in the raw image. That is, for an input Python array (in which rows are appended below previous ones), the first row in the array is assumed to represent the top line of pixel in the image. Therefore, in order to plot the spectrogram array using the imshow module, one needs to carefully check that the rows (which are representative of the frequency bands), are stored in descending order such that the lowest frequency is placed at the end (bottom) of the array.