Detector Layers
ApplyPixelResponse
Bases: DetectorLayer
Applies a pixel response array to the input psf, via a multiplication. This can be used to model variations in the inter and intra-pixel sensitivity variations common to most detectors.
UML
Attributes:
Name | Type | Description |
---|---|---|
pixel_response |
Array
|
The pixel_response to apply to the input psf. |
Source code in src/dLux/layers/detector_layers.py
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 |
|
__init__(pixel_response)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pixel_response
|
Array
|
The pixel_response to apply to the input psf. Must be a 2-dimensional array equal to size of the psf at time of application. |
required |
Source code in src/dLux/layers/detector_layers.py
63 64 65 66 67 68 69 70 71 72 73 74 |
|
apply(psf)
Applies the layer to the PSF.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
psf
|
PSF
|
The psf to operate on. |
required |
Returns:
Name | Type | Description |
---|---|---|
psf |
PSF
|
The transformed psf. |
Source code in src/dLux/layers/detector_layers.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
|
ApplyJitter
Bases: DetectorLayer
Convolves the psf with a radially symmetric Gaussian kernel parameterised by its standard deviation (sigma).
UML
Attributes:
Name | Type | Description |
---|---|---|
sigma |
(float, pixels)
|
The standard deviation of the Gaussian kernel, in units of pixels. |
kernel_size |
int
|
The size of the convolution kernel to use. |
Source code in src/dLux/layers/detector_layers.py
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 |
|
__init__(sigma, kernel_size=10)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sigma
|
(float, pixels)
|
The standard deviation of the Gaussian kernel, in units of pixels. |
required |
kernel_size
|
int = 10
|
The size of the convolution kernel to use. |
10
|
Source code in src/dLux/layers/detector_layers.py
112 113 114 115 116 117 118 119 120 121 122 123 |
|
apply(psf)
Applies the layer to the PSF.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
psf
|
PSF
|
The psf to operate on. |
required |
Returns:
Name | Type | Description |
---|---|---|
psf |
PSF
|
The transformed psf. |
Source code in src/dLux/layers/detector_layers.py
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 |
|
generate_kernel(pixel_scale)
Generates the normalised Gaussian kernel.
Returns:
Name | Type | Description |
---|---|---|
kernel |
Array
|
The Gaussian kernel. |
Source code in src/dLux/layers/detector_layers.py
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 |
|
ApplySaturation
Bases: DetectorLayer
Applies a simple saturation model to the input psf, by clipping any values above the threshold value.
UML
Attributes:
Name | Type | Description |
---|---|---|
threshold |
float
|
The threshold at which the saturation is applied. |
Source code in src/dLux/layers/detector_layers.py
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 |
|
__init__(threshold)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
threshold
|
float
|
The threshold at which the saturation is applied. |
required |
Source code in src/dLux/layers/detector_layers.py
175 176 177 178 179 180 181 182 183 |
|
apply(psf)
Applies the layer to the PSF.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
psf
|
PSF
|
The psf to operate on. |
required |
Returns:
Name | Type | Description |
---|---|---|
psf |
PSF
|
The transformed psf. |
Source code in src/dLux/layers/detector_layers.py
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 |
|
AddConstant
Bases: DetectorLayer
Adds a constant to the output psf. This is typically used to model the mean value of the detector noise.
UML
Attributes:
Name | Type | Description |
---|---|---|
value |
float
|
The value to add to the psf. |
Source code in src/dLux/layers/detector_layers.py
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 |
|
__init__(value)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
float
|
The value to add to the psf. |
required |
Source code in src/dLux/layers/detector_layers.py
218 219 220 221 222 223 224 225 226 |
|
apply(psf)
Applies the layer to the PSF.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
psf
|
PSF
|
The psf to operate on. |
required |
Returns:
Name | Type | Description |
---|---|---|
psf |
PSF
|
The transformed psf. |
Source code in src/dLux/layers/detector_layers.py
228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 |
|
Downsample
Bases: DetectorLayer
Downsamples an input psf by an integer number of pixels via a sum. Typically used to downsample an oversampled psf to the true pixel size. Note kernel_size must be an integer multiple of the input psf size.
UML
Attributes:
Name | Type | Description |
---|---|---|
kernel_size |
int
|
The size of the downsampling kernel. |
Source code in src/dLux/layers/detector_layers.py
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 282 283 284 285 286 |
|
__init__(kernel_size)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
kernel_size
|
int
|
The size of the downsampling kernel. |
required |
Source code in src/dLux/layers/detector_layers.py
262 263 264 265 266 267 268 269 270 |
|
apply(psf)
Applies the layer to the PSF.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
psf
|
PSF
|
The psf to operate on. |
required |
Returns:
Name | Type | Description |
---|---|---|
psf |
PSF
|
The transformed psf. |
Source code in src/dLux/layers/detector_layers.py
272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 |
|