Skip to content

Commit

Permalink
set timestamps interval to 1 to match nwb schema
Browse files Browse the repository at this point in the history
  • Loading branch information
stephprince committed May 23, 2024
1 parent 9938a71 commit 86efbfe
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
7 changes: 3 additions & 4 deletions src/BaseIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<const void*>(&interval), path + "/timestamps", "interval");
createAttribute("seconds", path + "/timestamps", "unit");

return Status::Success;
Expand Down
3 changes: 1 addition & 2 deletions src/BaseIO.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 1 addition & 2 deletions src/nwb/NWBFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,7 @@ Status NWBFile::startRecording(std::vector<Types::ChannelGroup> 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,
Expand Down

0 comments on commit 86efbfe

Please sign in to comment.