slmsuite.holography.toolbox.convert_blaze_vector

convert_blaze_vector(vector, from_units='norm', to_units='norm', slm=None, shape=None)[source]

Helper function for vector unit conversions.

Currently supported units:

"norm", "kxy" Blaze \(k_x\) normalized to wavenumber \(k\), i.e. \(\frac{k_x}{k}\). Equivalent to radians in the small angle approximation. This is the default unit for slmsuite. "knm" Computational blaze units for a given Fourier domain shape. This corresponds to integer points on the grid of this (potentially padded) SLM’s Fourier transform. See Hologram.

The "knm" basis is centered at shape/2, unlike all of the other units.

"ij" Camera pixel units. "freq" Pixel frequency of a grating producing the blaze. e.g. 1/16 is a grating with a period of 16 pixels. "lpmm" Line pairs per mm or lines per mm of a grating producing the blaze. "rad", "mrad", "deg" Angle at which light is blazed in various units. Small angle approximation is assumed.

Warning

The units "freq", "knm", and "lpmm" depend on SLM pixel size, so a slm should be passed (otherwise returns an array of nan values). The unit "ij", camera pixels, requires calibration data stored in a CameraSLM, so this must be passed in place of slm. The unit "knm" additionally requires the shape of the computational space. If not included when an slm is passed, shape=slm.shape is assumed.

Parameters
  • vector (array_like) – 2-vectors for which we want to convert units, from from_units to to_units. Processed according to format_2vectors().

  • from_units (str) – Units which we are converting between. See the listed units above for options. Defaults to "norm".

  • to_units (str) – Units which we are converting between. See the listed units above for options. Defaults to "norm".

  • slm (SLM OR CameraSLM OR None) – Relevant SLM to pull data from in the case of "freq", "knm", or "lpmm". If CameraSLM, the unit "ij" can be processed too.

  • shape ((int, int) OR None) – Shape of the computational SLM space. Defaults to slm.shape if slm is not None.

Returns

Result of the unit conversion, in the cleaned format of format_2vectors().

Return type

numpy.ndarray