Plot#

epsf.plot.plot_image(img, scale='log', ax=None, fig=None, color_label=None, return_colorbar=False, **kwargs)[source]#

Plot an image with a given scaling and axes

Simple wrapper to handle proper scaling, colorbar and axis names

Parameters:
  • img (ndarray) – Image array

  • scale (str) – Scale to apply. If a “norm” kwarg is present, it will override this setting. Symlog uses a treshold of 1e-3 of the max.

  • ax (Axes | None) – Axis. Current axis (plt.gca()) is used if None.

  • fig (Figure | None) – Figure. Current figure (plt.gcf()) is used if None.

  • color_label (str | None)

  • return_colorbar (bool)

Returns:

Figure and axis

Return type:

tuple[Figure, Axes] | tuple[Figure, Axes, Colorbar]

epsf.plot.plot_mosaic(cube, nrows, ncols, titles=None, ytitles=None, xtitles=None, colorbar=True, imshow_kwargs=None)[source]#

Plot an image cube in a mosaic display.

Parameters:
  • cube (ndarray | list[ndarray]) – Image cube with shape (Nimg, Ny, Nx)

  • nrows (int) – Number of rows in the mosaic

  • cols – Number of rows in the mosaic

  • titles (list[str] | None) – List of titles to use

  • xtitles (list[str] | None) – List of titles for each column.

  • ytitles (list[str] | None) – List of titles for each row.

  • colorbar (bool) – Show a colorbar for each panel if True.

  • imshow_kwargs (dict | None) – Keyword arguments passed to imshow for all panels.

  • ncols (int)

Returns:

Figure and Axes used to create the plot.

Return type:

tuple[Figure, Axes]

epsf.plot.plot_with_diff(img1, img2, scale='log', fig=None, axes=None)[source]#

Simple 3-panel plot with two images and their difference

If fig or axes is passed, the current figure will be

Parameters:
  • img1 (ndarray) – First image

  • img2 (ndarray) – Second image

  • scale (str | list) – Scale to use. Log will automatically use symlog for the diff. Pass a list to override per-panel.

  • fig (Figure | None) – Figure to use. 3-panel figure created if None.

  • axes (Axes | None) – Axes to use. Indices 0-2 will be used. Make sure they exist.

Returns:

Tuple with figure and axes

Return type:

tuple[Figure, Axes]