slaclab / lcls-tools

Python tools for LCLS: post processing data, PV handling, pulling archive settings, etc.
Apache License 2.0
2 stars 18 forks source link

Parsing .mat generated by the latest matlab requires h5py, which is very different from using scipy. #167

Open MichaelEhrlichman opened 1 month ago

MichaelEhrlichman commented 1 month ago

I encountered this bug when looking at https://github.com/slaclab/lcls-tools/blob/main/examples/matlab_image_analysis.py

The error message is:

Error loading mat file ProfMon-PROF_COL0_535-2024-06-09-175304.mat: Please use HDF reader for matlab v7.3 files, e.g. h5py

Note that using h5py to parse .mat files is very different from using scipy and can be rather awkward.

MattKing06 commented 1 month ago

Hi @MichaelEhrlichman, would it be possible for you to upload the matlab file in question. I've tried testing this example with the datasets we have in the test directory and they must have been created with a different version of matlab as I didn't get the error you mention.

It'd be good to get coverage for files with differing matlab versions.

MichaelEhrlichman commented 1 month ago

OrbitGrid--2023-06-04-152116.mat.gz

MichaelEhrlichman commented 1 month ago

Check out the static/bpmList data type. Here is a Slack discussion on this topic. https://slac.slack.com/archives/C9UN7J97B/p1718063303838939