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
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 | |
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
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 | |
luxspec.processing.analyze_frame(frame, *, dark=None, reference=None, mode='reflectance', module=None, require_ready=True)
¶
Process a raw frame into reflectance or absorbance and optional metrics.
Source code in src/luxspec/processing.py
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 | |
luxspec.processing.module_metrics(spectrum, module)
¶
Dispatch a calibrated spectrum to a Luxnode module metrics function.
Source code in src/luxspec/processing.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | |
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 the 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 | |
lux.modules.astronomy.astronomy_metrics(spectrum, *, color_calibration=None)
¶
Compute V0 telescope-spectroscopy metrics from a calibrated spectrum.
Source code in src/lux/modules/astronomy.py
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 | |
lux.modules.astronomy.classify_stellar_spectrum(spectrum, *, library=None, color_calibration=None, top_k=5)
¶
Classify a bright-object telescope spectrum against stellar templates.
Source code in src/lux/modules/astronomy.py
283 284 285 286 287 288 289 290 291 292 293 294 295 | |
lux.modules.astronomy.fit_color_temperature_calibration(ratios, temperatures_k)
¶
Fit a user calibration from known-star blue/red ratios and temperatures.
Source code in src/lux/modules/astronomy.py
144 145 146 147 148 149 150 151 152 153 | |
lux.modules.astronomy.stellar_template_library(wavelengths_nm)
¶
Return a small broadened bright-star template library for V0 matching.
Source code in src/lux/modules/astronomy.py
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 | |
lux.quality.assess_measurement_triplet(wavelengths_nm, sample_counts, reference_counts, dark_counts, *, mode, adc_max=65535.0, min_reference_signal=150.0)
¶
Validate sample/reference/dark arrays before absorbance or reflectance.
Source code in src/lux/quality.py
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 | |
luxspec.prototype.capture_prototype_measurement(client, *, mode='reflectance', module=None, sample_kind='raw', reference_kind=None, dark_kind='dark', require_ready=True)
¶
Capture dark/reference/sample frames and run the full V0 analysis path.
This is the one-call API for bench use: it captures the required frames, validates signal quality, processes absorbance or reflectance, and dispatches module metrics.
Source code in src/luxspec/prototype.py
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 | |
lux.experiments.run_experiment(scenario_id)
¶
Run one deterministic synthetic experiment.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scenario_id
|
str
|
Identifier from :func: |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
JSON-serializable dashboard payload with spectra, metrics, peaks, |
dict[str, Any]
|
matches, and real-data replacement notes. |
Source code in src/lux/experiments.py
1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 | |
lux.experiments.run_all_experiments()
¶
Run every registered synthetic experiment.
Source code in src/lux/experiments.py
1146 1147 1148 1149 1150 | |
lux.experiments.write_experiments_json(path)
¶
Write the docs dashboard payload to path.
Source code in src/lux/experiments.py
1165 1166 1167 1168 1169 1170 | |