pymodaq_plugins_beam_shaping 5.2.0__tar.gz → 5.3.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (200) hide show
  1. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/AGENTS.md +4 -0
  2. pymodaq_plugins_beam_shaping-5.3.1/AGENTS_BEAM_SHAPING.md +107 -0
  3. pymodaq_plugins_beam_shaping-5.3.1/CLAUDE.md +3 -0
  4. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/PKG-INFO +11 -8
  5. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/README.rst +4 -4
  6. pymodaq_plugins_beam_shaping-5.3.1/docs/scripts/binary_holograms_snapshots.py +90 -0
  7. pymodaq_plugins_beam_shaping-5.3.1/docs/src/_images/binary_holograms.png +0 -0
  8. pymodaq_plugins_beam_shaping-5.3.1/docs/src/_images/field_tool.png +0 -0
  9. pymodaq_plugins_beam_shaping-5.3.1/docs/src/_static/css/layout.css +61 -0
  10. pymodaq_plugins_beam_shaping-5.3.1/docs/src/_static/css/overflow.css +11 -0
  11. pymodaq_plugins_beam_shaping-5.3.1/docs/src/_static/js/sidebar_toggle.js +44 -0
  12. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/docs/src/acknowledgments.rst +3 -3
  13. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/docs/src/bibtex.bib +47 -1
  14. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/docs/src/conf.py +10 -11
  15. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/docs/src/introduction.rst +1 -0
  16. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/docs/src/quick_start.rst +3 -2
  17. pymodaq_plugins_beam_shaping-5.3.1/docs/src/redirects.txt +1 -0
  18. pymodaq_plugins_beam_shaping-5.3.1/docs/src/references.rst +22 -0
  19. pymodaq_plugins_beam_shaping-5.3.1/docs/src/theory.rst +209 -0
  20. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/docs/src/troubleshooting.rst +4 -3
  21. pymodaq_plugins_beam_shaping-5.3.1/docs/src/user_guide/algorithm_reference.rst +234 -0
  22. pymodaq_plugins_beam_shaping-5.3.1/docs/src/user_guide/algorithms.rst +333 -0
  23. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/docs/src/user_guide/calibration.rst +11 -6
  24. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/docs/src/user_guide/corrections.rst +1 -0
  25. pymodaq_plugins_beam_shaping-5.3.1/docs/src/user_guide/custom_algorithm.rst +331 -0
  26. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/docs/src/user_guide/data_management.rst +2 -2
  27. pymodaq_plugins_beam_shaping-5.3.1/docs/src/user_guide/field_tool.rst +154 -0
  28. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/docs/src/user_guide/fields.rst +6 -2
  29. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/docs/src/user_guide/index.rst +5 -0
  30. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/docs/src/user_guide/interface.rst +1 -6
  31. pymodaq_plugins_beam_shaping-5.3.1/docs/src/user_guide/shapers.rst +77 -0
  32. pymodaq_plugins_beam_shaping-5.3.1/docs/src/user_guide/slmsuite.rst +87 -0
  33. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/pyproject.toml +8 -4
  34. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/algorithms/algo_base.py +119 -15
  35. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/algorithms/algorithm_app.py +174 -42
  36. pymodaq_plugins_beam_shaping-5.3.1/src/pymodaq_plugins_beam_shaping/algorithms/algorithms/binary_holograms.py +369 -0
  37. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/algorithms/algorithms/checker_board.py +7 -20
  38. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/algorithms/algorithms/diffractive.py +6 -4
  39. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/algorithms/algorithms/direct.py +4 -2
  40. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/algorithms/algorithms/minimizer.py +6 -6
  41. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/algorithms/algorithms/optim.py +5 -4
  42. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/algorithms/algorithms/projections.py +8 -19
  43. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/algorithms/algorithms/torch_base.py +1 -1
  44. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/algorithms/factory.py +8 -2
  45. pymodaq_plugins_beam_shaping-5.3.1/src/pymodaq_plugins_beam_shaping/algorithms/ini_phases/flat_phase.py +12 -0
  46. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/algorithms/ini_phases/quadratic_phase.py +2 -2
  47. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/algorithms/utils.py +15 -0
  48. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/daq_move_plugins/daq_move_FocalLength.py +4 -4
  49. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/daq_move_plugins/daq_move_MockAutoFocus.py +4 -4
  50. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/daq_move_plugins/daq_move_MockShaper.py +28 -9
  51. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/daq_move_plugins/daq_move_Zernike.py +4 -4
  52. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/daq_viewer_plugins/plugins_2D/daq_2Dviewer_MockShaperCamera.py +1 -1
  53. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/extensions/spatial_beam_shaping.py +188 -47
  54. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/field/field.py +23 -3
  55. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/field/field_loader_app.py +140 -68
  56. pymodaq_plugins_beam_shaping-5.3.1/src/pymodaq_plugins_beam_shaping/field/field_tool_app.py +304 -0
  57. pymodaq_plugins_beam_shaping-5.3.1/src/pymodaq_plugins_beam_shaping/field/h5.py +50 -0
  58. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/field/loaders/from_functions_loader.py +0 -2
  59. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/field/loaders/save_field_loader.py +2 -14
  60. pymodaq_plugins_beam_shaping-5.3.1/src/pymodaq_plugins_beam_shaping/field/operations/__init__.py +3 -0
  61. pymodaq_plugins_beam_shaping-5.3.1/src/pymodaq_plugins_beam_shaping/field/operations/base.py +117 -0
  62. pymodaq_plugins_beam_shaping-5.3.1/src/pymodaq_plugins_beam_shaping/field/operations/compute.py +201 -0
  63. pymodaq_plugins_beam_shaping-5.3.1/src/pymodaq_plugins_beam_shaping/field/operations/linear_phase.py +53 -0
  64. pymodaq_plugins_beam_shaping-5.3.1/src/pymodaq_plugins_beam_shaping/field/operations/log_amplitude.py +26 -0
  65. pymodaq_plugins_beam_shaping-5.3.1/src/pymodaq_plugins_beam_shaping/field/operations/unwrap.py +41 -0
  66. pymodaq_plugins_beam_shaping-5.3.1/src/pymodaq_plugins_beam_shaping/field/operations/zernike.py +54 -0
  67. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/hardware/mock_shaper_camera.py +19 -10
  68. pymodaq_plugins_beam_shaping-5.3.1/src/pymodaq_plugins_beam_shaping/resources/cat_field.h5 +0 -0
  69. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/resources/config_template.toml +13 -17
  70. pymodaq_plugins_beam_shaping-5.3.1/src/pymodaq_plugins_beam_shaping/resources/holography_calibration.scan +0 -0
  71. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/scanners/calibration.py +4 -2
  72. pymodaq_plugins_beam_shaping-5.3.1/src/pymodaq_plugins_beam_shaping/scripts/algorithm_playground.py +116 -0
  73. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/scripts/calibrate_slm.py +2 -1
  74. pymodaq_plugins_beam_shaping-5.3.1/src/pymodaq_plugins_beam_shaping/scripts/make_calibration_entry.py +56 -0
  75. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/utilities/calibrating.py +11 -20
  76. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/utilities/corrections.py +13 -6
  77. pymodaq_plugins_beam_shaping-5.3.1/src/pymodaq_plugins_beam_shaping/utilities/headless_algorithms.py +599 -0
  78. pymodaq_plugins_beam_shaping-5.3.1/src/pymodaq_plugins_beam_shaping/utilities/regions.py +88 -0
  79. pymodaq_plugins_beam_shaping-5.3.1/src/pymodaq_plugins_beam_shaping/utilities/shaper.py +21 -0
  80. pymodaq_plugins_beam_shaping-5.3.1/src/pymodaq_plugins_beam_shaping/utilities/sizing.py +67 -0
  81. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/utilities/zernike.py +1 -1
  82. pymodaq_plugins_beam_shaping-5.3.1/tests/conftest.py +22 -0
  83. pymodaq_plugins_beam_shaping-5.3.1/tests/field_test.py +63 -0
  84. pymodaq_plugins_beam_shaping-5.3.1/tests/test_algo_helpers.py +61 -0
  85. pymodaq_plugins_beam_shaping-5.3.1/tests/test_algorithm_playground.py +223 -0
  86. pymodaq_plugins_beam_shaping-5.3.1/tests/test_algorithm_status.py +90 -0
  87. pymodaq_plugins_beam_shaping-5.3.1/tests/test_algorithms_by_modulator_type.py +69 -0
  88. pymodaq_plugins_beam_shaping-5.3.1/tests/test_binary_holograms.py +353 -0
  89. pymodaq_plugins_beam_shaping-5.3.1/tests/test_calibration.py +50 -0
  90. pymodaq_plugins_beam_shaping-5.3.1/tests/test_custom_apps.py +161 -0
  91. pymodaq_plugins_beam_shaping-5.3.1/tests/test_field_tool.py +237 -0
  92. pymodaq_plugins_beam_shaping-5.3.1/tests/test_regions.py +109 -0
  93. pymodaq_plugins_beam_shaping-5.3.1/tests/test_shaper_interface.py +183 -0
  94. pymodaq_plugins_beam_shaping-5.2.0/CLAUDE.md +0 -3
  95. pymodaq_plugins_beam_shaping-5.2.0/docs/src/references.rst +0 -45
  96. pymodaq_plugins_beam_shaping-5.2.0/docs/src/theory.rst +0 -146
  97. pymodaq_plugins_beam_shaping-5.2.0/docs/src/user_guide/algorithms.rst +0 -223
  98. pymodaq_plugins_beam_shaping-5.2.0/src/pymodaq_plugins_beam_shaping/resources/holography_calibration.xml +0 -1
  99. pymodaq_plugins_beam_shaping-5.2.0/src/pymodaq_plugins_beam_shaping/slm/slm.py +0 -13
  100. pymodaq_plugins_beam_shaping-5.2.0/src/pymodaq_plugins_beam_shaping/utilities/shaper.py +0 -35
  101. pymodaq_plugins_beam_shaping-5.2.0/src/pymodaq_plugins_beam_shaping/utilities/sizing.py +0 -71
  102. pymodaq_plugins_beam_shaping-5.2.0/tests/field_test.py +0 -28
  103. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/.gitattributes +0 -0
  104. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/.github/workflows/compatibility.yml +0 -0
  105. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/.github/workflows/python-publish.yml +0 -0
  106. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/.github/workflows/tests.yml +0 -0
  107. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/.gitignore +0 -0
  108. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/LICENSE +0 -0
  109. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/MANIFEST.in +0 -0
  110. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/docs/Makefile +0 -0
  111. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/docs/make.bat +0 -0
  112. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/docs/requirements.txt +0 -0
  113. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/docs/scripts/data_browse.py +0 -0
  114. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/docs/src/_images/calibration.png +0 -0
  115. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/docs/src/_images/corrections.png +0 -0
  116. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/docs/src/_images/field_loader.png +0 -0
  117. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/docs/src/_images/layout.png +0 -0
  118. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/docs/src/_images/main_app.png +0 -0
  119. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/docs/src/_images/measurement_amplitude.png +0 -0
  120. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/docs/src/_images/schema.png +0 -0
  121. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/docs/src/_images/setup_field_loader.png +0 -0
  122. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/docs/src/_static/icons/add_circle.png +0 -0
  123. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/docs/src/_static/icons/deblur.png +0 -0
  124. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/docs/src/_static/icons/equalizer.png +0 -0
  125. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/docs/src/_static/icons/file_open.png +0 -0
  126. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/docs/src/_static/icons/grid_off.png +0 -0
  127. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/docs/src/_static/icons/grid_on.png +0 -0
  128. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/docs/src/_static/icons/ink_eraser.png +0 -0
  129. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/docs/src/_static/icons/ink_eraser_off.png +0 -0
  130. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/docs/src/_static/icons/input.png +0 -0
  131. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/docs/src/_static/icons/save.png +0 -0
  132. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/docs/src/_static/icons/target.png +0 -0
  133. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/docs/src/_static/logo.png +0 -0
  134. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/docs/src/_templates/apidoc/module.rst_t +0 -0
  135. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/docs/src/_templates/apidoc/package.rst_t +0 -0
  136. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/docs/src/_templates/apidoc/toc.rst_t +0 -0
  137. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/docs/src/index.rst +0 -0
  138. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/docs/src/installation.rst +0 -0
  139. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/docs/src/tutorials.rst +0 -0
  140. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/hatch_build.py +0 -0
  141. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/icon.ico +0 -0
  142. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/readthedocs.yml +0 -0
  143. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/__init__.py +0 -0
  144. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/algorithms/__init__.py +0 -0
  145. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/algorithms/algo_config.py +0 -0
  146. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/algorithms/algorithms/__init__.py +0 -0
  147. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/algorithms/ini_phase.py +0 -0
  148. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/algorithms/ini_phases/__init__.py +0 -0
  149. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/algorithms/ini_phases/random_phase.py +0 -0
  150. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/algorithms/loss.py +0 -0
  151. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/algorithms/stopping.py +0 -0
  152. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/algorithms/stoppings/__init__.py +0 -0
  153. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/algorithms/stoppings/stoppings_base.py +0 -0
  154. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/daq_move_plugins/__init__.py +0 -0
  155. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/daq_viewer_plugins/__init__.py +0 -0
  156. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/daq_viewer_plugins/plugins_2D/__init__.py +0 -0
  157. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/daq_viewer_plugins/plugins_2D/daq_2Dviewer_MockAutoFocus.py +0 -0
  158. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/extensions/__init__.py +0 -0
  159. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/field/__init__.py +0 -0
  160. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/field/factory.py +0 -0
  161. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/field/loaders/__init__.py +0 -0
  162. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/field/loaders/dashboard_loader.py +0 -0
  163. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/field/loaders/image_loader.py +0 -0
  164. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/field/utils.py +0 -0
  165. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/hardware/__init__.py +0 -0
  166. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/hardware/autofocus.py +0 -0
  167. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/models/OptimizerModelAutoFocus.py +0 -0
  168. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/models/__init__.py +0 -0
  169. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/models/datamixer_autofocus.py +0 -0
  170. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/resources/Cemes - Logo - Sigle - Blanc.png +0 -0
  171. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/resources/Papillon_flower_BW_resized.png +0 -0
  172. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/resources/Pymodaq.png +0 -0
  173. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/resources/__init__.py +0 -0
  174. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/resources/cheshirecat_rect.png +0 -0
  175. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/resources/darumas_BW_resized.png +0 -0
  176. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/resources/dollars.png +0 -0
  177. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/resources/dollars.svg +0 -0
  178. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/resources/face.png +0 -0
  179. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/resources/holography.xml +0 -0
  180. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/resources/mock_holo.xml +0 -0
  181. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/resources/one_piece.png +0 -0
  182. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/resources/osama.png +0 -0
  183. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/resources/zernike.png +0 -0
  184. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/scanners/__init__.py +0 -0
  185. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/scripts/__init__.py +0 -0
  186. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/setup/factory.py +0 -0
  187. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/setup/setup.py +0 -0
  188. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/slm/__init__.py +0 -0
  189. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/utilities/__init__.py +0 -0
  190. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/utilities/data.py +0 -0
  191. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/utilities/h5saving.py +0 -0
  192. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/utilities/masking.py +0 -0
  193. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/src/pymodaq_plugins_beam_shaping/utils.py +0 -0
  194. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/tests/algorithm_entry_points_test.py +0 -0
  195. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/tests/element_test.py +0 -0
  196. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/tests/pytensor_fft.py +0 -0
  197. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/tests/pytorch_fft.py +0 -0
  198. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/tests/pytorch_test_v1.ipynb +0 -0
  199. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/tests/test_plugin_package_structure.py +0 -0
  200. {pymodaq_plugins_beam_shaping-5.2.0 → pymodaq_plugins_beam_shaping-5.3.1}/tox.ini +0 -0
