rayoptics.gui.dashboards module

Dashboards constructed with ipywidgets.

create_focus_dashboard(figs, ray_data_items, foc: float, dfoc_rng: float, shift_rng: float, image_delta, continuous_update: bool = True)[source]

Create 3 ipywidgets to modify defocus and image shift interactively.

This function creates 3 ipywidgets (FloatSliders) controlling defoucus, x_shift and y_shift. When the user moves one of the sliders, the callback function applies the new slider value to the ray_data_items and causes them to ‘update’. The ray_data items in the analyses package all provide a lightweight ‘update’ implementation that doesn’t require retracing the model.

Parameters:
  • figs – list of Figures to be cleared and replotted

  • ray_data_items – list of ray data items to be updated to the new values

  • foc – the current defocus

  • dfoc_range – the maximum range for the defocus slider

  • shift_rng – the maximum range for the image shift sliders

  • image_delta – the current image shift, [delta_x: float, delta_y: float]

  • continuous_update – if True, model is updated for any slider movement

create_mirror_tilt_dashboard(mirror, app_mgr, figs, ray_data_items, foc, tilt_rng, shift_rng, oa_ray=None, continuous_update=True)[source]
class AttrChanger(obj, attr, index=None)[source]

Bases: object

Changer built on an object/attribute pair.

get()[source]
set(value)[source]