Detectors¤
BaseDetector
dLux.detectors.BaseDetector
¤
Bases: Base
Abstract base class for detector models.
Concrete detectors implement model(...) to transform input PSFs into
detector-space outputs.
UML

Source code in dLux/detectors.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | |
model(psf, return_psf=False)
¤
Backwards compatibility method that invokes call.
Delegates to the call method.
Source code in dLux/detectors.py
34 35 36 37 38 39 40 41 42 43 44 | |
LayeredDetector
dLux.detectors.LayeredDetector
¤
Bases: BaseDetector
Applies a series of detector layers to an input PSF.
UML

Attributes:
| Name | Type | Description |
|---|---|---|
layers |
OrderedDict
|
A series of |
Source code in dLux/detectors.py
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 | |
__call__(psf, return_psf=False)
¤
Applies the detector layers to the input PSF.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
psf
|
PSF
|
The input PSF to be transformed. |
required |
return_psf
|
bool = False
|
Should the PSF object be returned instead of the PSF array? |
False
|
Returns:
| Name | Type | Description |
|---|---|---|
result |
Array | PSF
|
If |
Source code in dLux/detectors.py
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 | |
__getattr__(key)
¤
Raises the individual layers via their keys.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
str
|
The key of the item to be searched for in the layers dictionary. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
item |
Any
|
The item corresponding to the supplied key in the layers dictionary. |
Source code in dLux/detectors.py
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 | |
__init__(layers)
¤
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
layers
|
list[DetectorLayer | tuple[str, DetectorLayer]]
|
A list of DetectorLayer objects to apply to the input PSF. List entries can be tuples of (key, layer) to specify a key, else the key is taken as the class name of the layer. |
required |
Source code in dLux/detectors.py
62 63 64 65 66 67 68 69 70 71 72 73 74 75 | |
insert_layer(layer, index)
¤
Inserts a layer into the layers dictionary at a specified index. This function calls the list2dictionary function to ensure all keys remain unique. Note that this can result in some keys being modified if they are duplicates. The input 'layer' can be a tuple of (key, layer) to specify a key, else the key is taken as the class name of the layer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
layer
|
DetectorLayer | tuple[str, DetectorLayer]
|
The layer to be inserted. |
required |
index
|
int
|
The index at which to insert the layer. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
detector |
LayeredDetector
|
The updated detector. |
Source code in dLux/detectors.py
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 | |
remove_layer(key)
¤
Removes a layer from the layers dictionary, specified by its key.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
str
|
The key of the layer to be removed. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
detector |
LayeredDetector
|
The updated detector. |
Source code in dLux/detectors.py
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 | |