@@ -4,6 +4,10 @@ Guidance for AI coding assistants (and humans) building on **PyMoDAQ 5.3.x** fro
4
4
  PyMoDAQ is a Qt framework that drives lab experiments: hardware is added through small *plugins*, and PyMoDAQ
5
5
  provides the GUI, threading, data model, scans and HDF5 saving. Python 3.10 to 3.13.
6
6
 
7
+ > **This repository has specific guidance in [AGENTS_BEAM_SHAPING.md](AGENTS_BEAM_SHAPING.md)** (where the field loaders,
8
+ > algorithms, Field Tool, shapers, tests and docs are, branch conventions). Read it first; the rest of this file is the
9
+ > generic PyMoDAQ plugin guidance from the template.
10
+
7
11
  This repository is a plugin package named `pymodaq_plugins_<name>`. Rename everything that still says `template`
8
12
  before publishing.
9
13
 
@@ -0,0 +1,107 @@
1
+ # AGENTS_BEAM_SHAPING.md: `pymodaq_plugins_beam_shaping`
2
+
3
+ A PyMoDAQ extension that computes masks for spatial light modulators (SLM, DMD...) from an input field and a target
4
+ field, sends them to a **Shaper** actuator of the Dashboard and optionally optimizes them with a camera feedback.
5
+ Source in `src/pymodaq_plugins_beam_shaping/`. The generic PyMoDAQ guidance is in [AGENTS.md](AGENTS.md) (copied from the plugin template, keep it
6
+ close to the template so that it can be updated); this file is what is specific to this repository.
7
+
8
+ ## Branches and PRs
9
+
10
+ - Target PyMoDAQ is **5.3.x** (`pymodaq>=5.3.2,<5.4`). `5.3.x` is the default and integration branch: branch from it
11
+ (`feature/<topic>`) and open PRs against it. Never push to it directly.
12
+ - A feature in several steps is a stack of PRs: the second PR is based on the branch of the first and is retargeted to
13
+ `5.3.x` once the first is merged (the binary holograms are #82, then the superpixel one in #83).
14
+ - Do not use the word "preset" (obsolete): say *experiment* and *state* (see section 4 of AGENTS.md).
15
+ - The version comes from git tags (`hatch-vcs`); do not edit it. Entry points are generated at build time by
16
+ `hatch_build.py` from the `[features]` flags and the folders.
17
+
18
+ ## Map of the code
19
+
20
+ | Where | What |
21
+ |---|---|
22
+ | `extensions/spatial_beam_shaping.py` | The Dashboard extension (`beam_shaping` script). Hosts the algorithm app, the field loaders, the Shaper actuator and the camera. |
23
+ | `field/field.py` | `Field`: the data class (a `DataRaw` with amplitude and phase, FFT helpers, pixel sizes) passed everywhere. |
24
+ | `field/utils.py`, `field/factory.py` | `FieldLoader` base class and `LoaderFactory`. |
25
+ | `field/loaders/` | The **field loaders**: `from_functions_loader.py` (Gaussian, Laguerre-Gauss, Hermite-Gauss, vortex...), `image_loader.py`, `save_field_loader.py` (h5), `dashboard_loader.py` (from a detector). |
26
+ | `field/field_loader_app.py` | The widget that lets the user choose and parametrize a loader (input field, target field). |
27
+ | `field/field_tool_app.py` | The standalone **Field Tool** (`field_tool` script): loads a Field and applies a chain of operations. |
28
+ | `field/operations/` | Field Tool operations: `base.py` (`FieldOperation`, `OperationFactory`), `linear_phase.py`, `unwrap.py`, `zernike.py`. The numerical helpers they use are in `compute.py` (centered grid, support mask, unwrap, linear phase fit, Zernike fit, wrap...). |
29
+ | `algorithms/algo_base.py` | `AlgoBase`: base of every algorithm (see below). |
30
+ | `algorithms/factory.py` | `AlgorithmFactory`, `register_algorithms()` and the entry point group `pymodaq_plugins_beam_shaping.algorithms` for third party algorithms. |
31
+ | `algorithms/algorithms/` | The **algorithms**, one module per family (see below). |
32
+ | `algorithms/ini_phases/`, `stoppings/`, `loss.py` | Initial phases, stopping criteria and loss functions used by iterative algorithms. |
33
+ | `algorithms/algorithm_app.py` | `AlgoApp`: the widget running an algorithm, owning the masks, the shaper and the fields. |
34
+ | `algorithms/utils.py` | Enums (`AlgoStatus`, `AlgoType`, `ApplyMaskTo`, `LensSetup`). |
35
+ | `utilities/shaper.py` | `Shaper` and `ModulatorType` (phase, amplitude, both), defined in `pymodaq_plugins_utils`; `get_default_shaper()` reads the config. |
36
+ | `utilities/` | Corrections, calibration (`calibrating.py`), `sizing.py` (needed field size), `regions.py`, h5 saving, and `headless_algorithms.py` (see "Testing"). |
37
+ | `daq_move_plugins/`, `daq_viewer_plugins/`, `hardware/` | Mock shaper, mock camera and autofocus instruments used for tests and demos; real shapers live in other packages. |
38
+ | `scanners/calibration.py` | Scan scheme for the SLM calibration. |
39
+ | `models/` | Optimizer / data mixer models (autofocus). |
40
+ | `scripts/` | `algorithm_playground.py` (see "Testing"), SLM calibration scripts. |
41
+ | `resources/` | `config_template.toml` (defaults, incl. `default_shaper`), sample fields. |
42
+
43
+ ## Field loaders
44
+
45
+ A loader derives from `FieldLoader`, sets `LOADER_NAME`, declares its settings in `params`, implements the loading of
46
+ `self.field` and is registered with `@LoaderFactory.register_loader()`. `register_loaders()` imports every module of
47
+ `field/loaders/`, so **adding a loader = adding a file there** (or a class in an existing module); no other
48
+ registration is needed. Parameters of the needed size (pixel counts and sizes) come from the parent app
49
+ (`pixel_width`, `n_pixel_width`...).
50
+
51
+ ## Algorithms
52
+
53
+ - A class derived from `AlgoBase` in a module of `algorithms/algorithms/`, registered with
54
+ `@AlgorithmFactory.register_algorithm()`. Modules are discovered automatically: no import to add elsewhere.
55
+ - Class attributes to set: `ALGO_NAME` (unique, shown in the app), `MODULATOR_TYPES` (default phase only; amplitude
56
+ modulators such as a DMD need `ModulatorType.AMPLITUDE`; an algorithm is only offered when it supports the shaper,
57
+ and a shaper modulating both accepts all), `STATUS` / `STATUS_NOTE` (`AlgoStatus`, written by hand and honest: say
58
+ what was verified and on what), `ITERATIVE`, `INI_PHASE`, `params`.
59
+ - Families: iterative/projection (`projections.py`: Gerchberg-Saxton, Projections), `direct.py`, `diffractive.py`
60
+ (broken, see its status), `checker_board.py`, optimizers on PyTorch (`optim.py`, `minimizer.py`, `torch_base.py`,
61
+ optional `pytorch` extra), and the **amplitude modulation** family for DMDs.
62
+ - Amplitude modulation / binary holograms: on 5.3.x today `dmd_lee.py` (`DMD Lee`) and `super_pixel.py`
63
+ (`SuperPixels`). **PR #82 replaces both by `binary_holograms.py`** (base class `BinaryHologram` with the carrier
64
+ grating `px`, `py` and the carrier removal; `Binary Threshold` phase only, `Parallel Lee` amplitude and phase), and
65
+ PR #83 adds `Superpixel` to it. If those PRs are merged, the module is `binary_holograms.py` and the two old files
66
+ are gone; check which state the branch you are on is in before editing.
67
+ - User documentation of an algorithm: `docs/src/user_guide/algorithm_reference.rst` (reference, overview table),
68
+ `algorithms.rst`, `custom_algorithm.rst` (how to write one, including from another package through the entry
69
+ point group) and `theory.rst`.
70
+
71
+ ## Shapers
72
+
73
+ The extension asks the **Shaper** actuator for its geometry and properties (read only settings groups
74
+ `shaper_geometry` and `shaper_properties`, defined in `pymodaq_plugins_utils.hardware.shaper`). Without such an
75
+ actuator the `default_shaper` section of the config is used. Do not hardcode a shaper size or modulator type.
76
+ Mock instruments for tests: `daq_move_MockShaper`, `daq_2Dviewer_MockShaperCamera`.
77
+
78
+ ## Testing
79
+
80
+ ```bash
81
+ pytest tests/ # whole suite (Qt is needed: tests use the qapp fixture)
82
+ pytest tests/test_algorithms_by_modulator_type.py
83
+ ```
84
+
85
+ - `tests/conftest.py` imports `cv2` first and removes the Qt plugin path variables it sets; keep that.
86
+ - Tests by topic: algorithms (`test_algo_helpers.py`, `test_algorithm_status.py`, `test_algorithms_by_modulator_type.py`,
87
+ `algorithm_entry_points_test.py`, `test_dmd_lee.py` or `test_binary_holograms.py` after #82), fields (`field_test.py`,
88
+ `test_field_tool.py`), shapers and calibration (`test_shaper_interface.py`, `test_calibration.py`), apps
89
+ (`test_custom_apps.py`), package structure (`test_plugin_package_structure.py`).
90
+ - On 5.3.x two tests of `test_shaper_interface.py` already fail; mention it instead of hiding it, and do not
91
+ disable tests.
92
+ - **Script to try an algorithm without the GUI**: `scripts/algorithm_playground.py`, cells delimited by `# %%`, run
93
+ in an IDE or Jupyter. It uses `utilities/headless_algorithms.py` (`list_available`, `make_shaper`, `HeadlessApp`,
94
+ `load_field`, `create_algorithm`, `run_algorithm`, `plot_field`, `plot`...), the same helpers the tests use, and
95
+ calls the algorithm as `AlgoApp` does. Prefer it, and tests built on `headless_algorithms`, to launching the
96
+ Dashboard. It validates the code path only, not the hardware.
97
+
98
+ ## Documentation (Sphinx)
99
+
100
+ - Sources in `docs/src/` (`index.rst`, `theory.rst`, `quick_start.rst`, `user_guide/*.rst`: interface, fields,
101
+ field_tool, algorithms, algorithm_reference, custom_algorithm, shapers, slmsuite, calibration, corrections,
102
+ data_management), bibliography in `docs/src/bibtex.bib`, figures in `docs/src/_images/`.
103
+ - Figures are generated by scripts in `docs/scripts/` (e.g. the binary holograms snapshots after #82); update the
104
+ script and the image together.
105
+ - Build: `pip install -r docs/requirements.txt && make -C docs html` (config in `docs/src/conf.py`, Read the Docs in
106
+ `readthedocs.yml`). A new algorithm, loader or operation needs its doc page entry in the same PR.
107
+ - Write the docs in the voice of the existing pages; cite papers through `bibtex.bib`.
@@ -0,0 +1,3 @@
1
+ # CLAUDE.md
2
+
3
+ Read and follow [AGENTS.md](AGENTS.md) and [AGENTS_BEAM_SHAPING.md](AGENTS_BEAM_SHAPING.md): they hold all the guidance for AI coding assistants working in this repository.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: pymodaq_plugins_beam_shaping
3
- Version: 5.2.0
3
+ Version: 5.3.1
4
4
  Summary: PyMoDAQ's extension plugin to run optical shaping from various shapers (focusing on amplitude and phase shaping) and the image propagation
5
5
  Project-URL: Homepage, https://pymodaq.cnrs.fr
6
6
  Project-URL: Documentation , https://pymodaq.cnrs.fr
@@ -42,11 +42,14 @@ Classifier: Topic :: Scientific/Engineering :: Human Machine Interfaces
42
42
  Classifier: Topic :: Scientific/Engineering :: Visualization
43
43
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
44
44
  Classifier: Topic :: Software Development :: User Interfaces
45
- Requires-Python: >=3.8
45
+ Requires-Python: >=3.10
46
46
  Requires-Dist: opencv-python
47
47
  Requires-Dist: pyfftw
48
- Requires-Dist: pymodaq-gui>5.0.11
49
- Requires-Dist: pymodaq>5.2.8
48
+ Requires-Dist: pymodaq-data<5.4,>=5.3.0
49
+ Requires-Dist: pymodaq-gui<5.4,>=5.3.0
50
+ Requires-Dist: pymodaq-plugins-utils>=5.3.4
51
+ Requires-Dist: pymodaq-utils<5.4,>=5.3.1
52
+ Requires-Dist: pymodaq<5.4,>=5.3.2
50
53
  Requires-Dist: scikit-image
51
54
  Requires-Dist: zernpy
52
55
  Provides-Extra: pytorch
@@ -58,16 +61,16 @@ pymodaq_plugins_optical_2D_shaping
58
61
 
59
62
  .. the following must be adapted to your developped package, links to pypi, github description...
60
63
 
61
- .. image:: https://img.shields.io/pypi/v/pymodaq_plugins_optical_2D_shaping.svg
62
- :target: https://pypi.org/project/pymodaq_plugins_optical_2D_shaping/
64
+ .. image:: https://img.shields.io/pypi/v/pymodaq_plugins_beam_shaping.svg
65
+ :target: https://pypi.org/project/pymodaq_plugins_beam_shaping/
63
66
  :alt: Latest Version
64
67
 
65
68
  .. image:: https://readthedocs.org/projects/pymodaq/badge/?version=latest
66
69
  :target: https://pymodaq.readthedocs.io/en/stable/?badge=latest
67
70
  :alt: Documentation Status
68
71
 
69
- .. image:: https://github.com/PyMoDAQ/pymodaq_plugins_optical_2D_shaping/workflows/Upload%20Python%20Package/badge.svg
70
- :target: https://github.com/PyMoDAQ/pymodaq_plugins_optical_2D_shaping
72
+ .. image:: https://github.com/PyMoDAQ/pymodaq_plugins_beam_shaping/workflows/Upload%20Python%20Package/badge.svg
73
+ :target: https://github.com/PyMoDAQ/pymodaq_plugins_beam_shaping
71
74
  :alt: Publication Status
72
75
 
73
76
  PyMoDAQ's extension plugin to run optical shaping amplitude and/or phase algorithms and propagation algorithms
@@ -3,16 +3,16 @@ pymodaq_plugins_optical_2D_shaping
3
3
 
4
4
  .. the following must be adapted to your developped package, links to pypi, github description...
5
5
 
6
- .. image:: https://img.shields.io/pypi/v/pymodaq_plugins_optical_2D_shaping.svg
7
- :target: https://pypi.org/project/pymodaq_plugins_optical_2D_shaping/
6
+ .. image:: https://img.shields.io/pypi/v/pymodaq_plugins_beam_shaping.svg
7
+ :target: https://pypi.org/project/pymodaq_plugins_beam_shaping/
8
8
  :alt: Latest Version
9
9
 
10
10
  .. image:: https://readthedocs.org/projects/pymodaq/badge/?version=latest
11
11
  :target: https://pymodaq.readthedocs.io/en/stable/?badge=latest
12
12
  :alt: Documentation Status
13
13
 
14
- .. image:: https://github.com/PyMoDAQ/pymodaq_plugins_optical_2D_shaping/workflows/Upload%20Python%20Package/badge.svg
15
- :target: https://github.com/PyMoDAQ/pymodaq_plugins_optical_2D_shaping
14
+ .. image:: https://github.com/PyMoDAQ/pymodaq_plugins_beam_shaping/workflows/Upload%20Python%20Package/badge.svg
15
+ :target: https://github.com/PyMoDAQ/pymodaq_plugins_beam_shaping
16
16
  :alt: Publication Status
17
17
 
18
18
  PyMoDAQ's extension plugin to run optical shaping amplitude and/or phase algorithms and propagation algorithms
@@ -0,0 +1,90 @@
1
+ """Makes the figure of the binary holograms of the documentation (docs/src/_images/binary_holograms.png)
2
+
3
+ The same target (the default *ImageFiles* loader: its image as amplitude and its associated phase) is computed with
4
+ each algorithm of the family (Binary Threshold, Parallel Lee, Superpixel), with the helpers of the script
5
+ ``scripts/algorithm_playground.py``, and the part of the pattern sent to the modulator is shown. Run it with
6
+ ``python binary_holograms_snapshots.py`` (the figure is written next to the other images of the documentation).
7
+ """
8
+ from pathlib import Path
9
+
10
+ import matplotlib
11
+ matplotlib.use('Agg')
12
+ from matplotlib import pyplot as plt
13
+ import numpy as np
14
+
15
+ from pymodaq_plugins_beam_shaping.algorithms.utils import ApplyMaskTo, AlgoType
16
+ from pymodaq_plugins_beam_shaping.utilities import headless_algorithms as pg, regions
17
+
18
+ OUTPUT = Path(__file__).parent.parent / 'src' / '_images' / 'binary_holograms.png'
19
+ ALGORITHMS = ('Binary Threshold', 'Parallel Lee', 'Superpixel')
20
+ # the periods of the grating, in pixels: wide for the amplitude levels of Parallel Lee, the superpixels are 4 x 4
21
+ PARAMS = {'Binary Threshold': {'px': 8, 'py': 64}, 'Parallel Lee': {'px': 8, 'py': 64}, 'Superpixel': {'px': 4}}
22
+ MASK_HALF_SIZE = 150. # um, half size of the elliptical mask of the intermediate plane around the selected order
23
+
24
+ pg.ensure_qapp()
25
+ app = pg.HeadlessApp(pg.make_shaper(modulator_type='amplitude'))
26
+ input_field = pg.load_field('GaussianIntensity', None, app)
27
+ target_field = pg.load_field('ImageFiles', None, app) # the default image and its associated phase
28
+
29
+ results = {}
30
+ for name in ALGORITHMS:
31
+ algo = pg.create_algorithm(pg.reload_algorithm(name), app, PARAMS[name])
32
+ pg.set_fields(algo, input_field, target_field)
33
+ # the order to filter, as given by the algorithm, in um from the center of the intermediate plane
34
+ y, x = np.array(algo.order_frequency()) * regions.pixel_sizes_in_um(algo.intermediate_pixel_sizes)
35
+ mask = ((y - MASK_HALF_SIZE, y + MASK_HALF_SIZE), (x - MASK_HALF_SIZE, x + MASK_HALF_SIZE))
36
+ pg.set_mask(app, ApplyMaskTo.INTERMEDIATE, mask, 'elliptical')
37
+ pg.run_algorithm(algo)
38
+ output = algo.output_field
39
+ results[name] = (output.amplitude, output.phase, algo.modulator_field.amplitude, algo.ALGOTYPE)
40
+ reference = pg.get_target_field(algo).amplitude # the same for both
41
+ reference_phase = pg.get_target_field(algo).phase
42
+ pixel_size = output.pixels_sizes[1].m_as('um')
43
+
44
+
45
+ def correlation(a, b):
46
+ a, b = a - a.mean(), b - b.mean()
47
+ return float((a * b).sum() / np.sqrt((a * a).sum() * (b * b).sum()))
48
+
49
+
50
+ # the region of the output plane holding the target, with some margin
51
+ rows, columns = np.nonzero(reference > 0.05 * reference.max())
52
+ margin = 30
53
+ window = (slice(max(rows.min() - margin, 0), rows.max() + margin), slice(max(columns.min() - margin, 0),
54
+ columns.max() + margin))
55
+ target_region = (slice(rows.min(), rows.max()), slice(columns.min(), columns.max()))
56
+ ny, nx = reference.shape
57
+ extent = np.array([window[1].start - nx / 2, window[1].stop - nx / 2,
58
+ window[0].start - ny / 2, window[0].stop - ny / 2]) * pixel_size / 1000 # mm
59
+
60
+ figure, axes = plt.subplots(len(ALGORITHMS), 3, figsize=(11, 3.3 * len(ALGORITHMS)), constrained_layout=True)
61
+ for row, name in enumerate(ALGORITHMS):
62
+ amplitude, phase, pattern, algotype = results[name]
63
+ amplitude = amplitude / amplitude[window].max()
64
+ axes[row, 0].imshow(amplitude[window], extent=extent, origin='lower', cmap='viridis', vmin=0, vmax=1)
65
+ if algotype == AlgoType.PHASE: # the amplitude of the target is not encoded
66
+ axes[row, 0].set_title(f'{name}\nAmplitude (phase only: the amplitude of the target is not encoded)',
67
+ fontsize=9)
68
+ else:
69
+ axes[row, 0].set_title(f'{name}\nAmplitude (correlation with the target image: '
70
+ f'{correlation(results[name][0][target_region], reference[target_region]):.2f})',
71
+ fontsize=9)
72
+ shown_phase = np.where(amplitude > 0.1, phase, np.nan) # the phase only where there is light
73
+ image = axes[row, 1].imshow(shown_phase[window], extent=extent, origin='lower', cmap='twilight', vmin=-np.pi,
74
+ vmax=np.pi)
75
+ axes[row, 1].set_title('Phase (where the amplitude is above 10 %)', fontsize=9)
76
+ centre = np.array(pattern.shape) // 2
77
+ zoom = (slice(centre[0], centre[0] + 40), slice(centre[1], centre[1] + 40))
78
+ axes[row, 2].imshow(pattern[zoom], cmap='gray', vmin=0, vmax=1, interpolation='nearest', origin='lower')
79
+ axes[row, 2].set_title('Pattern on the modulator (40 x 40 pixels)', fontsize=9)
80
+ for ax in axes[row, :2]:
81
+ ax.set_xlabel('mm')
82
+ ax.set_ylabel('mm')
83
+ axes[row, 2].axis('off')
84
+ figure.colorbar(image, ax=axes[:, 1], label='rad', shrink=0.6, pad=0.02)
85
+ figure.savefig(OUTPUT, dpi=110)
86
+ print(f'written: {OUTPUT}')
87
+ for name in ALGORITHMS:
88
+ if results[name][3] != AlgoType.PHASE:
89
+ print(f'{name}: correlation of the amplitude with the target image = '
90
+ f'{correlation(results[name][0][target_region], reference[target_region]):.3f}')
@@ -0,0 +1,61 @@
1
+ /* Let the page content use the whole browser width instead of the
2
+ theme's fixed 800px column. */
3
+ .wy-nav-content {
4
+ max-width: none;
5
+ }
6
+
7
+ /* Table cells wrap their text instead of pushing the table out of the page. */
8
+ .rst-content table.docutils td,
9
+ .rst-content table.docutils th,
10
+ .wy-table-responsive table td,
11
+ .wy-table-responsive table th {
12
+ white-space: normal;
13
+ }
14
+
15
+ /* Button showing/hiding the navigation sidebar (see sidebar_toggle.js). */
16
+ .pmq-sidebar-toggle {
17
+ position: fixed;
18
+ top: 8px;
19
+ left: 308px;
20
+ z-index: 300;
21
+ width: 32px;
22
+ height: 32px;
23
+ padding: 0;
24
+ border: 1px solid #c9c9c9;
25
+ border-radius: 4px;
26
+ background: #fcfcfc;
27
+ color: #404040;
28
+ font-size: 18px;
29
+ line-height: 30px;
30
+ text-align: center;
31
+ cursor: pointer;
32
+ opacity: 0.8;
33
+ }
34
+ .pmq-sidebar-toggle:hover {
35
+ opacity: 1;
36
+ background: #e7f2fa;
37
+ }
38
+
39
+ body.pmq-sidebar-hidden .wy-nav-side {
40
+ display: none;
41
+ }
42
+ body.pmq-sidebar-hidden .wy-nav-content-wrap {
43
+ margin-left: 0;
44
+ }
45
+ body.pmq-sidebar-hidden .pmq-sidebar-toggle {
46
+ left: 8px;
47
+ }
48
+
49
+ /* On small screens the theme already has its own menu button. */
50
+ @media screen and (max-width: 768px) {
51
+ .pmq-sidebar-toggle {
52
+ display: none;
53
+ }
54
+ }
55
+
56
+ /* Keep the breadcrumbs clear of the toggle button. */
57
+ @media screen and (min-width: 769px) {
58
+ .wy-breadcrumbs {
59
+ padding-left: 36px;
60
+ }
61
+ }
@@ -0,0 +1,11 @@
1
+ .rst-content img {
2
+ max-width: none !important;
3
+ height: auto;
4
+ }
5
+ .wy-table-responsive {
6
+ overflow: visible;
7
+ }
8
+
9
+ .dataTables_wrapper {
10
+ overflow: auto;
11
+ }
@@ -0,0 +1,44 @@
1
+ // Adds a button to show/hide the navigation sidebar of the Read the Docs theme.
2
+ // The choice is remembered between pages.
3
+ (function () {
4
+ var KEY = "beamshaping-docs-sidebar-hidden";
5
+
6
+ function stored() {
7
+ try {
8
+ return window.localStorage.getItem(KEY) === "1";
9
+ } catch (e) {
10
+ return false;
11
+ }
12
+ }
13
+
14
+ function store(hidden) {
15
+ try {
16
+ window.localStorage.setItem(KEY, hidden ? "1" : "0");
17
+ } catch (e) {
18
+ // storage unavailable: the choice only lasts for this page
19
+ }
20
+ }
21
+
22
+ document.addEventListener("DOMContentLoaded", function () {
23
+ var button = document.createElement("button");
24
+ button.type = "button";
25
+ button.className = "pmq-sidebar-toggle";
26
+
27
+ function apply(hidden) {
28
+ document.body.classList.toggle("pmq-sidebar-hidden", hidden);
29
+ button.innerHTML = hidden ? "&#9776;" : "&laquo;";
30
+ button.title = hidden ? "Show the navigation sidebar" : "Hide the navigation sidebar";
31
+ button.setAttribute("aria-label", button.title);
32
+ button.setAttribute("aria-expanded", hidden ? "false" : "true");
33
+ }
34
+
35
+ button.addEventListener("click", function () {
36
+ var hidden = !document.body.classList.contains("pmq-sidebar-hidden");
37
+ apply(hidden);
38
+ store(hidden);
39
+ });
40
+
41
+ apply(stored());
42
+ document.body.appendChild(button);
43
+ });
44
+ })();
@@ -41,7 +41,7 @@ Main Sources
41
41
  - `GitHub: pymodaq_plugins_beam_shaping <https://github.com/PyMoDAQ/pymodaq_plugins_beam_shaping>`_
42
42
  * - **Scientific Article**
43
43
  - Full manuscript (PDF/LaTeX) provided by the authors (Rollo, Arbouet, Weber)
44
- - `To be cited <>`_
44
+ - To be cited
45
45
  * - **PyMoDAQ Documentation**
46
46
  - Official guide for extensions and documentation style
47
47
  - `pymodaq.cnrs.fr <https://pymodaq.cnrs.fr/en/latest/>`_
@@ -54,10 +54,10 @@ Main Sources
54
54
 
55
55
 
56
56
  Tools Used
57
- ---------
57
+ ----------
58
58
  - **Sphinx** (with ``sphinx-rtd-theme``) for documentation generation.
59
59
  - **reStructuredText** (``.rst``) for writing.
60
- - **LaTeX** for mathematical equations (integrated via ``sphinx.ext.imgmath``).
60
+ - **LaTeX** syntax for mathematical equations (rendered in the browser by MathJax via ``sphinx.ext.mathjax``).
61
61
  - **HDF5** for describing the structure of ``.h5beam`` files.
62
62
 
63
63
 
@@ -208,6 +208,7 @@
208
208
  year = {1972},
209
209
  pages = {237},
210
210
  volume = {35},
211
+ url = {https://web.archive.org/web/20160328053000/http://www.u.arizona.edu/~ppoon/GerchbergandSaxton1972.pdf},
211
212
  abstract = {An algorithm is presented for the rapid solution of the phase of the complete wave function whose intensity in the diffraction and imaging planes of an imaging system are known. A proof is given showing that a defined error between the estimated function and the correct function must decrease as the algorithm iterates. The problem of uniqueness is discussed and results are presented demonstrating the power of the method.},
212
213
  groups = {pulse shaping},
213
214
  }
@@ -639,4 +640,49 @@ year = {2013},
639
640
  url = {https://opg.optica.org/ao/abstract.cfm?URI=ao-52-1-1},
640
641
  doi = {10.1364/AO.52.000001},
641
642
  abstract = {The addition of electronics, computers, and software to interferometry has enabled enormous improvements in optical metrology. This paper discusses four areas in which computerized interferometric measurement improvements have been made in the measurement of surface shape and surface roughness: (a)\&\#xA0;The use of computer-generated holograms for the testing of aspheric optics, (b)\&\#xA0;phase-shifting interferometry for getting interferometric data into a computer so the data can be analyzed, (c)\&\#xA0;computerized interference microscopes, including multiple-wavelength and coherence scanning, for the precision measurement of surface microstructure, and (d)\&\#xA0;vibration-insensitive dynamic interferometers for enabling precise measurements in noncontrolled environments.},
642
- }
643
+ }
644
+
645
+ @article{gutierrez-cuevas_binary_2024,
646
+ title = {Binary holograms for shaping light with digital micromirror devices},
647
+ journal = {Journal of Physics: Photonics},
648
+ author = {Guti\'errez-Cuevas, R. and Popoff, S. M.},
649
+ volume = {6},
650
+ number = {4},
651
+ pages = {045022},
652
+ year = {2024},
653
+ url = {https://arxiv.org/abs/2311.16685},
654
+ note = {arXiv:2311.16685},
655
+ }
656
+
657
+ @article{lee_binary_1974,
658
+ title = {Binary {Synthetic} {Holograms}},
659
+ journal = {Applied Optics},
660
+ author = {Lee, Wai-Hon},
661
+ volume = {13},
662
+ number = {7},
663
+ pages = {1677--1682},
664
+ year = {1974},
665
+ doi = {10.1364/AO.13.001677},
666
+ }
667
+
668
+ @article{brown_complex_1966,
669
+ title = {Complex {Spatial} {Filtering} with {Binary} {Masks}},
670
+ journal = {Applied Optics},
671
+ author = {Brown, B. R. and Lohmann, A. W.},
672
+ volume = {5},
673
+ number = {6},
674
+ pages = {967--974},
675
+ year = {1966},
676
+ doi = {10.1364/AO.5.000967},
677
+ }
678
+
679
+ @article{bryngdahl_interferograms_1968,
680
+ title = {Interferograms are {Image} {Holograms}},
681
+ journal = {Journal of the Optical Society of America},
682
+ author = {Bryngdahl, O. and Lohmann, A. W.},
683
+ volume = {58},
684
+ number = {1},
685
+ pages = {141--142},
686
+ year = {1968},
687
+ doi = {10.1364/JOSA.58.000141},
688
+ }
@@ -33,7 +33,7 @@ extensions = [
33
33
  "sphinx_autodoc_typehints",
34
34
  'sphinx.ext.doctest',
35
35
  'sphinx.ext.coverage',
36
- 'sphinx.ext.imgmath',
36
+ 'sphinx.ext.mathjax', # equations rendered in the browser, no LaTeX needed on the build machine (Read the Docs)
37
37
  'sphinx.ext.githubpages',
38
38
  'sphinx.ext.autosummary',
39
39
  'releases',
@@ -53,19 +53,9 @@ numfig_format = {
53
53
  'section': 'Section %s',
54
54
  }
55
55
 
56
- html_css_files = [
57
- 'https://fonts.googleapis.com/icon?family=Material+Icons',
58
- 'css/custom.css', # Pour styliser les icônes
59
- ]
60
-
61
56
  bibtex_bibfiles = ['bibtex.bib'] # Chemin relatif à docs/
62
57
  bibtex_reference_style = 'author_year' # Style de citation (ex: "Weber 2021")
63
58
 
64
- # Configuration pour imgmath (équations LaTeX)
65
- imgmath_image_format = 'png' # ou 'svg'
66
- imgmath_font_size = 14
67
- imgmath_dpi = 150
68
-
69
59
  # -- Options for autodocumentation ---------------------------------------------
70
60
  autodoc_member_order = "groupwise"
71
61
  autoclass_content = "class"
@@ -120,7 +110,12 @@ html_theme_options = {
120
110
  }
121
111
 
122
112
  html_css_files = [
113
+ 'https://fonts.googleapis.com/icon?family=Material+Icons',
123
114
  'css/overflow.css',
115
+ 'css/layout.css', # full-width content, tables kept within it
116
+ ]
117
+ html_js_files = [
118
+ 'js/sidebar_toggle.js', # button to hide the navigation sidebar
124
119
  ]
125
120
 
126
121
  html_static_path = ["_static", "_images"] # NOUVEAU: Ajout de "_images"
@@ -134,6 +129,10 @@ datatables_options = {
134
129
  'paging': True,
135
130
  }
136
131
 
132
+ # -- Options for rediraffe -----------------------------------------------------
133
+ # Redirections of the pages that are renamed or removed, one "old_page new_page" per line (without the extension)
134
+ rediraffe_redirects = 'redirects.txt'
135
+
137
136
  # -- Options for intersphinx ---------------------------------------------------
138
137
  intersphinx_mapping = {
139
138
  'python': ('https://docs.python.org/3', None),
@@ -37,6 +37,7 @@ Applications
37
37
  - Wavefront correction (aberration compensation).
38
38
 
39
39
  .. _FIG-schema:
40
+
40
41
  .. figure:: /_images/layout.png
41
42
  :alt: General Beam-Shaping Problem
42
43
  :width: 90%
@@ -7,7 +7,7 @@ Quick Start
7
7
  :alt: Save
8
8
  :align: middle
9
9
 
10
- .. |file_open| image:: /_static/icons/folder_open.png
10
+ .. |file_open| image:: /_static/icons/file_open.png
11
11
  :height: 20pt
12
12
  :alt: Load
13
13
  :align: middle
@@ -22,7 +22,7 @@ Quick Start
22
22
  :alt: Input
23
23
  :align: middle
24
24
 
25
- .. |deblur| image:: /_static/icons/tune.png
25
+ .. |deblur| image:: /_static/icons/deblur.png
26
26
  :height: 20pt
27
27
  :alt: Corrections
28
28
  :align: middle
@@ -128,6 +128,7 @@ Follow these steps to perform your first beam shaping:
128
128
  For more details on the interface, see :numref:`FIG-quick-start`.
129
129
 
130
130
  .. _FIG-quick-start:
131
+
131
132
  .. figure:: /_images/main_app.png
132
133
  :alt: BeamShaping User Interface
133
134
  :width: 100%
@@ -0,0 +1 @@
1
+ # "old_page new_page" for each page that is renamed or removed (paths relative to docs/src, without extension)
@@ -0,0 +1,22 @@
1
+ References
2
+ ==========
3
+
4
+ PyMoDAQ Documentation
5
+ ---------------------
6
+ - To cite PyMoDAQ: :cite:p:`Weber2021`
7
+ - `PyMoDAQ Official Documentation <https://pymodaq.cnrs.fr/en/latest/>`_
8
+ - `Extension Plugins Guide <https://pymodaq.cnrs.fr/en/latest/developer_folder/extension_plugins.html>`_
9
+ - `Plugin Template Repository <https://github.com/PyMoDAQ/pymodaq_plugins_template>`_
10
+
11
+ Beam Shaping Literature
12
+ -----------------------
13
+ The articles cited in this documentation:
14
+
15
+ .. bibliography::
16
+ :cited:
17
+ :style: plain
18
+
19
+ Plugin Repository
20
+ -----------------
21
+ - `PyMoDAQ-BeamShaping GitHub <https://github.com/PyMoDAQ/pymodaq_plugins_beam_shaping>`_
22
+