API Reference¶
luxspec.telemetry.LuxFrame
dataclass
¶
A single calibrated or raw Luxnode scan frame.
The class accepts the compact V0 firmware payload
{"device": "...", "kind": "raw", "pixels": [...]} and the richer
protocol payload used by the Python SDK.
Source code in src/luxspec/telemetry.py
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 | |
luxspec.telemetry.LuxTelemetry
dataclass
¶
Device-side telemetry that travels with a Luxnode scan frame.
Source code in src/luxspec/telemetry.py
33 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 | |
luxspec.client.SerialLuxNode
¶
Bases: BaseLuxNodeClient
Read JSON-line frames from Luxnode firmware over a serial port.
Source code in src/luxspec/client.py
29 30 31 32 33 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 | |
luxspec.client.HttpLuxNode
¶
Bases: BaseLuxNodeClient
HTTP client for Wi-Fi Luxnode firmware or a Lux Cloud edge bridge.
Source code in src/luxspec/client.py
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 | |
luxspec.processing.analyze_frame(frame, *, dark=None, reference=None, mode='reflectance', module=None)
¶
Process a raw frame into reflectance or absorbance and optional metrics.
Source code in src/luxspec/processing.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | |
luxspec.processing.module_metrics(spectrum, module)
¶
Dispatch a calibrated spectrum to a Luxnode module metrics function.
Source code in src/luxspec/processing.py
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | |
luxspec.versioning.VersionInfo
dataclass
¶
Compatibility envelope reported by Luxnode firmware and Lux Cloud.
Source code in src/luxspec/versioning.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | |
luxspec.versioning.UpgradeManifest
dataclass
¶
Signed-release metadata for a future Luxnode firmware updater.
Source code in src/luxspec/versioning.py
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 | |
lux.Spectrum
dataclass
¶
A one-dimensional spectrum with wavelengths in nanometers.
Source code in src/lux/spectrum.py
9 10 11 12 13 14 15 16 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 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 | |
lux.peaks.detect_peaks(wavelengths_nm, values, *, smooth_window=9, smooth_degree=3, min_prominence=None, min_distance_nm=10.0, baseline_correct=True, max_peaks=None)
¶
Detect resolved peaks with local prominence and FWHM.
The default parameters are tuned for C12880MA/C16767MA spectra whose optical
resolution is roughly 5-15 nm. Use smaller min_distance_nm only for the UV
head or high-resolution external spectra.
Source code in src/lux/peaks.py
32 33 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 | |
lux.matching.match_spectrum(measured, library, *, top_k=5, smooth_window=9, metric='composite')
¶
Rank spectra using complementary whole-shape metrics.
metric can be composite (the default), sam, correlation,
derivative_correlation, or continuum_correlation.
Source code in src/lux/matching.py
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 | |