Plotting#
- jwpoint.plot.plot_dithers(img, xopt_all, yopt_all, size, full_frame=True, show_mask=True, psf=None)[source]#
Plot the pointing for multiple dithers
This function produces two plots:
A full image with the dithers marked by their pattern number
A figure with a zoomed-in view on each dither using
zoom_plot().
- Parameters:
img (
ndarray) – The full-frame imagexopt_all (
Iterable[int]) – The x position of each ditheryopt_all (
Iterable[int]) – The y position of each dithersize (
int) – The size to use for the zoomed-in plotsfull_frame (
bool) – Show the full frame image with the dithers on it.show_mask (
bool) – Show the bad pixel mask for each dither if Truepsf (
ndarray|None) – A PSF with shape(size, size)to visualize a point source in the region corresponding to each dither. Only the bad pixel mask is shown if no PSF is passsed. Defaults to None.
- Return type:
tuple[Figure,Figure]- Returns:
The two figures (full frame and zoomed-in)
- jwpoint.plot.zoom_plot(img, x, y, size, axs=None, show_mask=True, psf=None)[source]#
Zoomed plot on a region of an image
Also plots the NaN mask on a second panel, optionally with a reference PSF to see where bad pixels would fall on a point source image in that region.
The mask can be turned off with
show_mask=False.- Parameters:
img (
ndarray) – The full image as a 2D arrayx (
int) – x coordinates of the image centery (
int) – y coordinate of the image centersize (
int) – The size of the region to cropshow_mask (
bool) – Show the bad pixel mask if Trueaxs (
ndarray[Axes] |None) – Two Axes on which the plots should go. Fetch from the current figure if None. Defaults to None.psf (
ndarray|None) – Image of a reference PSF as a 2D array. Must have a shape(size, size). Defalts to None.
- Return type:
ndarray- Returns:
The boolean mask indicating NaNs in the final zoomed in region.