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 forslmsuite
."knm"
Computational blaze units for a given Fourier domainshape
. This corresponds to integer points on the grid of this (potentially padded) SLM’s Fourier transform. SeeHologram
.The
"knm"
basis is centered atshape/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 aslm
should be passed (otherwise returns an array ofnan
values). The unit"ij"
, camera pixels, requires calibration data stored in a CameraSLM, so this must be passed in place ofslm
. The unit"knm"
additionally requires theshape
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
toto_units
. Processed according toformat_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
ORCameraSLM
OR None) – Relevant SLM to pull data from in the case of"freq"
,"knm"
, or"lpmm"
. IfCameraSLM
, the unit"ij"
can be processed too.shape ((int, int) OR None) – Shape of the computational SLM space. Defaults to
slm.shape
ifslm
is notNone
.
- Returns
Result of the unit conversion, in the cleaned format of
format_2vectors()
.- Return type
numpy.ndarray