Zernikes¤
zernike_name
dLux.utils.zernikes.zernike_name(j)
¤
Gets the name of the jth Zernike polynomial.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
j
|
int
|
The Zernike (noll) index. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
name |
str
|
The name of the Zernike polynomial. |
Source code in src/dLux/utils/zernikes.py
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | |
noll_indices
dLux.utils.zernikes.noll_indices(j)
¤
Calculate the radial and azimuthal orders of the Zernike polynomial.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
j
|
int
|
The Zernike (noll) index. |
required |
Returns:
| Type | Description |
|---|---|
n, m : tuple[int]
|
The radial and azimuthal orders of the Zernike polynomial. |
Source code in src/dLux/utils/zernikes.py
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | |
zernike_factors
dLux.utils.zernikes.zernike_factors(j)
¤
Calculates the normalisation coefficients and powers of the Zernike polynomial.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
j
|
int
|
The Zernike (noll) index. |
required |
Returns:
| Type | Description |
|---|---|
c, k : tuple[Array]
|
The normalisation coefficients and powers of the Zernike polynomial. |
Source code in src/dLux/utils/zernikes.py
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | |
zernike
dLux.utils.zernikes.zernike(j, coordinates, diameter=2)
¤
Calculates the Zernike polynomial. Note that this function is not-jittable as is has dynamic array shapes. To use this function in a jittable way, use the zernike_fast function, with the pre-calculated c and k parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
j
|
int
|
The Zernike (noll) index. |
required |
coordinates
|
Array
|
The Cartesian coordinates to calculate the Zernike polynomial upon. |
required |
diameter
|
float = 2
|
The diameter of the aperture to calculate the Zernike polynomial upon. |
2
|
Returns:
| Name | Type | Description |
|---|---|---|
zernike |
Array
|
The Zernike polynomial. |
Source code in src/dLux/utils/zernikes.py
214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 | |
zernike_fast
dLux.utils.zernikes.zernike_fast(n, m, c, k, coordinates, diameter=2)
¤
Calculates the Zernike polynomial using the pre-calculated c and k parameters, such that this function is jittable.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n
|
int
|
The radial order of the Zernike polynomial. |
required |
m
|
int
|
The azimuthal order of the Zernike polynomial. |
required |
c
|
Array
|
The normalisation coefficients of the Zernike polynomial. |
required |
k
|
Array
|
The powers of the Zernike polynomial. |
required |
coordinates
|
Array
|
The Cartesian coordinates to calculate the Zernike polynomial upon. |
required |
diameter
|
float = 2
|
The diameter of the aperture to calculate the Zernike polynomial upon. |
2
|
Returns:
| Name | Type | Description |
|---|---|---|
zernike |
Array
|
The Zernike polynomial. |
Source code in src/dLux/utils/zernikes.py
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 272 273 274 275 276 277 278 279 280 281 | |
zernike_basis
dLux.utils.zernikes.zernike_basis(js, coordinates, diameter=2)
¤
Calculates the Zernike polynomial basis. Note that this function is not-jittable.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
js
|
list[int]
|
The Zernike (noll) indices. |
required |
coordinates
|
Array
|
The Cartesian coordinates to calculate the Zernike polynomial upon. |
required |
diameter
|
float = 2
|
The diameter of the aperture to calculate the Zernike polynomial upon. |
2
|
Returns:
| Name | Type | Description |
|---|---|---|
zernike_basis |
Array
|
The Zernike polynomial basis. |
Source code in src/dLux/utils/zernikes.py
284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 | |
polike
dLux.utils.zernikes.polike(nsides, j, coordinates, diameter=2)
¤
Calculates the Zernike polynomial on an n-sided aperture. Note that this function is not-jittable as is has dynamic array shapes. To use this function in a jittable way, use the polike_fast function, with the pre-calculated c and k parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
nsides
|
int
|
The number of sides of the aperture. |
required |
j
|
int
|
The Zernike (noll) index. |
required |
coordinates
|
Array
|
The Cartesian coordinates to calculate the Zernike polynomial upon. |
required |
diameter
|
float = 2
|
The diameter of the aperture to calculate the Zernike polynomial upon. |
2
|
Returns:
| Name | Type | Description |
|---|---|---|
polike |
Array
|
The Zernike polynomial on an n-sided aperture. |
Source code in src/dLux/utils/zernikes.py
305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 | |
polike_fast
dLux.utils.zernikes.polike_fast(nsides, n, m, c, k, coordinates, diameter=2)
¤
Calculates the Zernike polynomial on an n-sided aperture using the pre-calculated c and k parameters, such that this function is jittable.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
nsides
|
int
|
The number of sides of the aperture. |
required |
n
|
int
|
The radial order of the Zernike polynomial. |
required |
m
|
int
|
The azimuthal order of the Zernike polynomial. |
required |
c
|
Array
|
The normalisation coefficients of the Zernike polynomial. |
required |
k
|
Array
|
The powers of the Zernike polynomial. |
required |
coordinates
|
Array
|
The Cartesian coordinates to calculate the Zernike polynomial upon. |
required |
diameter
|
float = 2
|
The diameter of the aperture to calculate the polygonal polynomial upon. |
2
|
Returns:
| Name | Type | Description |
|---|---|---|
polike |
Array
|
The Zernike polynomial on an n-sided aperture. |
Source code in src/dLux/utils/zernikes.py
339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 | |
polike_basis
dLux.utils.zernikes.polike_basis(nsides, js, coordinates, diameter=2)
¤
Calculates the Zernike polynomial basis on an n-sided aperture. Note that this function is not-jittable.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
nsides
|
int
|
The number of sides of the aperture. |
required |
js
|
list[int]
|
The Zernike (noll) indices. |
required |
coordinates
|
Array
|
The Cartesian coordinates to calculate the Zernike polynomial upon. |
required |
diameter
|
float = 2
|
The diameter of the aperture to calculate the Zernike polynomial upon. |
2
|
Returns:
| Name | Type | Description |
|---|---|---|
polike_basis |
Array
|
The Zernike polynomial basis on an n-sided aperture. |
Source code in src/dLux/utils/zernikes.py
385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 | |