Skip to content

Blackrock files may have events out of temporal order creating spurious segments #1181

Closed

Description

@cboulay

It's technically possible to get events with timestamps that are newer than a subsequent event. The file_spec_3_0 file I submitted has this issue. It only seems to happen with cbPKTTYPE_PREVREP packets, and these are packets that are not even handled by python-neo.

I will check with Blackrock to see if there's a reason these packets are being saved in the nev file; maybe they can be removed.

Even if they can be removed, should we change how python-neo identifies segment boundaries so that unhandled packet types are ignored in segment identification?

jump_ids = \
np.where(np.diff(np.asarray(raw_event_data['timestamp'], dtype=int)) < 0)[0] + 1

Can be changed to

# Only consider handled events.
mask_any = np.any(np.vstack([value[nev_data_masks[key]] for key, value in masks.items()]), axis=0)
jump_ids = np.where(
    raw_event_data['timestamp'][mask_any][1:] < raw_event_data['timestamp'][mask_any][:-1]
)[0] + 1
jump_ids = np.where(mask_any)[0][jump_ids]  # Get back in original indices.

I can add this to the FileSpec 3.0 PR but I think it can be applied to spec 2.3 just as well.

Activity

  1. samuelgarcia commented on Oct 10, 2022

    @samuelgarcia
    Contributor

    Hi Chadwick,
    tanks for caching this.
    Go for this, the patch is OK

  2. added this to the 0.12.0 milestone on Oct 17, 2022
  3. JuliaSprenger commented on Oct 17, 2022

    @JuliaSprenger
    Member

    Hi @cboulay Thanks for digging into this. Did you get any response from BlackRock regarding these events? If these are not revelant for the actual recording data then we can ignore them in neo.

  4. modified the milestones: 0.12.0, 0.11.1 on Oct 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions