hologradpy.calibrate_slm

Module to measure the constant amplitude and phase at the SLM.

Functions

find_camera_position(slm_disp_obj, cam_obj, pms_obj, ...)

This function generates a spot on the camera by displaying a circular aperture on the SLM containing a linear phase

get_aperture_indices(nx, ny, x_start, x_stop, y_start, ...)

This function calculates a grid of nx * ny rectangular regions in an array and returns the start and end indices

measure_slm_intensity(slm_disp_obj, cam_obj, pms_obj, ...)

This function measures the intensity profile of the laser beam incident onto the SLM by displaying a sequence of

measure_slm_wavefront(slm_disp_obj, cam_obj, pms_obj, ...)

This function measures the constant phase at the SLM by displaying a sequence of rectangular phase masks on the SLM.

Module Contents

hologradpy.calibrate_slm.find_camera_position(slm_disp_obj, cam_obj, pms_obj, lin_phase, exp_time=100, aperture_diameter=25, roi=[500, 500])

This function generates a spot on the camera by displaying a circular aperture on the SLM containing a linear phase gradient. The position of the spot is found by fitting a Gaussian to the camera image.

Parameters:
  • slm_disp_obj – Instance of your own subclass of hardware.SlmBase

  • cam_obj

  • pms_obj

  • npix – Number of used SLM pixels

  • lin_phase – x and y gradient of the linear phase

  • cam_name – Name of the camera to be used

  • exp_time – Exposure time

  • aperture_diameter – Diameter of the circular aperture

  • roi – Width and height of the region of interest on the camera to remove the zeroth-order diffraction spot

Returns:

x and y coordinates of the spot on the camera

hologradpy.calibrate_slm.get_aperture_indices(nx, ny, x_start, x_stop, y_start, y_stop, aperture_width, aperture_height)

This function calculates a grid of nx * ny rectangular regions in an array and returns the start and end indices of each region. All units are in pixels.

Parameters:
  • nx – Number of rectangles along x.

  • ny – Number of rectangles along y.

  • x_start – Start index for first rectangle along x.

  • x_stop – End index for last rectangle along x.

  • y_start – Start index for first rectangle along y.

  • y_stop – End index for last rectangle along y.

  • aperture_width – Width of rectangle.

  • aperture_height – Height of rectangle.

Returns:

List with four entries for the start and end index along x and y: [idx_start_y, idx_end_y, idx_start_x, idx_end_x]. Each list entry is a vector of length nx * ny containing the start/end index for each rectangle along x/y.

hologradpy.calibrate_slm.measure_slm_intensity(slm_disp_obj, cam_obj, pms_obj, aperture_number, aperture_width, exp_time, spot_pos, roi_width)

This function measures the intensity profile of the laser beam incident onto the SLM by displaying a sequence of rectangular phase masks on the SLM. The phase mask contains a linear phase which creates a diffraction spot on the camera. The position of the phase mask is varied across the entire area of the SLM and the intensity of each diffraction spot is measured using the camera. Read the SI of https://doi.org/10.1038/s41598-023-30296-6 for details.

Parameters:
  • slm_disp_obj – Instance of your own subclass of hardware.SlmBase.

  • cam_obj – Instance of your own subclass of hardware.CameraBase.

  • aperture_number – Number of square regions along x/ y.

  • aperture_width – Width of square regions [px].

  • exp_time – Exposure time.

  • spot_pos – x/y position of the diffraction spot in th computational Fourier plane [Fourier pixels].

  • roi_width – Width of the region of interest on the camera [camera pixels].

Returns:

hologradpy.calibrate_slm.measure_slm_wavefront(slm_disp_obj, cam_obj, pms_obj, aperture_number, aperture_width, img_size, exp_time, spot_pos, n_avg_frames=10, benchmark=False, phi_load_path=None, roi_min_x=16, roi_min_y=16, roi_n=8)

This function measures the constant phase at the SLM by displaying a sequence of rectangular phase masks on the SLM. This scheme was adapted from this Phillip Zupancic’s work (https://doi.org/10.1364/OE.24.013881). For details of our implementation, read the SI of https://doi.org/10.1038/s41598-023-30296-6.

Parameters:
  • slm_disp_obj – Instance of your own subclass of hardware.SlmBase.

  • cam_obj – Instance of your own subclass of hardware.CameraBase.

  • pms_obj – Instance of your own subclass of hardware.Parameters.

  • aperture_number – Number of square regions along x/ y.

  • aperture_width – Width of square regions [px].

  • img_size – Width of the roi in the camera image [camera pixels].

  • exp_time – Exposure time.

  • spot_pos – x/y position of the diffraction spot in th computational Fourier plane [Fourier pixels].

  • n_avg_frames – Number of camera frames to average per shot.

  • benchmark (bool) – Load previously measured constant phase and display it on the SLM to check for flatness.

  • phi_load_path – Path to previously measured constant phase.

  • roi_min_x – Aperture column number to display the first phase mask.

  • roi_min_y – Aperture row number to display the first phase mask.

  • roi_n – Number of apertures to display (roi_n * roi_n), starting at roi_min_x, roi_min_y.

Returns:

Path to measured constant phase at the SLM.