drippy.utilities

Functions

get_figure_and_axes(→ tuple[matplotlib.figure.Figure, ...)

Get or create figure and axes for plotting.

bl_filt(→ numpy.ndarray)

Simple Blackman filter.

Module Contents

drippy.utilities.get_figure_and_axes(fig: matplotlib.figure.Figure | None = None, ax: matplotlib.axes.Axes | None = None) tuple[matplotlib.figure.Figure, matplotlib.axes.Axes][source]

Get or create figure and axes for plotting.

Parameters:
  • fig (Figure, optional) – Existing Figure or None to create new.

  • None. (Defaults to)

  • ax (Axes, optional) – Existing Axes or None to create new.

  • None.

Returns:

Figure and Axes objects for plotting.

Return type:

tuple[Figure, Axes]

drippy.utilities.bl_filt(y: numpy.ndarray, half_width: int) numpy.ndarray[source]

Simple Blackman filter.

The end effects are handled by calculating the weighted average of however many points are available, rather than by zero-padding.

Parameters:
  • y (np.ndarray) – Input signal to be filtered.

  • half_width (int) – Half-width of the filter window. Total window size will be 2*half_width + 1.

Returns:

Filtered signal with the same shape as input.

Return type:

np.ndarray