hologradpy.hardware =================== .. py:module:: hologradpy.hardware .. autoapi-nested-parse:: This module provides to interface with the camera and the SLM. Classes ------- .. autoapisummary:: hologradpy.hardware.ParamsBase hologradpy.hardware.CameraBase hologradpy.hardware.SlmBase Functions --------- .. autoapisummary:: hologradpy.hardware.get_image_avg Module Contents --------------- .. py:class:: ParamsBase Bases: :py:obj:`abc.ABC` Class storing experimental parameters and constant properties. .. py:property:: wavelength :abstractmethod: Wavelength [m]. .. py:property:: k Wavenumber [rad/m]. .. py:property:: beam_diameter :abstractmethod: Diameter of incident Gaussian beam [m]. .. py:property:: fl :abstractmethod: Focal length [m]. .. py:attribute:: n1 :value: 1.59847 .. py:attribute:: n2 :value: 1.76182 .. py:attribute:: r1 :value: 0.1377 .. py:attribute:: r2 :value: -0.1377 .. py:attribute:: r3 :value: -0.9304 .. py:attribute:: lens_aperture :value: 0.0483 .. py:property:: phi_path :abstractmethod: .. py:property:: i_path :abstractmethod: .. py:property:: data_path :abstractmethod: Path to store data. .. py:attribute:: crop :value: 32 .. py:attribute:: phi_filter_size :value: 5 .. py:attribute:: i_filter_size :value: 3 .. py:class:: CameraBase(res, pitch, roi) Bases: :py:obj:`abc.ABC` Helper class that provides a standard way to create an ABC using inheritance. .. py:attribute:: res .. py:attribute:: pitch .. py:attribute:: roi .. py:property:: cam_size Calculates the physical size of the camera. :return: x, y dimensions of the camera [m]. .. py:method:: start(n=1) :abstractmethod: You have to implement this yourself. Starts the acquisition. :param n: Number of frames to be captured. .. py:method:: get_image(exp_time) :abstractmethod: You have to implement this yourself. Acquires and returns a camera image of the shape determined by ``self.roi``. :param exp_time: Exposure time. :return: Camera image of shape as defined by ``self.roi`` .. py:method:: stop() :abstractmethod: You have to implement this yourself. Stops the acquisition. .. py:function:: get_image_avg(cam_obj, exp_time, n_avg) This function captures multiple camera images and calculates the average. :param cam_obj: Instance of your own camera class which is a subclass of ``CameraBase``. :param exp_time: Exposure time. :param n_avg: Number of frames to be averaged. :return: Averaged image. .. py:class:: SlmBase(res, pitch) Bases: :py:obj:`abc.ABC` Helper class that provides a standard way to create an ABC using inheritance. .. py:attribute:: res .. py:attribute:: pitch .. py:property:: slm_size Calculates the physical size of the SLM. :return: x, y dimensions of the SLM [m]. .. py:property:: meshgrid_slm Calculates an x, y meshgrid using the pixel pitch and the native resolution of the SLM. :return: x, y meshgrid [m]. .. py:method:: display(phi) :abstractmethod: This function displays a phase pattern on the SLM. You have to implement this yourself. :param phi: SLM phase pattern [radians]. :return: