Skip to main content

Optical Diffraction and Interference (scalar and vectorial)

Project description

Python Diffraction-Interference module

https://img.shields.io/pypi/v/diffractio.svg https://img.shields.io/travis/optbrea/diffractio.svg Documentation Status logo.png

Features

Diffratio is a Python library for Diffraction and Interference Optics.

It implements Scalar Optics. The main algorithms used are Rayleigh Sommerfeld (RS), Beam Propagation Method (BPM) and Fast Fourier Transform (FFT). When possible, multiprocessing is implemented for a faster computation.

The scalar propagations techniques are implemented to:

  • X - fields are defined in the x axis.

  • XZ - fields are defined in the xz plane, being z the propagation direction.

  • XY - fields are defined in the xy transversal plane.

  • XYZ - fields are defined in the xyz volume.

Each technique present three modules:

  • sources: Generation of light.

  • masks: Masks and Diffractive Optical elements.

  • fields: Propagation techniques, parameters and general functions.

Sources

One main part of this software is the generation of optical fields such as:

  • Plane waves.

  • Spherical waves.

  • Gaussian beams.

  • Bessel beams.

  • Aberrated beams.

Also, in the XY module the following sources are defined:

  • Vortex beams.

  • Laguerre beams.

  • Hermite-Gauss beams.

  • Zernike beams.

  • Bessel beams.

source.png

Masks

Another important part of Diffractio is the generation of masks and Diffractive Optical Elements such as:

  • Slits, double slits

  • Lenses, diffractive lenses, aspherical lenses.

  • Gratings, prisms, biprism

  • Rough surfaces, dust ks are defined as plane. However, in the XZ and XYZ frames, volumetric mask are also defined.

mask1.png mask2.png

Fields

In these module, algorithms for propagation of light are implemented. We have implemented the following algorithms for light propagation:

  • Rayleigh-Sommerfeld (RS) which allows in a single step to propagate to a near or far observation plane, which allows fast computations. The fields and the masks must be defined in a plane.

  • Beam propagation method (BPM) which allows to analyze the propation of light in volumetric elements, such as spheres, cylinders and other complex forms.

  • Fast Fourier Transform (FFT) which allows, in a single step to determine the field at the far field.

The fields, masks and sources can be stored in files,

Also drawings can be easily obtained, for intensity, phase, fields, etc.

In some modules, videos can be generated for a better analysis of optical fields.

propagation.png

Other features

  • Intensity, MTF and other parameters are obtained from the optical fields.

  • Fields can be added and interference is produced. Masks can be multiplied, added and substracted in order to make complex structures

  • Resampling fields in order to analyze only areas of interest.

  • Save and load data for future analysis.

  • Rayleigh-Sommerfeld implementation is performed in multiprocessing for fast computation.

  • Polychromatic and extended source problems can also be analyzed using multiprocessing.

Authors

  • Luis Miguel Sanchez Brea <optbrea@ucm.es>

    Universidad Complutense de Madrid, Faculty of Physical Sciences, Department of Optics Plaza de las ciencias 1, ES-28040 Madrid (Spain)

logoUCM.png

Citing

L.M. Sanchez Brea, “Diffratio, python module for diffraction and interference optics”, https://pypi.org/project/diffractio/ (2019)

References

    1. Shen and A. Wang, “Fast-Fourier-transform based numerical integration method for the Rayleigh-Sommerfeld diffraction formula,” Appl. Opt., vol. 45, no. 6, pp. 1102–1110, 2006.

  • Engineering optics with matlab”

  • Fast Bessel and Hankle functions: https://dlmf.nist.gov/10.2#E5

  • Beam width: https://en.wikipedia.org/wiki/Beam_diameter

  • JA Oglivy “Theory of wave scattering from random surfaces” Adam Hilger

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

History

0.0.0 (2017-01-01)

Pre-alpha state.

  • I have been developing and using the module diffractio for at least 5 years for teaching and research. It was in python2 version and not completely clear.

0.0.1 (2019-02-09)

Pre-alpha state.

Modules are passed to python3.

0.0.2 (2019-10-01)

Alpha state

  • copyreg removed (previous not worked)

  • change fft to scipy: “from scipy.fftpack import fft, ifft, fftshift”

First release on PyPI in pre-alpha state.

  • Modules = 9/10.

  • Functions = 9/10.

  • Tutorial = 7/10.

  • Examples = 4/10.

  • Tests = 8/10.

  • Drawing = 8/10.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

diffractio-0.0.4.tar.gz (23.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

diffractio-0.0.4-py2.py3-none-any.whl (116.1 kB view details)

Uploaded Python 2Python 3

File details

Details for the file diffractio-0.0.4.tar.gz.

File metadata

  • Download URL: diffractio-0.0.4.tar.gz
  • Upload date:
  • Size: 23.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.10.0 pkginfo/1.2.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.8.0 tqdm/4.19.5 CPython/3.6.8

File hashes

Hashes for diffractio-0.0.4.tar.gz
Algorithm Hash digest
SHA256 e9eb92bd504f537705df1a240804527f9ff9b6101a7566237f4a872123d222d2
MD5 fd4f0b36e3ef7e3755cf8d7ebab67e2c
BLAKE2b-256 abb211262d3cbb8f58ace39ceb0a76f64edaabefea43fa88b2047630b8924c51

See more details on using hashes here.

File details

Details for the file diffractio-0.0.4-py2.py3-none-any.whl.

File metadata

  • Download URL: diffractio-0.0.4-py2.py3-none-any.whl
  • Upload date:
  • Size: 116.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.10.0 pkginfo/1.2.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.8.0 tqdm/4.19.5 CPython/3.6.8

File hashes

Hashes for diffractio-0.0.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c0783a309caa6ebcf57dfe181e15e28c383b5c898ef7ff5b3b4e563e3e022565
MD5 27dc204d8ef8f0ced00361b3b7366b8a
BLAKE2b-256 a375f107a1ecd5bd8ab1edf3402dfee4673d7b21ca50f9a50645436c33df7774

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page