- Notifications
You must be signed in to change notification settings - Fork6
Implementations of the Scalable Angular Spectrum Method
License
bionanoimaging/Scalable-Angular-Spectrum-Method-SAS
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
- Update: Included inWaveOpticsPropagation.jl
- Update June 2024: Now included inchromatix
Implementations of the Scalable Angular Spectrum (SAS) method for optical wave propagation in Python + PyTorch and Julia Lang.The SAS allows to propagate optical waves accurately over long distances and high magnifications.It features a much higher speed than the Angular Spectrum (AS) method and is more precise than the single-step Fresnel (SFT-Fr) method.It's implementation essentially consists of three FFTs and some phase factors.
This image compares the three methods for accuracy.
The calculation time for Fresnel was 0.04s, the one for SAS around 0.12s. But AS takes around 6s because of large padding!
For more details about the mathematics and physics behind this method, see thisOPTICA publication.Please consider citing this, if you find it useful:
@article{Heintzmann:23,author = {Rainer Heintzmann and Lars Loetgering and Felix Wechsler},journal = {Optica},keywords = {Fourier transforms; Inverse design; Phase retrieval; Spatial frequency; Synthetic aperture radar; Wave propagation},number = {11},pages = {1407--1416},publisher = {Optica Publishing Group},title = {Scalable angular spectrum propagation},volume = {10},month = {Nov},year = {2023},url = {https://opg.optica.org/optica/abstract.cfm?URI=optica-10-11-1407},doi = {10.1364/OPTICA.497809}}
Check the conditions of thelicense.
Tested withJulia 1.9. Download the software and install it on your computer.Open the REPL and type (type really a]
to enter the package manager. Delete the]
to go back to REPL):
julia> ]add Plutojulia>using Pluto
Pluto.jl is an interactive notebook environment.Download the fileSAS_examples.jl. From within Pluto, open this file.Everything should go fine from now on.
Pluto notebooks are highly reproducible because of the pinned versions of all dependencies. So running this notebook with Julia 1.9.1 is reproducible. You do not have to handle the versions yourself. Everything is done by Pluto.jl.
Implementation in Python andPyTorch. Hence, it can be used within neural networks and automatic differentiation.See thisJupyter notebook.Install
pip install numpy matplotlib torch notebook
to run the Python notebook.
There is an efficient implementation of the Angular Spectrum method and the Scalable Angular Spectrum method inWaveOpticsPropagation.jl.There is one JAX implementation inchromatix.
Please feel free to file issues and bugs here on GitHub! Also, if you have any question regarding the paper, post it here too!
About
Implementations of the Scalable Angular Spectrum Method
Resources
License
Uh oh!
There was an error while loading.Please reload this page.