Skip to content

Commit

Permalink
detail doc string
Browse files Browse the repository at this point in the history
  • Loading branch information
miRoox committed Jun 17, 2020
1 parent 4150779 commit 536006c
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# OpticalPropagation.jl

A package of useful optical propagation methods.

```@index
```

Expand Down
12 changes: 12 additions & 0 deletions src/angular_spectrum.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@
angular_spectrum(Uin, d, λ, lx, ly)
calculate the propagation light field based on the angular spectrum.
## Parameters
- `Uin::AbstractArray{<:Number,2}`: Complex array of input complex amplitude.
- `d::Real`: Distance to propagate in metres.
- `λ::Real`: Wavelength of light to propagate.
- `lx::Real`: The physical size of the input data along the x-axis.
- `ly::Real`: The physical size of the input data along the y-axis.
## Returns
- `::Array{<:Number,2}`: Complex amplitude data after propagation.
"""
function angular_spectrum(Uin::AbstractArray{<:Number,2}, d::Real, λ::Real, lx::Real, ly::Real)
tf = (u, v) -> 1-u^2-v^2>=0 ? exp(2im*pi*d/λ*sqrt(1-u^2-v^2)) : 0
Expand Down
28 changes: 28 additions & 0 deletions src/fresnel_diffraction.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@
fresnel_diffraction_double(Uin, d, λ, lx, ly)
calculate the propagation light field based on the Fresnel diffraction with double Fourier transform.
## Parameters
- `Uin::AbstractArray{<:Number,2}`: Complex array of input complex amplitude.
- `d::Real`: Distance to propagate in metres.
- `λ::Real`: Wavelength of light to propagate.
- `lx::Real`: The physical size of the input data along the x-axis.
- `ly::Real`: The physical size of the input data along the y-axis.
## Returns
- `::Array{<:Number,2}`: Complex amplitude data after propagation.
"""
function fresnel_diffraction_double(Uin::AbstractArray{<:Number,2}, d::Real, λ::Real, lx::Real, ly::Real)
tf = (u, v) -> exp(2im*pi*d/λ)*exp(-im*pi*d/λ*(u^2+v^2))
Expand All @@ -14,6 +26,22 @@ end
fresnel_diffraction_single(Uin, d, λ, lx, ly)
calculate the propagation light field based on the Fresnel diffraction with single Fourier transform.
## Parameters
- `Uin::AbstractArray{<:Number,2}`: Complex array of input complex amplitude.
- `d::Real`: Distance to propagate in metres.
- `λ::Real`: Wavelength of light to propagate.
- `lx::Real`: The physical size of the input data along the x-axis.
- `ly::Real`: The physical size of the input data along the y-axis.
## Returns:
(Uout, (lxo, lyo))
- `Uout::Array{<:Number,2}`: Complex amplitude data after propagation.
- `lxo::Real`: The physical size of the diffraction data along the x-axis.
- `lyo::Real`: The physical size of the diffraction data along the y-axis.
"""
function fresnel_diffraction_single(Uin::AbstractArray{<:Number,2}, d::Real, λ::Real, lx::Real, ly::Real)
qp = (x, y) -> exp(im*pi/d/λ*(x^2+y^2))
Expand Down

2 comments on commit 536006c

@miRoox
Copy link
Member Author

@miRoox miRoox commented on 536006c Jun 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/16505

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.0 -m "<description of version>" 536006c0880ef3a442ca9891b760eb06c53694aa
git push origin v0.1.0

Please sign in to comment.