Plotting (wcc_etc.plotting)
Convenience plotting helpers for SimulatedImage (matplotlib + bokeh).
Every function accepts either a SimulatedImage (positional source) or explicit raw arrays as keywords, so the Flask web portal can pass arrays directly.
- wcc_etc.plotting.set_wcc_style()[source]
Apply the WCC plotting style to matplotlib’s global rcParams.
Call once (e.g. at the top of a notebook) so every subsequent matplotlib figure shares the same look. Mutates global state by design.
- wcc_etc.plotting.apply_ax_settings(ax, ticksize=None)[source]
Apply the standard per-axis tweaks: minor ticks, tick padding, faint grid.
Unlike set_wcc_style this touches one axis rather than global rcParams, so it is safe to call on a figure that also carries someone else’s style.
- wcc_etc.plotting.plot_image_mpl(source=None, *, noise=True, show_saturation=False, image_e=None, image_clean=None, saturation_mask=None, pixel_scale_mas=None, stretch='log', cmap='viridis', vmin=None, vmax=None, colorbar=True, title='', units='pix', sat_color='red', sat_alpha=0.6, ax=None)[source]
Plot a single simulated detector image with equal x/y scale.
noise=True shows the noisy image_e; noise=False shows the noiseless image_clean. show_saturation overlays the saturation mask. units=’mas’ labels the axes in milliarcsec using pixel_scale_mas. Returns (fig, ax).
- wcc_etc.plotting.plot_image_row_mpl(source=None, *, image_e=None, image_clean=None, saturation_mask=None, pixel_scale_mas=None, stretch='log', cmap='viridis', units='pix', sat_cmap='gray', figsize=(15, 5), axes=None)[source]
Three panels: PSF+noise, PSF (no noise), and the saturation mask.
The two image panels share a common color scale (computed from the noisy image). Returns (fig, axes) where axes has length 3.
- wcc_etc.plotting.plot_radial_mpl(source=None, *, noise=False, image_e=None, image_clean=None, saturation_mask=None, pixel_scale_mas=None, units='mas', annulus_width=1, show_hwhm=True, title='', ax=None)[source]
Azimuthally-averaged radial profile of the simulated image.
Uses image_clean by default (noise=True uses image_e). units=’mas’ scales the radius by pixel_scale_mas. Returns (fig, ax, (radius, profile)).
- wcc_etc.plotting.plot_encircled_energy_mpl(source=None, *, noise=False, image_e=None, image_clean=None, saturation_mask=None, pixel_scale_mas=None, units='mas', ee_target=0.9, title='', ax=None)[source]
Encircled-energy curve (normalized to 1) of the simulated image.
Uses image_clean by default. units=’mas’ uses the mas radius from psf_to_encircled_energy; units=’pix’ divides by pixel_scale_mas. ee_target defaults to 0.9 (marks the 90% encircled-energy radius); pass ee_target=None to disable the marker or another fraction to override. Returns (fig, ax, (radius, ee)).
- wcc_etc.plotting.plot_image_bokeh(source=None, *, noise=True, image_e=None, image_clean=None, saturation_mask=None, pixel_scale_mas=None, units='pix', palette='Viridis256', title='', width=400, height=400, return_='obj')[source]
Bokeh single-image plot with equal x/y scale (match_aspect=True).
return_selects the output form (see _finish_bokeh).
- wcc_etc.plotting.plot_image_row_bokeh(source=None, *, image_e=None, image_clean=None, saturation_mask=None, pixel_scale_mas=None, units='pix', palette='Viridis256', sat_palette='Greys256', width=300, height=300, return_='obj')[source]
Bokeh 3-panel row: PSF+noise, PSF (no noise), saturation mask.
return_selects the output form (see _finish_bokeh).
- wcc_etc.plotting.plot_radial_bokeh(source=None, *, noise=False, image_e=None, image_clean=None, saturation_mask=None, pixel_scale_mas=None, units='mas', annulus_width=1, title='', width=500, height=350, return_='obj')[source]
Bokeh radial profile.
return_selects the output form (see _finish_bokeh).
- wcc_etc.plotting.plot_encircled_energy_bokeh(source=None, *, noise=False, image_e=None, image_clean=None, saturation_mask=None, pixel_scale_mas=None, units='mas', ee_target=0.9, title='', width=500, height=350, return_='obj')[source]
Bokeh encircled-energy curve. ee_target defaults to 0.9 (marks the 90% encircled-energy radius); pass ee_target=None to disable.
return_selects the output form.
- wcc_etc.plotting.plot_lightcurve_mpl(source=None, *, show_noise=True, show_model=True, time=None, flux=None, flux_clean=None, flux_err=None, ax=None, **kw)[source]
Matplotlib light-curve plot: clean model line, noisy points with error bars, or both. Accepts a LightCurve (positional) or raw arrays.
- wcc_etc.plotting.plot_lightcurve_bokeh(source=None, *, show_noise=True, show_model=True, time=None, flux=None, flux_clean=None, flux_err=None, width=600, height=350, return_='obj')[source]
Bokeh light-curve plot.
return_selects the output form (see _finish_bokeh). Accepts a LightCurve (positional) or raw arrays.