Detector Layers¤
ApplyPixelResponse
dLux.layers.detector_layers.ApplyPixelResponse
¤
Bases: DetectorLayer
Applies a pixel response array to the input PSF via multiplication. This can be used to model 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 dLux/layers/detector_layers.py
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 | |
__init__(pixel_response)
¤
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pixel_response
|
Array
|
The pixel_response to apply to the input PSF. Must be a 2d array that matches the PSF shape at time of application. |
required |
Source code in dLux/layers/detector_layers.py
83 84 85 86 87 88 89 90 91 92 93 94 | |
ApplyJitter
dLux.layers.detector_layers.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. |
oversample |
int
|
The oversampling factor to use when generating the kernel. This is used to mitigate aliasing when the kernel is small compared to the pixel size. |
Source code in dLux/layers/detector_layers.py
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 | |
kernel
property
¤
Generates the normalised Gaussian kernel.
Returns:
| Name | Type | Description |
|---|---|---|
kernel |
Array
|
The Gaussian kernel. |
__init__(sigma, kernel_size=9, oversample=3)
¤
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sigma
|
(float, pixels)
|
The standard deviation of the Gaussian kernel, in units of pixels. |
required |
kernel_size
|
int = 9
|
The size of the convolution kernel to use. |
9
|
oversample
|
int = 3
|
The oversampling factor to use when generating the kernel. This is used to mitigate aliasing when the kernel is small compared to the pixel size. |
3
|
Source code in dLux/layers/detector_layers.py
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | |
ApplySaturation
dLux.layers.detector_layers.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 dLux/layers/detector_layers.py
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 | |
__init__(threshold)
¤
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
threshold
|
float
|
The threshold at which the saturation is applied. |
required |
Source code in dLux/layers/detector_layers.py
182 183 184 185 186 187 188 189 190 | |
AddConstant
dLux.layers.detector_layers.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 dLux/layers/detector_layers.py
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 | |
__init__(value)
¤
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
float
|
The value to add to the PSF. |
required |
Source code in dLux/layers/detector_layers.py
212 213 214 215 216 217 218 219 220 | |
Downsample
dLux.layers.detector_layers.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 the input PSF size must be divisible by kernel_size.
UML

Attributes:
| Name | Type | Description |
|---|---|---|
kernel_size |
int
|
The size of the downsampling kernel. |
Source code in dLux/layers/detector_layers.py
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 | |
__init__(kernel_size)
¤
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
kernel_size
|
int
|
The size of the downsampling kernel. Must be greater than 0. |
required |
Source code in dLux/layers/detector_layers.py
243 244 245 246 247 248 249 250 251 252 253 254 | |