From 86efbfe6cd192cceff5aa41d576d574a22ff2dc7 Mon Sep 17 00:00:00 2001 From: Steph Prince <40640337+stephprince@users.noreply.github.com> Date: Thu, 23 May 2024 10:55:25 -0700 Subject: [PATCH] set timestamps interval to 1 to match nwb schema --- src/BaseIO.cpp | 7 +++---- src/BaseIO.hpp | 3 +-- src/nwb/NWBFile.cpp | 3 +-- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/BaseIO.cpp b/src/BaseIO.cpp index 6e7c369b..d4971736 100644 --- a/src/BaseIO.cpp +++ b/src/BaseIO.cpp @@ -75,11 +75,10 @@ Status BaseIO::createDataAttributes(const std::string& path, return Status::Success; } -Status BaseIO::createTimestampsAttributes(const std::string& path, - const float& interval) +Status BaseIO::createTimestampsAttributes(const std::string& path) { - createAttribute( - BaseDataType::F32, &interval, path + "/timestamps", "interval"); + int interval = 1; + createAttribute(BaseDataType::I32, static_cast(&interval), path + "/timestamps", "interval"); createAttribute("seconds", path + "/timestamps", "unit"); return Status::Success; diff --git a/src/BaseIO.hpp b/src/BaseIO.hpp index 60104f01..6fa39ae5 100644 --- a/src/BaseIO.hpp +++ b/src/BaseIO.hpp @@ -291,8 +291,7 @@ class BaseIO * @param interval Value is '1' * @return The status of the operation. */ - Status createTimestampsAttributes(const std::string& path, - const float& interval); + Status createTimestampsAttributes(const std::string& path); /** * @brief Returns true if the file is open. * @return True if the file is open, false otherwise. diff --git a/src/nwb/NWBFile.cpp b/src/nwb/NWBFile.cpp index 80fdb184..5ea0f851 100644 --- a/src/nwb/NWBFile.cpp +++ b/src/nwb/NWBFile.cpp @@ -148,8 +148,7 @@ Status NWBFile::startRecording(std::vector recordingArrays) SizeArray {0}, SizeArray {CHUNK_XSIZE}, electricalSeries->getPath() + "/timestamps"); - io->createTimestampsAttributes(electricalSeries->getPath(), - 1 / channelGroup[0].getSamplingRate()); + io->createTimestampsAttributes(electricalSeries->getPath()); electricalSeries->channelConversion = createRecordingData( BaseDataType::F32,