aqnwb 0.1.0
Loading...
Searching...
No Matches
TimeSeries.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4
5#include "BaseIO.hpp"
7
8namespace AQNWB::NWB
9{
13class TimeSeries : public Container
14{
15public:
33 TimeSeries(const std::string& path,
34 std::shared_ptr<BaseIO> io,
36 const std::string& unit,
37 const std::string& description = "no description",
38 const std::string& comments = "no comments",
39 const SizeArray& dsetSize = SizeArray {0},
40 const SizeArray& chunkSize = SizeArray {1},
41 const float& conversion = 1.0f,
42 const float& resolution = -1.0f,
43 const float& offset = 0.0f);
44
49
60 Status writeData(const std::vector<SizeType>& dataShape,
61 const std::vector<SizeType>& positionOffset,
62 const void* data,
63 const void* timestamps = nullptr);
64
69 void initialize();
70
74 std::unique_ptr<BaseRecordingData> data;
75
79 std::unique_ptr<BaseRecordingData> timestamps;
80
85
90
96 std::string unit;
97
101 std::string description;
102
106 std::string comments;
107
113
118
124
130
135 float offset;
136
140 float startingTime = 0.0;
141
142private:
146 std::string neurodataType = "TimeSeries";
147};
148} // namespace AQNWB::NWB
AQNWB::Types::SizeArray SizeArray
Definition BaseIO.hpp:15
Represents a base data type.
Definition BaseIO.hpp:35
static const BaseDataType F64
Accessor for 64-bit floating point.
Definition BaseIO.hpp:76
Abstract data type for a group storing collections of data and metadata.
Definition Container.hpp:15
General purpose time series.
Definition TimeSeries.hpp:14
std::unique_ptr< BaseRecordingData > timestamps
Pointer to timestamp values.
Definition TimeSeries.hpp:79
SizeArray chunkSize
Chunking size used in dataset creation.
Definition TimeSeries.hpp:117
std::string comments
Human-readable comments about the TimeSeries.
Definition TimeSeries.hpp:106
Status writeData(const std::vector< SizeType > &dataShape, const std::vector< SizeType > &positionOffset, const void *data, const void *timestamps=nullptr)
Writes a timeseries data block to the file.
Definition TimeSeries.cpp:56
~TimeSeries()
Destructor.
Definition TimeSeries.cpp:33
float conversion
Scalar to multiply each element in data to convert it to the specified ‘unit’.
Definition TimeSeries.hpp:123
SizeArray dsetSize
Size used in dataset creation. Can be expanded when writing if needed.
Definition TimeSeries.hpp:112
BaseDataType timestampsType
Data type of the timestamps (float64).
Definition TimeSeries.hpp:89
float resolution
Smallest meaningful difference between values in data, stored in the specified by unit.
Definition TimeSeries.hpp:129
BaseDataType dataType
Data type of the data.
Definition TimeSeries.hpp:84
void initialize()
Initializes the TimeSeries by creating NWB related attributes and writing the description and comment...
Definition TimeSeries.cpp:35
float offset
Scalar to add to the data after scaling by ‘conversion’ to finalize its coercion to the specified ‘un...
Definition TimeSeries.hpp:135
float startingTime
The starting time of the TimeSeries.
Definition TimeSeries.hpp:140
std::string unit
Base unit of measurement for working with the data. Actual stored values are not necessarily stored i...
Definition TimeSeries.hpp:96
std::unique_ptr< BaseRecordingData > data
Pointer to data values.
Definition TimeSeries.hpp:74
TimeSeries(const std::string &path, std::shared_ptr< BaseIO > io, const BaseDataType &dataType, const std::string &unit, const std::string &description="no description", const std::string &comments="no comments", const SizeArray &dsetSize=SizeArray {0}, const SizeArray &chunkSize=SizeArray {1}, const float &conversion=1.0f, const float &resolution=-1.0f, const float &offset=0.0f)
Constructor.
Definition TimeSeries.cpp:8
std::string description
The description of the TimeSeries.
Definition TimeSeries.hpp:101
Status
Represents the status of an operation.
Definition Types.hpp:22
Namespace for all classes related to the NWB data standard.
Definition TimeSeries.hpp:9