HyperBB: add binary calibration file support (.hbb_cal / .hbb_tcal)#13
Draft
HyperBB: add binary calibration file support (.hbb_cal / .hbb_tcal)#13
Conversation
… formats Co-authored-by: doizuc <6456289+doizuc@users.noreply.github.com>
…ing, add doc comment Co-authored-by: doizuc <6456289+doizuc@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add support for updated data and calibration file formats
HyperBB: fix broken scipy interp2d removal, add new calibration and data formats
Mar 13, 2026
Member
|
@copilot The instrument output the same data formats as before, please remove the new 'standard' format and keep the current light, advanced, and legacy output format. |
…dd explicit cal_format UI Co-authored-by: doizuc <6456289+doizuc@users.noreply.github.com>
Author
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. |
Copilot
AI
changed the title
HyperBB: add new calibration format
HyperBB: add binary calibration file support (.hbb_cal / .hbb_tcal)
Mar 16, 2026
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.
scipy.interpolate.interp2dwas removed in scipy 1.14.0, making HyperBB completely non-functional. This PR fixes that and adds support for the 2025 Sequoia calibration file format update, while keeping backward compatibility with existing users.Critical fix: interp2d → RegularGridInterpolator
All three dark-offset interpolators and the temperature correction interpolation now use
RegularGridInterpolator. The temperature grid is pre-computed once in__init__over 0–50°C (resolves an existingTODO optimizecomment):New binary calibration file format
Sequoia now ships binary calibration files (
.hbb_calfor plaque,.hbb_tcalfor temperature) produced byHbb_ConvertCalibrations.m. The calibration format is selected explicitly in the Setup dialog:cal_format='legacy'): two separate.matfiles — a plaque file (containing acalstruct) and a temperature file (containing acal_tempstruct). Behaviour unchanged for existing users.cal_format='current'): binary.hbb_calplaque file + binary.hbb_tcaltemperature file. Both files are required for live data temperature correction.Two new static methods implement the binary readers following the exact format defined in
Hbb_ReadBinaryCalFile.mandHbb_ReadBinaryTempCalFile.m(Sequoia Scientific, 2024):_read_binary_plaque_cal()— reads the fixed 72-byte header then variable-length wavelength, gain, and dark-offset arrays. 2-D dark offset arrays are reshaped with Fortran (column-major) order to match MATLAB'sfwrite/reshapebehaviour. Handles multiple appended records and returns the last (consistent with MATLAB'scal = cal(end)). Returns a dict with the same field names as the legacy.matcalstruct so no downstream changes are required._read_binary_temp_cal()— reads wavelengths and polynomial coefficient matrix (column-major). Returns{'wl': ..., 'coeff': ...}compatible with the legacy.matcal_tempstruct.Data output formats
Data output formats are unchanged:
legacy,advanced, andlightare the only supported formats.Setup UI changes
legacy/current) in the Calibration Files group..mat(legacy) and.hbb_cal/.hbb_tcal(current) files.📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.