Base Classes

class prysm._richdata.RichData(data, dx, wavelength)

Bases: object

Abstract base class holding some data properties.

shape

Proxy to phase or data shape.

size

Proxy to phase or data size.

x

X coordinate axis, 1D.

y

Y coordinate axis, 1D.

r

r coordinate axis, 2D.

t

t coordinate axis, 2D.

support_x

Width of the domain in X.

support_y

Width of the domain in Y.

support

Width of the domain.

copy()

Return a (deep) copy of this instance.

slices(twosided=None)

Create a Slices instance from this instance.

Parameters

twosided (bool, optional) – if None, copied from self._default_twosided

Returns

a Slices object

Return type

Slices

exact_polar(rho, phi=None)

Retrieve data at the specified radial coordinates pairs.

Parameters
  • rho (iterable) – radial coordinate(s) to sample

  • phi (iterable) – azimuthal coordinate(s) to sample

Returns

data at the given points

Return type

numpy.ndarray

exact_xy(x, y=None)

Retrieve data at the specified X-Y frequency pairs.

Parameters
  • x (iterable) – X coordinate(s) to retrieve

  • y (iterable) – Y coordinate(s) to retrieve

Returns

data at the given points

Return type

numpy.ndarray

exact_x(x)

Return data at an exact x coordinate along the y=0 axis.

Parameters

x (number or numpy.ndarray) – x coordinate(s) to return

Returns

ndarray of values

Return type

numpy.ndarray

exact_y(y)

Return data at an exact y coordinate along the x=0 axis.

Parameters

y (number or numpy.ndarray) – y coordinate(s) to return

Returns

ndarray of values

Return type

numpy.ndarray

plot2d(xlim=None, ylim=None, clim=None, cmap=None, log=False, power=1, interpolation=None, show_colorbar=True, colorbar_label=None, axis_labels=(None, None), fig=None, ax=None)

Plot data in 2D.

Parameters
  • xlim (float or iterable, optional) – x axis limits. If not iterable, symmetric version of the single value

  • ylim (float or iterable, optional) – y axis limits. If None and xlim is not None, copied from xlim. If not iterable, symmetric version of the single value.

  • clim (iterable, optional) – clim passed directly to matplotlib. If None, looked up on self._default_clim.

  • cmap (str, optional) – colormap to use, passed directly to matplotlib if not None. If None, looks up the default cmap for self._data_type on config

  • log (bool, optional) – if True, plot on a log color scale

  • power (float, optional) – if not 1, plot on a power stretched color scale

  • interpolation (str, optional) – interpolation method to use, passed directly to matplotlib

  • show_colorbar (bool, optional) – if True, draws the colorbar

  • colorbar_label (str, optional) – label for the colorbar

  • axis_labels (iterable of str,) – (x, y) axis labels. If None, not drawn

  • fig (matplotlib.figure.Figure) – Figure containing the plot

  • ax (matplotlib.axes.Axis) – Axis containing the plot

Returns

  • fig (matplotlib.figure.Figure) – Figure containing the plot

  • ax (matplotlib.axes.Axis) – Axis containing the plot

class prysm._richdata.Slices(data, x, y, twosided=True)

Bases: object

Slices of data.

check_polar_calculated()

Ensure that the polar representation of the source data has been calculated.

x

Slice through the Y=0 axis of the data, i.e. along the X axis.

Returns

  • x (numpy.ndarray) – coordinates

  • slice (numpy.ndarray) – values of the data array at these coordinates

y

Slice through the X=0 axis of the data, i.e., along the Y axis.

Returns

  • y (numpy.ndarray) – coordinates

  • slice (numpy.ndarray) – values of the data array at these coordinates

azavg

Azimuthal average of the data.

Returns

  • rho (numpy.ndarray) – coordinates

  • slice (numpy.ndarray) – values of the data array at these coordinates

azmedian

Azimuthal median of the data.

Returns

  • rho (numpy.ndarray) – coordinates

  • slice (numpy.ndarray) – values of the data array at these coordinates

azmin

Azimuthal minimum of the data.

Returns

  • rho (numpy.ndarray) – coordinates

  • slice (numpy.ndarray) – values of the data array at these coordinates

azmax

Azimuthal maximum of the data.

Returns

  • rho (numpy.ndarray) – coordinates

  • slice (numpy.ndarray) – values of the data array at these coordinates

azpv

Azimuthal PV of the data.

Returns

  • rho (numpy.ndarray) – coordinates

  • slice (numpy.ndarray) – values of the data array at these coordinates

azvar

Azimuthal variance of the data.

Returns

  • rho (numpy.ndarray) – coordinates

  • slice (numpy.ndarray) – values of the data array at these coordinates

azstd

Azimuthal standard deviation of the data.

Returns

  • rho (numpy.ndarray) – coordinates

  • slice (numpy.ndarray) – values of the data array at these coordinates

plot(slices, lw=None, alpha=None, zorder=None, invert_x=False, xlim=(None, None), xscale='linear', ylim=(None, None), yscale='linear', show_legend=True, axis_labels=(None, None), fig=None, ax=None)

Plot slice(s).

Parameters
  • slices (str or Iterable) – if a string, plots a single slice. Else, plots several slices.

  • lw (float or Iterable, optional) – line width to use for the slice(s). If a single value, used for all slice(s). If iterable, used pairwise with the slices

  • alpha (float or Iterable, optional) – alpha (transparency) to use for the slice(s). If a single value, used for all slice(s). If iterable, used pairwise with the slices

  • zorder (int or Iterable, optional) – zorder (stack height) to use for the slice(s). If a single value, used for all slice(s). If iterable, used pairwise with the slices

  • invert_x (bool, optional) – if True, flip x (i.e., Freq => Period or vice-versa)

  • xlim (tuple, optional) – x axis limits

  • xscale (str, {‘linear’, ‘log’}, optional) – scale used for the x axis

  • ylim (tuple, optional) – y axis limits

  • yscale (str, {‘linear’, ‘log’}, optional) – scale used for the y axis

  • show_legend (bool, optional) – if True, show the legend

  • axis_labels (iterable of str,) – (x, y) axis labels. If None, not drawn

  • fig (matplotlib.figure.Figure) – Figure containing the plot

  • ax (matplotlib.axes.Axis) – Axis containing the plot

Returns

  • fig (matplotlib.figure.Figure) – Figure containing the plot

  • ax (matplotlib.axes.Axis) – Axis containing the plot