Repository navigation
Read Igor Pro 8 binary wave version 7 names - #33
CAOShurong wants to merge 1 commit into
Conversation
A wave whose name is longer than 31 bytes is written as version 7. igor2 rejected that version, so packed.load dropped the record. The name follows the version 5 sections and replaces the placeholder in bname. Fixes AFM-analysis#32
|
It would be nice to have an actual (ideally stripped for size) test measurement file. Could you please add that to the PR? |
|
I looked for a version 7 measurement to add. The experiment attached on #28, Test.pxp, is 10,170,354 bytes and walks as 465 records with 336 waves. Every wave header is version 5, and the file does not contain I do not have Igor Pro here, so I cannot save a new wave and strip it. The tests in this PR still start from the checked-in version 5 samples and set the version, the length at offset 56, and the trailing name to the layout in #32. @jilavsky if you still have a small experiment that Igor wrote with one of these waves, that file is the fixture this needs. |
|
TestLongNames_liberal.pxp.zip Thank you. |

Igor Pro 8 writes a binary wave as version 7 when its name is longer than 31 bytes. igor2 only accepts versions 1, 2, 3, and 5, so loading that record raises
invalid binary wave version: 7and the wave is dropped from a packed experiment.Version 7 keeps the version 5 layout.
optionsSize1, which the older format note says to ignore, is the length of the name that follows the last version 5 section. Those bytes are not NUL-terminated. Whenbnameis the placeholder:wave name too long:, it is replaced with that name. A version 7 wave withoptionsSize1of 0 keeps the short name already stored inbname. IfoptionsSize1is non-zero butbnameis not the placeholder, the extra bytes are still read and the short name is left unchanged.optionsSize2is still ignored.Fixes #32
Verification
On master, the new tests raise
invalid binary wave version: 7. After the change,pytest testson Windows with Python 3.13: 27 passed. The version 7 cases start from the existing Windows and Macintosh version 5 sample waves, including the 32-byte name from the report and a longer name, and are read both as.ibwfiles and as type 3 records in a packed experiment.flake8passed.An Igor Pro experiment that already contains a version 7 wave was not available. The cases above are version 5 samples with the version field,
optionsSize1, and the trailing name set to the layout described in the report.