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()
Follow-up to #128.
alignwrites/timestamps_alignedto HDF5 only. NWB files linkDeltaFSeries.timestampsto the ISO/timestampsdataset and keep the first raw frame assession_start_time, so an aligned session's NWB file carries no behaviour alignment. Updating an existing NWB file in place is not possibleSuggested fix:
io.read_timestamps_aligned: for an NWB path, resolve the linked_preprocessed.h5(moveregister.linked_preprocessed_pathintoio, keep a re-export) and read/timestamps_alignedfrom it. This givesprocess regression,smooth,zscoreandregionsNWB support with no further changes.align: accept an NWB path and resolve the linked_preprocessed.h5the same way, writing to that file.export nwb: when the linked HDF5 has/timestamps_aligned, setsession_start_timeandtimestamps_reference_timefrom thesession_start_timeattr (localised withtzlocalif naive) and replaceDeltaFSeries.timestampswith the float64 aligned array beforeNWBHDF5IO.export. Do the same forRegisteredSerieswhen its linked_registered.h5is aligned. Set the fields throughcontainer.fields[...]plusset_modified()