tbeu / matio

MATLAB MAT File I/O Library
https://matio.sourceforge.io
BSD 2-Clause "Simplified" License
330 stars 97 forks source link

Update mat5.c to support uncompressed MAT file generated by SWAN #149

Closed dpzimmer closed 3 years ago

dpzimmer commented 3 years ago

Slight modification to Mat_VarReadNextInfo5() to allow MAT_T_INT32 in addition to MAT_T_UINT32 to indicate processing of array_flags.

This formatting was encountered processing older .mat files created by older versions of the swan model (https://www.tudelft.nl/en/ceg/about-faculty/departments/hydraulic-engineering/sections/environmental-fluid-mechanics/research/swan/).

I have no idea if this violates the file format specification, but Matlab and libmat.lib both read such files without complaint.

coveralls commented 3 years ago

Coverage Status

Coverage increased (+0.6%) to 83.177% when pulling 66213240c85d8660258d2f445fc720479ceda803 on dpzimmer:support-older-format-output-by-swan-model into 812b98aa4ae1eff7455aaf72654a8a8925aa9ac1 on tbeu:master.

coveralls commented 3 years ago

Coverage Status

Coverage increased (+0.6%) to 83.176% when pulling 46e27aa66be497b47deb66a5472fed54c7e01924 on dpzimmer:support-older-format-output-by-swan-model into 812b98aa4ae1eff7455aaf72654a8a8925aa9ac1 on tbeu:master.

tbeu commented 3 years ago

Thanks for your contribution.

That particular check occurs six times in mat5.c and I guess, it needs to be fixed everywhere consistently.

Do you have an example file that you could share. Thanks.

dpzimmer commented 3 years ago

Thanks for your contribution.

That particular check occurs six times in mat5.c and I guess, it needs to be fixed everywhere consistently.

Do you have an example file that you could share. Thanks.

example attached;

swan.zip

tbeu commented 3 years ago

Thanks for the MAT file.

I also checked the sources of SWAN and it is exactly that one relevant line that needs to be adapted.