Repository navigation
Cookbook lot 3: camera ROI/binning/exposure and spectrometer recipe - #26
Merged
Merged
Conversation
…rometer recipe BSCamera now applies a ROI and a binning like a camera does, scales the signal by the exposure time and sends axes in um that follow them (the photodiode still reads the whole sensor). RoiStuff keeps the software ROI example. New CookbookSpectrometer (1D detector and central wavelength actuator): a calibrated wavelength axis that changes, and an actuator that is a slave of the detector. The simulated spectrometer is adapted from pymodaq_plugins_teaching. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Tdiso1u1ZhikSutj2Qs5Cg
…he spectrometer extension CookbookSpectrometer gets the laser line, the exposure time and get/set_spectro_wl, get/set_laser_wl, get/set_exposure_ms. Mock_spectro is removed (no alias, noted in the README); MockSpectroErrors now builds on CookbookSpectrometer. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Tdiso1u1ZhikSutj2Qs5Cg
…Viewer averaging Same calculation as PyMoDAQ PR 1401 (sigma / sqrt(N), ddof=1) for the plugin that averages itself, with n_averaged set. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Tdiso1u1ZhikSutj2Qs5Cg
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.
Before: the cookbook had no camera or spectrometer recipe.
BSCameraonly gave pixel axes, and the README noted that binning and exposure time of a camera were not shown. Two spectrometer plugins existed side by side (Mock_spectro, and the teaching one elsewhere).After:
BSCameraalso shows what a camera driver gives its plugin, andCookbookSpectrometerreplacesMock_spectroas the one spectrometer, with the interface of the spectrometer extension.What changes:
BSCamera(andhardware/beam_steering.py): a hardware ROI and a binning applied by the camera (smaller image), an exposure time that scales the signal, and axes in um (pixel size) that follow the ROI and the binning. Defaults give the same image as before (full sensor, 100 ms), except that the axes are now in um.BSPhotodiodestill reads the whole sensor.RoiStuffkeeps the software ROI example and follows the hardware ROI.CookbookSpectrometer: 1D detector with a wavelength axis in nm asked to the instrument at every grab, laser line, exposure time, andget/set_spectro_wl,get/set_laser_wl,get/set_exposure_msfor the spectrometer extension; plus an actuator for the central wavelength that is a slave of the detector (shared instrument, homing that waits for its end and callsmove_done). The simulated spectrometer (hardware/spectrometer.py) is adapted frompymodaq_plugins_teaching.Mock_spectrois removed, without alias (a note in the README). A saved preset using it must pickCookbookSpectrometer.MockSpectroErrorsnow builds onCookbookSpectrometer: one line instead of two gaussians.CONTEXT.mdvocabulary (hardware ROI, calibrated axis).How: new tests in
tests/test_bs_camera.py(shape, axes after ROI and binning, exposure) andtests/test_cookbook_spectrometer.py(axis centred on the central wavelength, line at the right place, master/slave, extension interface, errors variant). Full suite: 143 passed, 3 skipped, run locally with the offscreen platform. Nothing was tested on real hardware, the recipes run on simulated devices.🤖 Generated with Claude Code
https://claude.ai/code/session_01Tdiso1u1ZhikSutj2Qs5Cg