Skip to content

Carry behaviour alignment into NWB files #129

Description

@celefthe

Follow-up to #128. align writes /timestamps_aligned to HDF5 only. NWB files link DeltaFSeries.timestamps to the ISO /timestamps dataset and keep the first raw frame as session_start_time, so an aligned session's NWB file carries no behaviour alignment. Updating an existing NWB file in place is not possible

Suggested fix:

  • io.read_timestamps_aligned: for an NWB path, resolve the linked _preprocessed.h5 (move register.linked_preprocessed_path into io, keep a re-export) and read /timestamps_aligned from it. This gives process regression, smooth, zscore and regions NWB support with no further changes.
  • align: accept an NWB path and resolve the linked _preprocessed.h5 the same way, writing to that file.
  • export nwb: when the linked HDF5 has /timestamps_aligned, set session_start_time and timestamps_reference_time from the session_start_time attr (localised with tzlocal if naive) and replace DeltaFSeries.timestamps with the float64 aligned array before NWBHDF5IO.export. Do the same for RegisteredSeries when its linked _registered.h5 is aligned. Set the fields through container.fields[...] plus set_modified()

Activity

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

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions