Skip to content

Get the Shaper (geometry, calibration) from the Shaper actuator - #61

Merged
seb5g merged 5 commits into
5.3.xfrom
feature/shaper-interface
Oct 30, 2026
Merged

seb5g merged 5 commits into
5.3.xfrom
feature/shaper-interface

Conversation

@seb5g

@seb5g seb5g commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The BeamShaping extension builds its Shaper from the Shaper control module (a DAQ_Move), using the contract of pymodaq_plugins_utils.hardware.shaper (pymodaq_plugins_utils 5.3.4, PyMoDAQ/pymodaq_plugins_utils#16): two read-only settings groups, shaper_geometry (pixels, pixel sizes) and shaper_properties (name, modulator type, has_internal_calibration, use_internal_calibration).

  • extensions/spatial_beam_shaping.py: the shaper property returns Shaper.from_module(actuator) once the plugin is initialized, else the default shaper. use_internal_calibration is read live from the actuator. update_from_shaper() re-reads it and rebuilds the fields (input and target sizes, pixel sizes, masks); it is called in do_things_after_experiment_set, when the actuator emits init_signal (the plugin may be initialized after the experiment is set) and when the configuration changes.
  • utilities/shaper.py: Shaper and ModulatorType come from pymodaq_plugins_utils (re-exported). The per-SLM configuration is removed: the [SLM] section of the config template, slm/slm.py (unused) and the config lookups in utilities/sizing.py, the loaders and the mock plugin. A single [default_shaper] section (1920 x 1080 pixels of 8 µm, phase, no internal calibration) is the fallback for all shapers, editable by the user; get_shaper() returns the shaper last told by the actuator (set_shaper), so sizing and the algorithms follow it. An old [SLM] section left in a user's config file is ignored.
  • DAQ_Move_MockShaper fills both groups with the default shaper.
  • New dependency: pymodaq_plugins_utils>=5.3.4.

Tests

tests/test_shaper_interface.py (not initialized / initialized actuator, user choice of the internal calibration, no actuator / no groups, default shaper from the configuration, sizes follow the shaper, mock) and test_custom_apps.py (extension rebuilds its fields for the shaper told by the actuator). The init_signal connection to a real DAQ_Move is not tested. Not tested with a real SLM.

🤖 Generated with Claude Code

https://claude.ai/code/session_01CAhZwmbyCSpSgfTyicUxuS

…r plugins

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CAhZwmbyCSpSgfTyicUxuS
…tead of a mixin

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CAhZwmbyCSpSgfTyicUxuS
…tils contract, configuration as fallback

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CAhZwmbyCSpSgfTyicUxuS
@seb5g seb5g changed the title Add ShaperInterface to get the SLM pixel count and size from the plugins Get the Shaper (geometry, calibration) from the Shaper actuator Oct 29, 2026
@seb5g

seb5g commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator Author

the idea is to remove entirely the need of the shaper configuration. Only a default fallback (for all shapers) should be done

…e Shaper actuator, with one default shaper as fallback

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CAhZwmbyCSpSgfTyicUxuS
@seb5g

seb5g commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator Author

in fact the best woul dbe to have the settings from the real instrument if any, else fallback but in that case one should be able to update them => I guess this is possible by tweaking the preferences then?

…tor is initialized, update the fields; default shaper editable in the configuration

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CAhZwmbyCSpSgfTyicUxuS
@seb5g
seb5g merged commit 2ab4172 into 5.3.x Oct 30, 2026
7 checks passed
@seb5g
seb5g deleted the feature/shaper-interface branch October 30, 2026 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants