neuromodulation / py_neuromodulation

Real-time analysis of intracranial neurophysiology recordings.
https://neuromodulation.github.io/py_neuromodulation/
MIT License
42 stars 9 forks source link

Bug when adding labels to features which unenven sampling rates #283

Closed timonmerk closed 8 months ago

timonmerk commented 8 months ago
    offset_start = np.ceil(offset_time / 1000 * fs).astype(int)
    data = raw_arr_data[ind_label, offset_start:]
    if data.ndim == 1:
        data = np.expand_dims(data, axis=0)
    label_downsampled = data[
        :,
        :: int(np.ceil(fs / settings["sampling_rate_features_hz"])),
    ]

This needs to be adapted s.t. the resampling is not performed based on rounded int's.

-> This raises the question why the label needs to be added afterwards..