Skip to content

Commit

Permalink
Save slices, refactor, update parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
dedean16 committed Nov 22, 2024
1 parent 66e3ae1 commit d45b33d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions examples/calibration_demo_experimental.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,21 @@
from openwfs.simulation import Camera as MockCam


repetitions = 5 # How often to run the experiment (for e.g. error bars)
repetitions = 10 # How often to run the experiment (for e.g. error bars)

# This script shows how a wavefront shaping experiment can be performed from Python
cam = Camera(R"C:\Program Files\Basler\pylon 6\Runtime\x64\ProducerU3V.cti")
cam.exposure_time = 90 * u.ms


# constructs the actual slm for wavefront shaping, and a monitor window to display the current phase pattern
slm = SLM(2)
monitor = slm.clone(monitor_id=0, pos=(0, 0), shape=(slm.shape[0] // 4, slm.shape[1] // 4))

# Define cropping area for modulated and reference fringes
s = cam.data_shape
modulated_slices = (slice(None), slice(s[0] // 6, s[0] // 3))
reference_slices = (slice(None), slice(-s[0] // 3, -s[0] // 6))

calibrator = FringeAnalysisSLMCalibrator(
camera=cam, slm=slm, modulated_slices=modulated_slices, reference_slices=reference_slices
)
Expand All @@ -35,8 +36,10 @@
field, gray_values, frames = calibrator.execute()

np.savez(
f'C:/LocalData/twymann-green-slm-calibration-r{r}.npz',
f'C:/LocalData/tg-fringe-slm-calibration-r{r}.npz',
frames=frames,
field=field,
gray_values=gray_values,
modulated_slices=modulated_slices,
reference_slices=reference_slices,
)

0 comments on commit d45b33d

Please sign in to comment.