Giter VIP home page Giter VIP logo

slm's Introduction

SLM

Python code for the generation and display of SLM holograms and the analysis of light shaping performed by the holograms.

Modules

holograms

Handles the generation of holograms to be sent to the SLM display that do not require measurement feedback from e.g. the camera. Organised into submodules by hologram type.

All holograms are returned as numpy float arrays with 0 - 2π phase modulation represented with values in the range 0 - 1.

holograms.gratings

Contains blazed gratings used to split SLM diffraction orders such that the +1 order can be spatially isolated. Gratings are defined by the period of a 0 - 2π linear phase modulation, in units of SLM pixels.

Typical usage:

import holograms as hg
grating = hg.gratings.grating(period,angle)

holograms.lenses

Contains lenses that can be used to either focus the light or apply a shift to the focal plane, depending on the optical setup following the SLM.

Typical usage:

import holograms as hg
lens = hg.lenses.lens(wavelength,f,(x0,y0))

holograms.apertures

Defines apertures which are applied to existing holograms and return modified copies. The most frequently used of these is the circular aperture which removes distortions caused when non-circular holograms are shown on the SLM screen (created by the corners giving sharp features in Fourier space).

Typical usage:

import holograms as hg
apertured = hg.apertures.circ(hologram)

holograms.zernike

Returns arrays containing Zernike polynomials which can be used to correct phase aberrations in the an imaging system due to them forming an orthogonal basis on a circle.

holograms.mixing

Produces composite holograms made from randomly sampling input holograms, which can be used to quickly and easily combine their effects in the Fourier plane.

holograms.complex_amp_mod

Module defining the ComplexAmpMod object which generates holograms which modulate both the amplitude and phase of a beam once the +1 diffraction order has been spatially filtered.

This technique can be used to create arbitrary intensity patterns in the focal plane; the code currently is written instead for easy generation of superpositions of Laguerre-Gauss modes.

The object is contained in the main holograms namespace and should be imported as so:

import holograms as hg
cam = hg.ComplexAmpMod()

holograms.misc

Contains other functions which have been useful occasionally. These include blank (generates a uniform hologram), load and save (read and write holograms from image files respectively), and translate (moves a hologram around in an array, padding empty pixels with zeros).

slm

Interfaces with the SLM display which appears in Windows as an additional monitor via an SLM object. Holograms are sent to the SLM by displaying a 24-bit RGB color image where the 2-byte 65536 voltage states of each SLM pixel are encoding using the G value as the most significant byte and the R value as the least significant byte (the B value is discarded).

All holograms should be sent to the SLM object as numpy float arrays with 0 - 2π phase modulation represented with values in the range 0 - 1 (such as those generated by the holograms module). Typically a time of around 0.5 seconds should be left to ensure that SLM display has updated.

When this object is initialised a custom lookup table can be applied which should be of the form in ScaledLutModel.txt, where the first column is the desired phase modulation in the range 0 - 65535 and the second column is the calibrated value that should be sent to the display.

Typical usage:

import time
from slm import SLM

slm = SLM(monitor=1)
slm.apply_hologram(holo)
time.sleep(0.5)

Acknowledgements

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.