Shack-Hartmann Wavefront Sensor¶
Initialize a Shack-Hartmann Wavefront Sensor (WFS).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
nSubap
|
float
|
Number of subapertures across the pupil diameter. |
required |
telescope
|
Telescope
|
Telescope object to which the WFS is attached. |
required |
src
|
Source
|
Source object (NGS or LGS). |
required |
lightRatio
|
float
|
Threshold ratio to select valid subapertures based on flux. |
required |
plate_scale
|
float
|
Plate scale of the WFS in [arcsec/px]. |
required |
fieldOfView
|
float
|
Field of view of the WFS in [arcsec]. |
required |
guardPx
|
int
|
Number of pixels between subapertures. |
required |
fft_fieldOfView_oversampling
|
float
|
Extra FoV in [arcsec] that is taken for the FFT computation, in order to reduce wrapping effects. |
0
|
use_brightest
|
int
|
Picks the n brightest pixels as threshold for center-of-gravity spot detection. |
50
|
threshold_convolution
|
float
|
Cut-off threshold for Gaussian convolution. |
0.05
|
unit_in_rad
|
bool
|
Return slopes in radians if True, pixels otherwise. |
False
|
noiseFlag
|
bool
|
If True, the detector includes noise using the kwargs params/default config. By default, False. |
False
|
logger
|
Logger
|
Logger for WFS diagnostics. |
None
|
**kwargs
|
dict
|
Additional keyword arguments. fullWellCapacity : int, optional Detector parameter. Full Well Capacity of pixels [e-]. Default, 60ke- nBits : int, optional Detector parameter. Bit depth for quantization. Default is 12, shall be >= 8 quantumEfficiency : float, optional Detector parameter. Quantum efficiency (0-1). Default is 0.64. shotNoise : bool, optional Detector parameter. Shot noise flag. Default 1. darkCurrent : float, optional Detector parameter. Dark current [e-]. Default 250e-/px/s. readoutNoise : float, optional Detector parameter. Readout noise [e-]. Default 60e-. gain : float, optional Detector parameter. Gain of the detector. Default is 1. quantization_conversion : float, optional. Detector parameter. Conversion gain to discretize the measurement [e-/px]. Default 0 --> adjust by well capacity. sensorType : str, optional Detector parameter. Sensor type ('CCD', 'CMOS', 'EMCCD'). Default is 'CCD'. darkCalibration : int, optional Detector parameter. Number of frames to calibrate the dark. Default 20. randomState : int, optional Detector parameter. Seed for the random number generator. Default is None. integrationTime : float, optional Detector parameter. Integration time for the detector [s]. Default is the sampling time. |
{}
|
Source code in SAOS/ShackHartmann.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 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 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 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 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 | |
fft_fieldOfView_oversampling
instance-attribute
¶
npix_lenslet
instance-attribute
¶
cam
instance-attribute
¶
cam = Detector(
nPix=camera_size,
samplingTime=samplingTime,
fullWellCapacity=camera_params["fullWellCapacity"],
nBits=camera_params["nBits"],
quantumEfficiency=camera_params["quantumEfficiency"],
shotNoise=camera_params["shotNoise"],
darkCurrent=camera_params["darkCurrent"],
readoutNoise=camera_params["readoutNoise"],
gain=camera_params["gain"],
quantization_conversion=camera_params[
"quantization_conversion"
],
sensorType=camera_params["sensorType"],
darkCalibration=camera_params["darkCalibration"],
noiseFlag=noiseFlag,
logger=logger,
**camera_kwargs,
)
cube_flux
instance-attribute
¶
phasor
instance-attribute
¶
phasor_tiled
instance-attribute
¶
phasor_expanded
instance-attribute
¶
phasor_expanded_tiled
instance-attribute
¶
norm_flux_map
instance-attribute
¶
norm_flux_map = (
lightRatio
* pupil_reflectivity_resized
* samplingTime
* (D / (nSubap * npix_lenslet)) ** 2
)
photon_per_subaperture_2D
instance-attribute
¶
valid_subapertures_1D
instance-attribute
¶
valid_slopes_maps
instance-attribute
¶
initialize_wfs ¶
Initialize the Shack-Hartmann WFS by measuring reference slopes and determining slope units.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
telescope
|
Telescope
|
The telescope object providing phase and pupil info. |
required |
src
|
Source
|
Source object for flux and wavelength reference. |
required |
Returns:
| Type | Description |
|---|---|
None
|
|
Source code in SAOS/ShackHartmann.py
centroid ¶
Compute center of gravity for subaperture spots.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image
|
ndarray
|
Subaperture image cube. |
required |
use_brightest
|
float
|
Minimum intensity to include in centroid. |
50
|
Returns:
| Type | Description |
|---|---|
ndarray
|
X and Y centroids per subaperture. |
Source code in SAOS/ShackHartmann.py
initialize_flux ¶
Initialize per-subaperture flux distribution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
src
|
Source
|
Light source object. |
required |
norm_flux_map
|
ndarray
|
Normalized flux across telescope pupil. |
required |
Returns:
| Type | Description |
|---|---|
None
|
|
Source code in SAOS/ShackHartmann.py
get_psf ¶
Get the electromagnetic field per subaperture based on input phase.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
phase
|
ndarray
|
Wavefront phase in radians. |
required |
fwhm
|
float
|
Full width at half maximum for the PSF in [px]. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
Complex field per subaperture. |
Source code in SAOS/ShackHartmann.py
429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 | |
create_full_frame ¶
Combine subaperture images into full detector frame.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
subaps
|
ndarray
|
Subaperture spot images. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
Reconstructed full sensor image. |
Source code in SAOS/ShackHartmann.py
get_subaps ¶
Extract individual lenslet spot images from full detector image.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
noisy_frame
|
ndarray
|
2D detector frame. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
Subaperture cubes [nSubaps, width, height]. |
Source code in SAOS/ShackHartmann.py
get_convolution_spot ¶
Compute LGS spot convolution kernel based on sodium profile.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
src
|
Source
|
Laser guide star source object. |
required |
Returns:
| Type | Description |
|---|---|
None
|
|
Source code in SAOS/ShackHartmann.py
604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 | |
wfs_integrate ¶
Integrate the full detector image and compute valid slopes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ideal_frame
|
ndarray
|
Full-frame ideal image. |
required |
subaps
|
ndarray
|
Spot images per subaperture. |
required |
Returns:
| Type | Description |
|---|---|
tuple
|
Slopes 1D, slopes 2D, and final noisy image. |
Source code in SAOS/ShackHartmann.py
wfs_measure ¶
Measure slopes from a wavefront phase using the SH-WFS.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
phase_in
|
ndarray
|
Phase map input [radians]. |
required |
src
|
Source
|
Source object. |
required |
Returns:
| Type | Description |
|---|---|
tuple
|
Slopes 1D, slopes 2D, and detector image. |
Source code in SAOS/ShackHartmann.py
print_properties ¶
Print Shack-Hartmann configuration and diagnostic values.
Returns:
| Type | Description |
|---|---|
None
|
|