feat(spark): add spectrum scan support for absorbance and fluorescence - #1046
Merged
Conversation
Member
|
cool, thanks for the PR! in another PR (#1033) we named the spectral scans |
Add read_absorbance_spectrum() and read_fluorescence_spectrum() methods to ExperimentalSparkBackend. These leverage the Spark firmware's native wavelength sweep via WAVELENGTH=FROM~TO:STEP range syntax, avoiding manual per-wavelength iteration. Changes: - optics_control: Accept Union[int, str] for wavelength params - spark_backend: Add spectrum scan methods with shared orchestration helpers (_run_measurement, _setup_absorbance, _setup_fluorescence) - spark_processor: Add process_absorbance_spectrum() and process_fluorescence_spectrum() with shared helpers (_find_key, _extract_measurement_pairs, _extract_fluo_calibration, _reshape_to_rows, _get_dark_for_wl) - Tests: 25/25 pass, validated on physical hardware via USB/IP
xbtu2
force-pushed
the
feat/spark-spectrum-scan
branch
from
May 18, 2026 20:34
c12ea12 to
354de01
Compare
Rename read_absorbance_spectrum -> experimental_read_absorbance_spectrum and read_fluorescence_spectrum -> experimental_read_fluorescence_spectrum to match the naming convention from PR PyLabRobot#1033.
Contributor
Author
xbtu2
marked this pull request as ready for review
May 18, 2026 20:39
Member
|
sweeeeet |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add
read_absorbance_spectrum()andread_fluorescence_spectrum()methods toExperimentalSparkBackend, enabling wavelength-sweep spectral scanning on the Tecan Spark plate reader.Key Design Decision
The Spark firmware natively supports wavelength range sweeps via
WAVELENGTH=FROM~TO:STEPsyntax in its filter commands. This implementation leverages the native sweep rather than issuing per-wavelength commands, which is both faster and simpler.Changes
controls/optics_control.pywavelengthparam type:Optional[int]→Optional[Union[int, str]]to accept firmware range strings (e.g.'5000~5500:100')spark_backend.pyread_absorbance_spectrum()andread_fluorescence_spectrum()public methods_run_measurement(): shared background-read → scan → cleanup orchestration_setup_absorbance()/_setup_fluorescence(): shared instrument configurationspark_processor.pyprocess_absorbance_spectrum()andprocess_fluorescence_spectrum()for multi-wavelength TDCL data_find_key(): dynamic TDCL key lookup (replaces repeatednext()patterns)_extract_measurement_pairs(): unifies nested_mult and flat block handling_extract_fluo_calibration(): shared dark/bright/K extraction_reshape_to_rows(): shared wavelength→rows×cols reshaping_get_dark_for_wl(): per-wavelength dark value lookup with fallbackTests
Physical Hardware Validation
Tested on a physical Tecan Spark via USB/IP forwarding: