simple-to-use optical propagation tool
Project description
Axiprop
A simple tool to compute optical propagation, based on the discrete Hankel and Fourier transforms
Contents
This library contains methods and convenience tools to model propagation of the 3D optical field. Computations can be done using a number of backends:
- NumPy (CPU) optionally enhanced via mkl_fft or pyfftw
- CuPy for GPU calculations via Nvidia CUDA API
- ArrayFire for GPU calculations via CUDA or OpenCL APIs
- PyOpenCL for GPU calculations via OpenCL API
Currently methods include:
PropagatorSymmetric
: cylindical axisymmetric propagator with the symmetric DHT proposed in [M. Guizar-Sicairos, J.C. Gutiérrez-Vega, JOSAA 21, 53 (2004)]PropagatorResampling
: cylindical axisymmetric propagator with a more generic DHT which allows for arbitrary sampling of radial axis [K. Oubrerie, I.A. Andriyash et al, J. Opt. 24, 045503 (2022)]PropagatorFFT2
: fully 3D FFT-based propagator
Usage
Consider a laser,
k0 = 2 * np.pi / 0.8e-6 # 800 nm wavelength
tau = 35e-15/ (2*np.log(2))**0.5 # 35 fs FWHM duration
R_las = 10e-3 # 10 mm radius
def fu_laser(kz, r):
"""
Gaussian spot with the Gaussian temporal profile
"""
profile_r = np.exp( -(r/R_las)**2 )
profile_kz = np.exp( -( (kz-k0) * c * tau / 2 )**2 )
return profile_r * profile_kz
and some focusing optics,
f_N = 40 # f-number f/40
f0 = 2 * R_las * f_N # focal length
Define the propagator,
prop = PropagatorSymmetric((Rmax, Nr), (k0, L_kz, Nkz), Nr_end)
and setup the laser reflected from the focusing mirror
A0 = laser_from_fu( fu_laser, prop.kz, prop.r )
A0 = A0 * mirror_parabolic( f0, prop.kz, prop.r )
Use AXIPROP
to compute the field after propagation of dz
distance
(e.g. dz=f0
for field at focus):
A0 = prop.step(A0, f0)
or evaluate it at Nsteps
along some Distance
around the focus,
dz = Distance / Nsteps
zsteps = Nsteps * [dz,]
zsteps[0] = f0 - Distance/2
A_multi = prop.steps(A0, zsteps)
Plot the results using your favorite tools
For more info checkout the example notebooks for radial and cartesian cases, and also look for methods documentation.
Installation
Install axiprop
by cloning the source
git clone https://github.com/hightower8083/axiprop.git
cd axiprop
python setup.py install
or directly via PiPy
pip install git+https://github.com/hightower8083/axiprop.git
Additional requirements
Note that, while base backend NP
requires only NumPy and SciPy, other
backends have specific dependencies:
Optional enhancements of utilities are achieved if Numba is installed.
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
Built Distribution
File details
Details for the file axiprop-0.5.3.tar.gz
.
File metadata
- Download URL: axiprop-0.5.3.tar.gz
- Upload date:
- Size: 32.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca11ecbe4336ffe408c396d20cd46ede9e9e211b38c8a066d8ebd45c7c5d16dd |
|
MD5 | d24690d6cc32fa9583993de99b6382b9 |
|
BLAKE2b-256 | e38c916681f24d1e04176d4d4010b58285c55cc655138eb3ed3bb94ebf3430d6 |
File details
Details for the file axiprop-0.5.3-py3-none-any.whl
.
File metadata
- Download URL: axiprop-0.5.3-py3-none-any.whl
- Upload date:
- Size: 33.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3185e6414031032600dd9a52e0a079160cdf9d26c810af9383ea1284e1aac305 |
|
MD5 | a44be6d855190c566c97279f6cf8f111 |
|
BLAKE2b-256 | f2906bc7eeaae7dcce32ba52f23d943fb62074423438011a403c9f1092c91bf9 |