ercius / openNCEM

A collection of packages and tools for electron microscopy data analysis supported by the National Center for Electron Microscopy facility of the Molecular Foundry
GNU General Public License v3.0
60 stars 28 forks source link

Unsupported tag breaks DM reading #55

Closed ercius closed 1 year ago

ercius commented 1 year ago

A user brought a DM file to me which could not be read.

We found out a tag in the file called Saturation fraction has values that look like this: [ inf 0.00218585 0.00237532 0.00249739 0.0026716 0.00234353 ...

The inf cant be processed properly by the fileDM._bin2str function.

In the DM tag tree, this tag is printed with a value that indicates it "can not be displayed" and might not be that useful.

The solution is to wrap a try statement around the return of _bin2str() and return some other string (like "can not be read") instead. Then the file data can be loaded properly.