ptyrad.plotting.basic#

Plotting functions for basic outputs including probe modes, loss curves, positions, etc.

Functions

plot_affine_transformation(scale, asymmetry, ...)

plot_convergence_dashboard(loss_iters, ...)

Unified dashboard of all scalar time-series in a fixed 2x4 grid.

plot_learning_rates_schedule(lr_iters[, ...])

Plots the learning rate schedule for each optimizable parameter group over iterations.

plot_loss_curves(loss_iters[, last_n_iters, ...])

plot_obj_tilts(pos, tilts[, figsize, ...])

Plot the obj tilts given the probe position and pos-dependent tilts

plot_obj_tilts_avg(avg_tilt_iters[, ...])

plot_pos_grouping(pos, batches[, ...])

plot_probe_modes([init_probe, opt_probe, ...])

plot_scan_positions(pos[, init_pos, img, ...])

Plot the scan positions given an array of (N,2)

plot_sigmoid_mask(Npix, relative_radius, ...)

Plot a sigmoid mask overlay on img with a line profile

plot_slice_thickness(dz_iters[, ...])

ptyrad.plotting.basic.plot_sigmoid_mask(Npix, relative_radius, relative_width, img=None, show_circles=False)[source]#

Plot a sigmoid mask overlay on img with a line profile

ptyrad.plotting.basic.plot_obj_tilts_avg(avg_tilt_iters, last_n_iters=2, show_fig=True, pass_fig=False)[source]#
ptyrad.plotting.basic.plot_obj_tilts(pos, tilts, figsize=(16, 16), show_fig=True, pass_fig=False)[source]#

Plot the obj tilts given the probe position and pos-dependent tilts

ptyrad.plotting.basic.plot_scan_positions(pos, init_pos=None, img=None, offset=None, figsize=(16, 16), dot_scale=0.001, show_arrow=True, show_fig=True, pass_fig=False)[source]#

Plot the scan positions given an array of (N,2)

ptyrad.plotting.basic.plot_affine_transformation(scale, asymmetry, rotation, shear)[source]#
ptyrad.plotting.basic.plot_pos_grouping(pos, batches, circle_diameter=False, diameter_type='90%', figsize=(16, 8), dot_scale=1, show_fig=True, pass_fig=False)[source]#
ptyrad.plotting.basic.plot_loss_curves(loss_iters, last_n_iters=10, show_fig=True, pass_fig=False)[source]#
ptyrad.plotting.basic.plot_learning_rates_schedule(lr_iters, log=True, show_fig=True, pass_fig=False)[source]#

Plots the learning rate schedule for each optimizable parameter group over iterations.

ptyrad.plotting.basic.plot_slice_thickness(dz_iters, last_n_iters=10, show_fig=True, pass_fig=False)[source]#
ptyrad.plotting.basic.plot_probe_modes(init_probe=None, opt_probe=None, amp_or_phase='amplitude', real_or_fourier='real', phase_cmap=None, amplitude_cmap=None, dpi=200, show_fig=True, pass_fig=False)[source]#
ptyrad.plotting.basic.plot_convergence_dashboard(loss_iters, lr_iters, dz_iters, avg_tilt_iters, convergence_iters, iter_offset=None, show_fig=True, pass_fig=False)[source]#

Unified dashboard of all scalar time-series in a fixed 2x4 grid.

Layout:

Row 0: Loss | obja | objp | Object tilts
Row 1: LR   | Probe amplitude | Probe position shifts | Slice thickness

Panels with no data show a blank placeholder so the layout stays fixed across save cycles. iter_offset sets the starting iteration for all panels; if None, each panel determines its own start via the smart Kneedle router. Because panels have different logging strides (e.g. loss every iter, convergence metrics every 50 iters), each panel independently converts the iteration number to its own array index.