pyreiz / pyliesl

LieSL is a collection of modules to read and process labstreaminglayer streams on the fly
MIT License
5 stars 5 forks source link

Problem with dejittering time stamps #6

Closed wtianlu closed 3 years ago

wtianlu commented 3 years ago

During loading, pyxdf.load_xdf automatically tries to dejitter the timestamps. This requires a linear regression on the measured timestamps. This step apparently failed. Error message: Error reading chunk length Traceback (most recent call last): File "/home/tianlu/anaconda3/lib/python3.8/site-packages/pyxdf/pyxdf.py", line 237, in load_xdf chunklen = _read_varlen_int(f) File "/home/tianlu/anaconda3/lib/python3.8/site-packages/pyxdf/pyxdf.py", line 487, in _read_varlen_int raise RuntimeError("invalid variable-length integer encountered.") RuntimeError: invalid variable-length integer encountered. got zero-length chunk, scanning forward to next boundary chunk.

Intel MKL ERROR: Parameter 6 was incorrect on entry to DGELSD.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/tianlu/anaconda3/lib/python3.8/site-packages/liesl/files/xdf/load.py", line 147, in XDFFile
streams, _ = pyxdf.load_xdf(filename=str(filename))
File "/home/tianlu/anaconda3/lib/python3.8/site-packages/pyxdf/pyxdf.py", line 377, in load_xdf
temp = _jitter_removal(
File "/home/tianlu/anaconda3/lib/python3.8/site-packages/pyxdf/pyxdf.py", line 661, in _jitter_removal
mapping = np.linalg.lstsq(X, y, rcond=-1)[0]
File "<**array_function** internals>", line 5, in lstsq
File "/home/tianlu/anaconda3/lib/python3.8/site-packages/numpy/linalg/linalg.py", line 2306, in lstsq
x, resids, rank, s = gufunc(a, b, rcond, signature=signature, extobj=extobj)
File "/home/tianlu/anaconda3/lib/python3.8/site-packages/numpy/linalg/linalg.py", line 100, in _raise_linalgerror_lstsq
raise LinAlgError("SVD did not converge in Linear Least Squares")
numpy.linalg.LinAlgError: SVD did not converge in Linear Least Squares

Loading the file with pyxdf.load_xdf(filename=str(filename), dejitter_timestamps=False) works.

Thanks Robert! :smile:

agricolab commented 3 years ago

Works in my machine with Linux mint and an AMD CPU.

Might be linked: https://stackoverflow.com/questions/59020503/intel-mkl-error-preventing-me-importing-scipy-in-python

You can try to update numpy? Or reinstall python on your windows machine? Did you try running it from the anaconda prompt?

agricolab commented 3 years ago

Closing this because of inactivity.