[SciPy-User] trouble loading one .mat file

Angus McMorland amcmorl at gmail.com
Fri May 7 16:28:21 EDT 2010


Hi all,

After upgrading to svn scipy 0.8.0.dev6369, to take advantage of Matthew
Brett's bugfix to the scipy.io code (thanks for that, Matthew), I now have
one matlab file which I cannot load using scipy.io.loadmat. Trying it gives
the following error:

/usr/local/lib/python2.6/dist-packages/scipy/io/matlab/mio5.pyc in
get_variables(self, variable_names)
    397         mdict['__globals__'] = []
    398         while not self.end_of_stream():
--> 399             hdr, next_position = self.read_var_header()
    400             name = hdr.name
    401             if name == '':

/usr/local/lib/python2.6/dist-packages/scipy/io/matlab/mio5.pyc in
read_var_header(self)
    352         next_pos = self.mat_stream.tell() + byte_count
    353         if mdtype == miCOMPRESSED: # make new stream from compressed
data
--> 354             stream =
StringIO(zlib.decompress(self.mat_stream.read(byte_count)))
    355             self._matrix_reader.set_stream(stream)
    356             mdtype, byte_count = self._matrix_reader.read_full_tag()

error: Error -5 while decompressing data

I could definitely read this file before using the ubuntu karmic package
0.7.0-2, but I've also upgraded to lucid recently and I'm unsure whether I
had successfully read it with lucid and packaged scipy before upgrading to
scipy svn. In any case, a number of very similar files can be read fine
using the new setup and a colleague has verified that the problem file can
be opened with Matlab okay.

Has anyone come across and solved this sort of problem before, or have any
idea what might be causing it? It seems impolite to distribute the file on
the list here, but I could send it to someone who has the capability to
tackle debugging the problem.

Many thanks,

Angus.
-- 
AJC McMorland
Post-doctoral research fellow
Neurobiology, University of Pittsburgh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20100507/ee43044f/attachment.html>


More information about the SciPy-User mailing list