API Reference#
This page provides an auto-generated summary of slmsuite’s API. You can
find the source on GitHub.
slmsuite is divided into two modules:
algorithms and analysis in holography and
connectivity to physical devices via hardware.
Holography#
As a core functionality, slmsuite optimizes nearfield phase profiles
(applied to slms) to produce desired farfield results
(measured by cameras). These methods are provided in:
GPU-accelerated holography algorithms. |
Additionally, quality-of-life support methods are provided, divided into SLM- and camera- centric categories:
Hardware#
A central concept of slmsuite is experimental holography.
Thus, we require interfaces to control the hardware used in experiment.
While some common hardware implementions are included, we welcome
contributions
to expand the scope and utility of the package!
Hardware is divided into two main categories:
The phase displays used to produce holograms. |
|
The sensor arrays used to measure results. |
The unification of these two categories is stored in:
Datastructures, methods, and calibrations for an SLM monitored by a camera. |
API Formalism#
Data-Order Conventions#
slmsuite follows the shape = (h, w) and vector = (x, y) formalism adopted by
the numpy ecosystem. numpy, scipy, matplotlib, etc generally follow this
formalism. The shape and indexing of an array or image always uses the inverted (h, w) form,
but other functions such as numpy.meshgrid(x, y) (default), scipy.odr.Data(x, y), or
matplotlib.pyplot.scatter(x, y) use the standard cartesian (x, y) form that is more familiar
to users. This is not ideal and causes confusion, but this is the formalism generally
adopted by the community.
We additionally adopt the convention that
a list of \(N\) vectors with dimension \(D\) is represented with shape
(D, N). This is so that linear transformations can be done with a direct and easy
multiplication with a (D, D) matrix.
Stacks of \(W \times H\) images, however,
are stored with the inverted shape (N, H, W).
These conventions are arguably consistent with the chosen ordering.
\(k\)-Space Bases#
This package uses a number of spatial bases or coordinate spaces to describe the
\(k\)-space of the SLM. Some coordinate spaces are
directly used by the user (most often the camera basis "ij" used for feedback).
Other bases are less often used directly, but are important to how holograms are
optimized under the hood (esp. "knm", the coordinate space of optimization when
using discrete Fourier transforms). The following describes the bases that general
functions (e.g. Hologram) accept. Other units
for coordinate bases can be converted to these standard bases using
convert_vector().
Basis |
Meaning |
|---|---|
|
Normalized basis of the SLM’s \(k\)-space in normalized units.
For small angles, this is equivalent to radians.
Centered at The edge of Fourier space that is accessible to the SLM corresponds to \(\pm\frac{\lambda}{2\Delta x}\) radians, dependant on the pixel size \(\Delta x\) of the SLM. For most SLMs and wavelengths, this angle corresponds to a few degrees at most. Thus, this edge is generally within the small angle approximation. The true edge of the hemisphere of Fourier space corresponds to when \(\sqrt{k_x^2 + k_y^2} = 1\). At this boundary, numerical aperture is 1. Note that the small angle approximation breaks down in this limit. |
|
Nyquist basis of the SLM’s computational \(k\)-space for a given
discrete computational grid of shape The edge of |
|
Pixel basis of the camera.
Centered at The bounds of pixel space may be larger or smaller than Fourier or Nyquist space, depending upon the imaging optics that separate the camera and SLM. |
See the first tip in Hologram
to learn more about "kxy" and "knm" space.