Skip to content

Commit 99636a3

Browse files
authored
Polarizing components v2 (#25)
* add PolarizationFilter * consider global object orientation * decrease test atol for normal3d to 2e-14 * test Jones matrix rotation * wip: AbstractJonesMatrix for xy or sp dispatch * SPBasis constructor test * Jmat tests * cacl global E0 for orthogonally aligned J matrix (pol.-filter) * norm dir vectors in isparallel3d * new test for Jones/Yun calc. * move utils into subfolder, split into subfiles for better oversight. Add Sellmeier equation + testset * add get_view, set_view, hide_axis to ext. internals * add more render presets * fix include MiscUtils.jl * add pd docs, refer to intensity and optical_power * add visibility util fct * fix lens render preset * add removal todo - GB constructor * add bisection fct changes (this will suck to merge lmao) * bug fixes for #22 and #23 * rn XYBasis to XZBasis * add pol. state utils * add tests for pol. state utils and isparallel+ isorthogonal * scuffed patch for thin film polarizing elements without ray dir change * fix mutation bug in islinear * Review fixes * rename pol. filter files and dir, add testset for pol filter, add PolRay beam constructor * add polfilter docs * rm redundant mm def. from runtests.jl * up vn to 0.10.2 * polarizer docs
1 parent 10d939e commit 99636a3

31 files changed

+1309
-597
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "BeamletOptics"
22
uuid = "c387492b-ffec-4e51-9a46-bd230226031c"
33
authors = ["Hugo Uittenbosch <hugo.uittenbosch@dlr.de>, Oliver Kliebisch <oliver.kliebisch@dlr.de> and Thomas Dekorsy <thomas.dekorsy@dlr.de>"]
4-
version = "0.10.1"
4+
version = "0.10.2"
55

66
[deps]
77
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"

docs/make.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ makedocs(;
4949
"Lenses" => "components/lenses.md",
5050
"Beamsplitters" => "components/beamsplitters.md",
5151
"Detectors" => "components/detectors.md",
52+
"Polarizers" => "components/polarizers.md",
5253
],
5354
"Developer Documentation" => Any[
5455
"Dev. guide" => "guide.md",

docs/src/assets/photodetector_showcase.jl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ system = System([pd])
1212
g1 = GaussianBeamlet([0,-20e-3,0], [0,1,1e-3], 532e-9, 1e-5)
1313
g2 = GaussianBeamlet([0,-20e-3,0], [0,1,0], 532e-9, 5e-4)
1414

15-
ϕ = 0
16-
g2.E0 *= exp(im*ϕ)
17-
1815
solve_system!(system, g1)
1916
solve_system!(system, g2)
2017

docs/src/basics/rays.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ This ray type is able to model reflection and [refraction](https://www.rp-photon
2828

2929
## Polarized Rays
3030

31-
In order to model the effect of polarizing elements, e.g. a ``\lambda/4``-plate, the polarization ray tracing calculus of Yun et. al is used [Yun2011_1, Yun2011_2](@cite). This formalism allows to model the effects of said elements on the electric field vector ``E_0`` using the [Jones formalism](https://www.rp-photonics.com/polarization_of_light.html) in global coordinates:
31+
In order to model the effect of polarizing elements, the polarization ray tracing calculus of Yun et. al is used [Yun2011_1, Yun2011_2](@cite). This formalism allows to model the effects of said elements on the electric field vector ``E_0`` using the [Jones formalism](https://www.rp-photonics.com/polarization_of_light.html) in global coordinates:
3232

3333
```@docs; canonical=false
3434
PolarizedRay

docs/src/components/components.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ A collection of basic optical elements is provided with this package as is. They
55
## Component overview
66

77
```@contents
8-
Pages = ["mirrors.md", "lenses.md", "beamsplitters.md", "detectors.md"]
8+
Pages = ["mirrors.md", "lenses.md", "beamsplitters.md", "detectors.md", "polarizers.md"]
99
Depth = 2
1010
```
1111
## Listing available components

docs/src/components/polarizers.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Polarizers
2+
3+
Polarizers in the context of this package are optical elements that select or modify the R³ polarization vector of a [`PolarizedRay`](@ref), e.g. filters or λ/2 waveplates. This is mainly done by two approaches:
4+
5+
1. 3D polarization ray-tracing calculus
6+
2. 3D modified Jones matrix calculus
7+
8+
For more information on the first method refer to the section: [Polarized Rays](@ref). For the second approach, elements fall under the category of the [`BeamletOptics.AbstractJonesPolarizer`](@ref).
9+
10+
```@docs; canonical=false
11+
BeamletOptics.AbstractJonesPolarizer
12+
```
13+
14+
## Jones matrix element representation
15+
16+
Fundamentally, the approach used here to simulate the effect of polarizers is referred to as [Jones calculus](https://en.wikipedia.org/wiki/Jones_calculus) and gives a "0th order" approximation of the physical effect. Out of plane tilts with respect to the optical axis of an incoming ray are currently only considered via a projection into the transverse plane of the incoming ray [Korger2013](@cite).
17+
18+
In a nutshell, elements are characterized by a 2x2 matrix that determines how the E-field components in the transverse plane to the optical axis are passed through in a global coordinate system where a ray of polarized light propagates along the z-axis. For instance, the entries for a linear filter that blocks in the y-direction are
19+
20+
```math
21+
J =
22+
\begin{pmatrix}
23+
1 & 0\\
24+
0 & 0
25+
\end{pmatrix} \,.
26+
```
27+
28+
While this allows to simply model a specific set of polarizing elements, its important to note that more complex phenomena need more extensive implementations. For 3D-calculations, the ``J``-matrix representation is embedded into
29+
30+
```math
31+
P =
32+
\begin{bmatrix}
33+
J & \begin{matrix}0 \\ 0\end{matrix} \\
34+
\begin{matrix}0 & 0\end{matrix} & 1
35+
\end{bmatrix}
36+
```
37+
38+
in order to calculate ``\vec{E}_1 = P \cdot \vec{E}_0`` for normal incidence. Additional details are provided in the docs above.
39+
40+
## Polarisation filter
41+
42+
A polarisation filter or linear polarizer is the simplest practical polarizer and is commonly used to select a desired polarization state. This package provides the [`PolarizationFilter`](@ref) as an idealized implementation for a zero-thickness filter.
43+
44+
```@docs; canonical=false
45+
PolarizationFilter(::Real)
46+
```

docs/src/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ In order to warrant a 1.0.0 release tag, the following features will need to be
7878
- 🔳 Wave plates (λ/2 and λ/4)
7979
- 🔳 Retarders
8080
- 🔳 Faraday rotators
81+
- ✅ Polarizing thin-film filters
8182
- 🔳 Isolators
8283
- 🔳 Modulators
8384
- 🔳 AOM

docs/src/refs.bib

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,22 @@ @article{Yun2011_2
3030
abstract = {The concept of retardance is critically analyzed for ray paths through optical systems described by a three-by-three polarization ray-tracing matrix. Algorithms are presented to separate the effects of retardance from geometric transformations. The geometric transformation described by a ``parallel transport matrix'' characterizes nonpolarizing propagation through an optical system, and also provides a proper relationship between sets of local coordinates along the ray path. The proper retardance is calculated by removing this geometric transformation from the three-by-three polarization ray-tracing matrix. Two rays with different ray paths through an optical system can have the same polarization ray-tracing matrix but different retardances. The retardance and diattenuation of an aluminum-coated three fold-mirror system are analyzed as an example.},
3131
}
3232

33+
@article{Korger2013,
34+
author = {Jan Korger and Tobias Kolb and Peter Banzer and Andrea Aiello and Christoffer Wittmann and Christoph Marquardt and Gerd Leuchs},
35+
journal = {Opt. Express},
36+
keywords = {Polarimetry; Ellipsometry and polarimetry; Polarization; Beam splitters; Liquid crystal displays; Mueller matrices; Optical components; Optical elements; Polarizers},
37+
number = {22},
38+
pages = {27032--27042},
39+
publisher = {Optica Publishing Group},
40+
title = {The polarization properties of a tilted polarizer},
41+
volume = {21},
42+
month = {Nov},
43+
year = {2013},
44+
url = {https://opg.optica.org/oe/abstract.cfm?URI=oe-21-22-27032},
45+
doi = {10.1364/OE.21.027032},
46+
abstract = {Polarizers are key components in optical science and technology. Thus, understanding the action of a polarizer beyond oversimplifying approximations is crucial. In this work, we study the interaction of a polarizing interface with an obliquely incident wave experimentally. To this end, a set of Mueller matrices is acquired employing a novel procedure robust against experimental imperfections. We connect our observation to a geometric model, useful to predict the effect of polarizers on complex light fields.},
47+
}
48+
3349
@book{Fowles1989,
3450
title={Introduction to Modern Optics},
3551
author={Fowles, G.R.},

ext/BeamletOpticsMakieExt.jl

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
module BeamletOpticsMakieExt
22

33
using BeamletOptics
4-
import BeamletOptics: render!, RenderException, _RenderTypes
4+
import BeamletOptics: render!, RenderException, _RenderTypes, get_view, set_view, hide_axis
55

66
const BMO = BeamletOptics
77

8-
using Makie: Axis3, LScene, mesh!, surface!, lines!, RGBAf, scatter!
8+
using Makie: Axis3, LScene, mesh!, surface!, lines!, RGBf, RGBAf, scatter!
99
using GeometryBasics: Point2, Point3
1010
using AbstractTrees: PreOrderDFS
1111
using MarchingCubes: MC, march
@@ -50,4 +50,36 @@ include("RenderLenses.jl")
5050
include("RenderCylinderLenses.jl")
5151
include("RenderPresets.jl")
5252

53+
"""
54+
get_view(ls::LScene)
55+
56+
Returns the current `eyeposition`, `lookat` and `upvector` of the scene `ls`.
57+
"""
58+
function get_view(ls::LScene)
59+
cam = ls.scene.camera_controls
60+
eye = cam.eyeposition[]
61+
lookat = cam.lookat[]
62+
up = cam.upvector[]
63+
return eye, lookat, up
64+
end
65+
66+
"""
67+
set_view(ls::LScene, eye, lookat, up)
68+
69+
Sets the current `eyeposition`, `lookat` and `upvector` of the scene `ls`.
70+
"""
71+
function set_view(ls::LScene, eye, lookat, up)
72+
cam = ls.scene.camera_controls
73+
cam.eyeposition[] = eye
74+
cam.lookat[] = lookat
75+
cam.upvector[] = up
76+
end
77+
78+
"""
79+
hide_axis(ls::LScene, hide::Bool=true)
80+
81+
Hides the axis markers in the `LScene`. Can be toggled via `hide`.
82+
"""
83+
hide_axis(ls::LScene, hide::Bool=true) = (ls.show_axis[] = !hide)
84+
5385
end

ext/RenderPresets.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
render!(ax::_RenderEnv, refr::BMO.AbstractRefractiveOptic; kwargs...) = _render!(ax, refr; transparency=true, color=:white, kwargs...)
22
render!(ax::_RenderEnv, refl::BMO.AbstractReflectiveOptic; kwargs...) = _render!(ax, refl; transparency=false, color=:silver, kwargs...)
33

4+
render!(ax::_RenderEnv, lens::Lens; kwargs...) = _render!(ax, lens; transparency=true, color=RGBf(0.678, 0.847, 0.902), alpha=0.5, kwargs...)
5+
46
render!(ax::_RenderEnv, bs::ThinBeamsplitter; kwargs...) = _render!(ax, bs; transparency=true, color=:magenta, kwargs...)
57

6-
render!(ax::_RenderEnv, nino::BMO.NonInteractableObject; kwargs...) = _render!(ax, nino; transparency=false, color=:grey, kwargs...)
8+
render!(ax::_RenderEnv, nino::BMO.NonInteractableObject; kwargs...) = _render!(ax, nino; transparency=false, color=:grey, kwargs...)
9+
10+
render!(ax::_RenderEnv, nino::BMO.IntersectableObject; kwargs...) = _render!(ax, nino; transparency=true, color=:grey, alpha=0.1)

0 commit comments

Comments
 (0)