sccn / xdf

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error during jitter removal: 'numpy.ndarray' object has no attribute 'append'

gleslie opened this issue · comments

I am receiving this error when attempting to load an xdf file using the Python library with the following command:

%pylab
%matplotlib inline
rcParams['figure.figsize']=(12,6)
from xdf import *
fn = '/home/brain/1046.xdf'
streams = load_xdf(fn)

Output:
Importing XDF file /home/1046.xdf...
read tag: 1 at 8 bytes, length=58
read tag: 2 at 71 bytes, length=2200
found stream VAmp-0-EEG
read tag: 2 at 2276 bytes, length=658
...
...
...
read tag: 6 at 365323686 bytes, length=39161
read tag: 6 at 365362852 bytes, length=41614
reached end of file.
performing clock synchronization...
performing jitter removal...

AttributeErrorTraceback (most recent call last)
in ()
----> 1 streams = load_xdf(fn)

/home/brain/xdf.pyc in load_xdf(filename, on_chunk, verbose, synchronize_clocks, handle_clock_resets, dejitter_timestamps, jitter_break_threshold_seconds, jitter_break_threshold_samples, clock_reset_threshold_seconds, clock_reset_threshold_stds, clock_reset_threshold_offset_seconds, clock_reset_threshold_offset_stds, winsor_threshold)
362 print(' performing jitter removal...')
363 temp = _jitter_removal(temp, jitter_break_threshold_seconds,
--> 364 jitter_break_threshold_samples,)
365 else:
366 for stream in temp.values():

/home/brain/xdf.pyc in _jitter_removal(streams, break_threshold_seconds, break_threshold_samples)
531 indices = np.arange(range_i[0], range_i[1]+1, 1)
532 tmp_duration = len(indices)
--> 533 num_samples.append(tmp_duration)
534 duration = (stream.time_stamps[range_i[1]] -
535 stream.time_stamps[range_i[0]])

AttributeError: 'numpy.ndarray' object has no attribute 'append'

Hi @gleslie ,

I was having the same issue. I've fixed it in this pull request.

~SeeJayDee