This repository contains python functions for creating arbitrary off-axis corrected hologram patterns. It accompanies the research article:
C. W. Johnson, J. S. Pierce, R. C. Moraski, A. E. Turner, A. T. Greenberg, W. S. Parker, and B. J. McMorran, “Corrected Off-Axis Holography for Producing Arbitrary Scalar Fields,” Opt. Express, OE (Submitted 2020)
It is managed by the McMorran Lab at the University of Oregon. See licence for use and distribution permissions.
POC: Benjamin J. McMorran
This repository is a Python implementation of the inversion of Eq. (13) as described in Section 2.3 of the article:
It contains functions to search for the maps which contribute most to the sum on the RHS, and to numerically invert the above equation using those maps to find the functions
and
corresponding to a desired function
.
corrected_holography_example.py contains a general working example of how to use the functions defined in corrected_holography.py. It is written as a notebook, and can be run using Hydrogen, or imported as a Jupyter notebook. Following a clone of this repository, it can be run immediately, with the following Python module dependencies: copy, gc, heapq, itertools, matplotlib, numpy, os, scipy, time.
In addition to illustrating the process described in the paper, this repository is intended to be a utility for those hoping to generate off-axis holograms for wavefront shaping. Thus, a bare-bones template ch_template.py is included that can be edited in a text editor but run from the command line. It has the extra dependency argparse.
In general, the user will need to specify the following variables in order to generate an off-axis hologram:
ch_template.py is a command-line interface for corrected_holography.py. It will save a .npy file containing the computed hologram, as well as a .npy file containing the computed back Fourier plane, if specified.
The user must specify:
- The desired beam profile within
ch_template.py. - The desired groove profile (
sinusoidal,binary,blazed, orarbitrary) via command line.- If
arbitrary, the user must specify a groove profile withinch_template.py
- If
All other grating parameters can be specified via the command line, and default to those listed in the article.
To create a binary hologram that creates a Laguerre-Gauss mode LG23 in the first diffracted order, with pitch 4um, the user would first define the LG mode in ch_template.py.
...
### Desired beam, desired groove profile
beam_func = LG23(x,y)
def LG23(x, y): ### user input
...
...
then run from the command line
python ch_template.py -fpath filepath -fname filename -pitch 4 -bfp binary
-bfp tells the program to compute and save the back fourier plane of the computed hologram. Also note that corrected_holography.py contains definitions of the Laguerre-Gauss modes for convenience.
The user can also specify an arbitrary groove profile by defining f_comps:
### Desired beam, desired groove profile
beam_func = ### user input - beam profile
f_comps = ### user input - groove profile's Fourier components
and would then instead run
python ch_template.py -fpath filepath -fname filename -pitch 4 -bfp arbitrary