You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* add Detector.jl
* flesh out hit types
* add spot_diagram for testing
* change wave_number to wavenumber
* more "ideas"
* use getter fcts
* gaussian beamlet intensity test fct
* switch gb eval loop order
* dispatch calc_local_pos and calc_local_lims based on detector hit type
* fix issue #36
* rename some hit getters
* prepare calc local lims and pos for gb integration
* add ellipse helper fct
* add calc_local_pos and "spot diagram" for GaussianBeamlets
* calc_local_lims for GaussianBeamlet
* add some docs
* add ellipse tests
* add Detector type docs
* up vn to 0.11 due to breaking detector changes
* replace Photodetector with new API
* start with splitting up runtests.jl
* fix spot diagram x-axis flip
* more runtests splitting
* even more runtests splitting
* replace Spotdetector and PSFDetector with new API
* remove double Interference tests
* finalize runtests splitting
* update countlines
* add hit docstrings
* rm old detector files
* rm stale refs in abstract pd docstring
* fix psf orientation bug
* update docs p1
* Make normal3d deterministic
* return multithreading to gb intensity calc.
* add reentrant lock to detector push!
* add spot diagram docstring and error msg
* update MI tutorial
* update detectors.md
* final changes
* Update detector docs
* fix type bug
* use Union{all implemented hit types} instead of <:AbstractDetectorHit for type stability
* Try to improve inference
* add center calc. algorithm types for type stability
Copy file name to clipboardExpand all lines: docs/src/api/conventions.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Conventions
2
2
3
-
In order to ensure implicit and explicit compliance with large parts of the API, the following conventions need to be used. Below you can find some essential conventions that need to be followed. For specific components or parts of the code base, refer to the documentation if certain guidelines need to be followed.
3
+
In order to ensure implicit and explicit compliance with large parts of the API, the following conventions need to be used unless specified otherwise. Below you can find some essential conventions. For specific components or parts of the code base, refer to the respective documentation if certain guidelines need to be followed.
4
4
5
5
!!! warning
6
6
Failure to comply with the following conventions can lead to spurious effects and silent bugs when using the API of this package!
Copy file name to clipboardExpand all lines: docs/src/api/core.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -97,7 +97,7 @@ BeamletOptics.retrace_system!
97
97
98
98
## CPU and GPU support
99
99
100
-
Parallizing the execution of a [`solve_system!`](@ref) call on the CPU is straight-forward for systems that do not feature objects which can be mutated during runtime, e.g. detectors like the [`Photodetector`](@ref). For each beam or ray the solution is independent and the solver can run on multiple threads. Special consideration needs to be taken when implementing mutable elements as mentioned above, since multiple threads might be able to access the underlying memory, leading to race conditions. Specifically, this means ensuring atomic write and read access.
100
+
Parallizing the execution of a [`solve_system!`](@ref) call on the CPU is straight-forward for systems that do not feature objects which can be mutated during runtime, e.g. detectors like the [`Detector`](@ref). For each beam or ray the solution is independent and the solver can run on multiple threads. Special consideration needs to be taken when implementing mutable elements as mentioned above, since multiple threads might be able to access the underlying memory, leading to race conditions. Specifically, this means ensuring e.g. atomic write and read access.
101
101
102
102
With respect to GPU acceleration, this is not the case. Currently, all available implementations of [`solve_system!`](@ref) are highly branching algorithms which can not be implemented in a parallized way easily. This will most likley require a specific new subtype of the [`BeamletOptics.AbstractSystem`](@ref) with determinable sequential properties. This is not a development goal as of the writing of this section.
Detectors provide a way to evaluate beam data during optical simulations. They are designed to accumulate e.g. field data, enabling analysis of intensity distributions, interference patterns, and other beam properties.
13
+
In practice, photodetectors allow the conversion of electromagnetic radiation into electric signals. BMO provides the [`Detector`](@ref) as an element to capture and evaluate optical data during and after running a simulation, respectively. The `Detector` is designed to accumulate e.g. field or ray data, enabling analysis of intensity distributions, interference patterns, and other beam properties. Currently, post-processing capabilities are limited to the functionality as described in the [Spot diagrams](@ref) and [Field distributions](@ref) sections.
14
14
15
-
Detectors are supposed to fall under the [`BeamletOptics.AbstractDetector`](@ref) type, which defines a interface for detector implementations.
15
+
In general, detector-like elements are supposed to fall under the [`BeamletOptics.AbstractDetector`](@ref) type, which defines a interface for detector implementations.
16
16
17
17
!!! warning "Resetting detectors"
18
-
In general, the data stored in a detector is not automatically reset between calls of [`solve_system!`](@ref). This task is placed within the responsibility of the user. A detector reset can be performed with the [`empty!`](@ref) function.
18
+
In general, the data stored in a `Detector` is not automatically reset between calls of [`solve_system!`](@ref). This task is placed within the responsibility of the user. A detector reset can be performed with the [`empty!`](@ref) function.
19
19
20
-
## Photodetector type
20
+
## Detector type
21
21
22
-
A concrete implementation to "measure" intensity distributions generated by a [`GaussianBeamlet`](@ref) is provided in the form of the [`Photodetector`](@ref):
22
+
A `Detector` can be easily spawned by initializing e.g. `pd = Detector(5mm)` which will create a 5x5 mm² detection screen.
23
23
24
24
```@docs; canonical=false
25
-
Photodetector(::Real, ::Int)
25
+
Detector(::Real, ::Bool)
26
+
Detector
26
27
```
27
28
28
-
The `interact3d` model of the [`Photodetector`](@ref) can store complex electric field (E-field) values from intersecting [`GaussianBeamlet`](@ref)s, enabling the reconstruction of spatial intensity distribution across its active surface. This data can be used to calculate e.g. beam interference patterns via the [`intensity`](@ref) function. The [`BeamletOptics.optical_power`](@ref) method can be used in order to obtain the total optical power at the detector. Below a rendered example of a detector model ([FDS010](https://www.thorlabs.com/thorproduct.cfm?partnumber=FDS010)) can be seen. The detector active area is marked in blue (1x1 mm²).
29
+
After solving a system containing a `Detector`, the methods listed below can be used in order to analyze the stored data. If no data is obtained during the tracing procedure, an error message will be stored.
29
30
30
-

31
+
## Spot diagrams
31
32
32
-
One of the use cases of the [`Photodetector`](@ref) is to analyse interference patterns. The figure below demonstrates an example intensity distribution captured by the detector pictured above, showing radial fringes due to a mismatch of the radii of curvature of the interfering [`GaussianBeamlet`](@ref)s.
33
+
The `spot_diagram` method provides a straight forward way to generate spot diagrams, which are commonly used to perform initial assessments of the optical performance of an imaging setup.
33
34
34
-
!!! tip "Interferometer tutorial"
35
-
Refer to the [Michelson interferometer](@ref) section for a detailed tutorial on how to use the [`Photodetector`](@ref).
Below an optical system consisting of a collection of collimated [`Beam`](@ref)s passing through a [`ThinLens`](@ref) is shown. A [`Detector`](@ref) is positioned at the approximate focal plane to capture the resulting spot diagram.
40
+
41
+

42
+
43
+
The beam bundle used to generate the spot diagram was created via the [`CollimatedSource`](@ref) constructor. The resulting spot diagram of the lens shown above is visualized below.
A straight forward detector that stores the [`BeamletOptics.Intersection`](@ref) position of an incoming [`Beam`](@ref). The [`Spotdetector`](@ref) can be used to generate spot diagrams, which are commonly used to perform initial assessments of the optical performance of an imaging setup.
49
+
Alternatively, the detector data can also be used to reconstruct electric field distributions of incoming beams on its surface using coherent addition. Depending on the beam type, either plane wave or Gaussian beam models are used. As a user, this data can be accessed using the [`electric_field`](@ref) interface.
42
50
43
51
```@docs; canonical=false
44
-
Spotdetector(::AbstractFloat)
52
+
electric_field(::Detector)
45
53
```
46
54
47
-
Below an optical system consisting of a collection of collimated [`Beam`](@ref)s passing through a [`ThinLens`](@ref) is shown. A[`Spotdetector`](@ref)is positioned at the approximate focal plane to capture the resulting spot diagram.
55
+
For convienience, the [`intensity`](@ref) function returns flux values directly. The[`optical_power`](@ref)method can be used in order to obtain the total optical power on the detector surface.
48
56
49
-

57
+
```@docs; canonical=false
58
+
intensity(::Detector)
59
+
```
50
60
51
-
The beam bundle used to generate the spot diagram was created via the [`CollimatedSource`](@ref) constructor. The resulting spot diagram of the lens shown above is visualized below.
One of the use cases of the [`Detector`](@ref) is to analyse interference patterns. Below a rendered example of a detector model ([FDS010](https://www.thorlabs.com/thorproduct.cfm?partnumber=FDS010)) can be seen. The detector active area is marked in blue (1x1 mm²).
54
64
55
-
## Point-spread-function detector type
65
+

66
+
67
+
The figure below demonstrates an example intensity distribution captured by the detector pictured above, showing radial fringes due to a mismatch of the radii of curvature of the interfering [`GaussianBeamlet`](@ref)s. In addition, the beam waists have been visualized.
68
+
69
+
!!! tip "Interferometer tutorial"
70
+
Refer to the [Michelson interferometer](@ref) section for a detailed tutorial on how to use the [`Detector`](@ref).
The point spread function estimation is a highly experimental feature. It does not use
@@ -63,24 +82,15 @@ The beam bundle used to generate the spot diagram was created via the [`Collimat
63
82
The package offers a simple method to estimate the point spread function of a system. It is
64
83
currently limited and requires careful assessment by the user, if the results are to be trusted.
65
84
66
-
To analyze the PSF of a imaging system a [`PSFDetector`](@ref) is added to the system at the plane
67
-
and orientation where the PSF is requested. This is the same approach as for the other detector types.
68
-
69
-
```@docs; canonical=false
70
-
PSFDetector(::Real)
71
-
```
72
-
73
-
The intensity map together with the coordinate system of the detector can be retrieved after solving the system by calling the [`intensity`](@ref) function.
74
-
75
-
```@docs; canonical=false
76
-
intensity(::PSFDetector)
77
-
```
85
+
To analyze the PSF of a imaging system a [`Detector`](@ref) is added to the system at the plane
86
+
and orientation where the PSF is requested. This is the same approach as for the other detector types.
87
+
The intensity map together with the coordinate system of the detector can be retrieved after solving
88
+
the system by calling the [`intensity`](@ref) function.
78
89
79
90
!!! warning
80
91
When dealing with a collimated source as the input to your optical system, where you want to calculate the PSF, **DO NOT** use the [`CollimatedSource`](@ref) beam group directly but instead use the [`UniformDiscSource`](@ref) constructor. This function returns a `CollimatedSource` with an equal-area sampling, which correctly weights the outer beams in relation to the inner beams. Otherwise the results might be wrong.
81
92
82
-
83
-
### Airy-Disc Example
93
+
#### Airy-Disc Example
84
94
85
95
This is a classic example where a collimated circular beam is imaged onto a point by a singlet lens.
86
96
Due to the finite size of the aperture stop (in this case given by the 15 mm size of the beam), the diffraction
0 commit comments