pado.optical_element.SLM¶
- class SLM(dim, pitch, wvl, device, polar='non')[source]¶
-
- __init__(dim, pitch, wvl, device, polar='non')[source]¶
Spatial Light Modulator (SLM) optical element.
- Parameters:
Examples
>>> slm = SLM(dim=(1,1,1024,1024), pitch=6.4e-6, wvl=633e-9, device='cuda:0')
- set_lens(focal_length, shift_x=0, shift_y=0)[source]¶
Set phase profile to implement a thin lens.
- Parameters:
- Return type:
Examples
>>> slm.set_lens(focal_length=0.5, shift_x=100e-6) # 500mm focal length, 100μm x-shift
- set_amplitude_change(amplitude, wvl)[source]¶
Set amplitude modulation profile of the SLM.
- Parameters:
amplitude (torch.Tensor) – Amplitude modulation profile [B, 1, R, C]
wvl (float) – Operating wavelength in meters
- Return type:
Examples
>>> amp = torch.ones((1,1,1024,1024)) * 0.8 # 80% transmission >>> slm.set_amplitude_change(amp, wvl=633e-9)
- set_phase_change(phase_change, wvl)[source]¶
Set phase modulation profile of the SLM.
- Parameters:
phase_change (torch.Tensor) – Phase modulation profile [B, 1, R, C] in radians
wvl (float) – Operating wavelength in meters
- Return type:
Examples
>>> phase = torch.ones((1,1,1024,1024)) * np.pi # π phase shift >>> slm.set_phase_change(phase, wvl=633e-9)