Commit 91c1d25
Feat/extended sources (#470)
* feat: implement extended source modelling logic and visualization (#224)
* feat: improve source visualization in optical system and source.draw() method (#224)
* correct formulas for creating the collimated gaussian source, and add a notebook as an example - to me moved to the gallery (#224)
* formatting
* refactor source logic: Add SMF Source model, ExtendedSourceOptic wrapper, and a correction term added for radiant intensity computation (#224)
* ruff check
* docs: update documentation to include ExtendedSource approach. Includes an example Notebook Tutorial and for the gallery as well
* Add comprehensive tests for extended sources and fix torch XY projection
- Add tests/test_extended_sources.py with 160 tests covering:
- SMFSource: ray generation, parameter computation, edge cases, visualization
- BaseSource: abstract interface contract verification
- ExtendedSourceOptic: delegation, tracing, drawing, projections, repr
- IncoherentIrradiance: source integration and conflict handling
- SourceViewer: 6-panel diagnostic visualization
- Standard analysis delegation via .optic for field-based analyses
- Fix torch backend compatibility in Lens2D XY projection
(optiland/visualization/system/lens.py): convert tensor values to
plain floats via be.to_numpy().item() before passing to plt.Circle,
preventing RuntimeError from matplotlib calling .numpy() on tensors
with requires_grad=True
* chore: trying to resolve doc gen failure. Remove autogen'd files
* chore: alphabetize api
* chore: run notebook
* docs: add extended sources to MD learning guide
---------
Co-authored-by: Kramer <kdanielharrison@gmail.com>1 parent a431fac commit 91c1d25
File tree
25 files changed
+2685
-129
lines changed- docs
- api
- examples
- gallery
- extended_sources
- optiland
- analysis
- backend
- optic
- sources
- visualization/system
- tests
25 files changed
+2685
-129
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
103 | | - | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
104 | 107 | | |
105 | | - | |
| 108 | + | |
106 | 109 | | |
107 | | - | |
| 110 | + | |
108 | 111 | | |
109 | | - | |
| 112 | + | |
110 | 113 | | |
111 | | - | |
| 114 | + | |
112 | 115 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| 14 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
Lines changed: 273 additions & 0 deletions
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
52 | 66 | | |
53 | 67 | | |
54 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
Lines changed: 234 additions & 0 deletions
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| 111 | + | |
111 | 112 | | |
112 | 113 | | |
113 | 114 | | |
| |||
175 | 176 | | |
176 | 177 | | |
177 | 178 | | |
| 179 | + | |
178 | 180 | | |
179 | 181 | | |
180 | 182 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
118 | 126 | | |
119 | 127 | | |
120 | 128 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
51 | 55 | | |
52 | 56 | | |
53 | 57 | | |
| |||
73 | 77 | | |
74 | 78 | | |
75 | 79 | | |
| 80 | + | |
| 81 | + | |
76 | 82 | | |
77 | 83 | | |
78 | 84 | | |
| |||
81 | 87 | | |
82 | 88 | | |
83 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
84 | 115 | | |
85 | 116 | | |
86 | 117 | | |
| |||
89 | 120 | | |
90 | 121 | | |
91 | 122 | | |
92 | | - | |
| 123 | + | |
93 | 124 | | |
94 | 125 | | |
95 | 126 | | |
| |||
103 | 134 | | |
104 | 135 | | |
105 | 136 | | |
106 | | - | |
| 137 | + | |
107 | 138 | | |
108 | 139 | | |
109 | 140 | | |
| |||
121 | 152 | | |
122 | 153 | | |
123 | 154 | | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
133 | 168 | | |
134 | 169 | | |
135 | 170 | | |
| |||
200 | 235 | | |
201 | 236 | | |
202 | 237 | | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
207 | 272 | | |
208 | | - | |
209 | | - | |
| 273 | + | |
| 274 | + | |
210 | 275 | | |
211 | 276 | | |
212 | 277 | | |
| |||
0 commit comments