chaosmagpy.data_utils.load_matfile

chaosmagpy.data_utils.load_matfile(filepath, variable_names=None, **kwargs)[source]

Load mat-file and return dictionary.

Function loads mat-file by traversing the structure converting data into low-level numpy arrays of different types. There is no guarantee that any kind of data is read in correctly. The data dtype can also vary depending on the mat-file (v7.3 returns floats instead of integers). But it should work identically for v7.3 and prior mat-files. Arrays are squeezed if possible. Relies on the hdf5storage package.

Parameters:
filepathstr

Filepath and name of mat-file.

variable_nameslist of strings

Top-level variables to be loaded.

**kwargskeywords

Additional keyword arguments are passed to hdf5storage.loadmat().

Returns:
datadict

Dictionary containing the data as dictionaries or numpy arrays.