fenestration.sampling.interpolation_plot#

fenestration.sampling.interpolation_plot(interpolated: ndarray, residuals: ndarray, pix: int | None = 0, val: float | None = None, x: Tensor | ndarray | None = None, full: ndarray | None = None) → Figure#

Create plot showing interpolation results at specified pixel or value.

We have two subplots: the interpolation (with optional actual values) and the residuals

Either pix or val must be set, and the other must be None. They specify which interpolated function to display

Parameters:
  • interpolated – the array of functions interpolated to each pixel

  • residuals – the errors for each interpolation

  • pix – we plot the interpolated function centered at this pixel

  • val – we plot the interpolated function centered at this x-value

  • x – the 1d tensor/array passed to check_sampling. If x is not set, default is torch.linspace(-5, 5, 101) as in check_sampling.

  • full – the array of functions centered at each pixel. If None, won’t plot. If not None, will plot as dashed line behind the interpolation for comparison

Returns:

fig – figure containing the plot

Raises:
  • ValueError – If x is not set

  • ValueError – If neither val_sampling nor pix_sampling are set to None