40 #ifndef DATRW_TSOFTDATA_H_VERSION 42 #define DATRW_TSOFTDATA_H_VERSION \ 43 "DATRW_TSOFTDATA_H V1.2" 52 #include<datrwxx/tsoftconfig.h> 98 extern const char*
NSP;
104 typedef std::vector<std::string>
Tvos;
108 typedef std::list<std::string>
Tlos;
112 typedef std::vector<double>
Tvod;
120 const std::string& delimiter=
":");
127 void trimws(std::string& line);
144 Line(
const std::string &line);
209 typedef std::vector<Channelinfo>
Tvoci;
227 double sample(
const int& i)
const;
281 double sample(
const unsigned int& i)
const 284 "illegal sample index");
313 typedef std::vector<Datatrace>
Tvodt;
325 void push_sample(
const libtime::TAbsoluteTime& time,
327 const double& undetval,
328 const libtime::TRelativeTime&
dt,
330 const bool& debug=
false);
335 "illegal trace index");
342 "illegal trace index");
378 typedef std::vector<Channeldata>
Tvocd;
393 const double& undetval,
394 const libtime::TRelativeTime&
dt,
395 const bool& debug=
false);
398 const bool& debug=
false)
405 const bool& debug=
false)
const 438 "illegal channel index");
450 #endif // DATRW_TSOFTDATA_H_VERSION (includeguard) void append(const double &v)
append sample
config parameters for data extractionThese parameters control the way gaps in the input data are hand...
void push_sample(const libtime::TAbsoluteTime &time, const double &value, const double &undetval, const libtime::TRelativeTime &dt, const ReaderConfig &rc, const bool &debug=false)
push a sample
libtime::TAbsoluteTime timeofnextsample(const bool &debug=false) const
return time of next sample after last samples
Channelinfo & chinfo()
return channel info
std::vector< Channelinfo > Tvoci
vector of channel info.
ReaderConfig Mreaderconfig
reader configuration
std::string thetag() const
return tag
#define DATRW_assert(C, M)
Check an assertion and report by throwing an exception.
std::list< std::string > Tlos
list of strings.
std::string Mcontent
the content part of the line
Tvod Msamples
vector of data values
Tvocd Mchannels
data sequences
std::vector< Datatrace > Tvodt
vector of sequences.
int ntraces() const
number of data traces
Channeldata()
constructor to initialize
const char * tagdata
TSOFT data tag.
std::string Mline
the data line
trace of contiguous data.
contains takes one line and splits it into tag and information.
const std::string & thedatatype() const
return datatype
libtime::TRelativeTime Minterval
sampling interval
void setunits(const std::string &line)
set unit info
bool Mhascontent
true if this line has a content
libtime::TAbsoluteTime time() const
return time
const std::string & theunits() const
return units
std::vector< std::string > Tvos
vector of strings.
libtime::TRelativeTime dt()
return sampling interval of HPMO data acquisition (i.e. 5 sec)
std::string Minstrument
instrument field in channel name
const char * tagbegin
first character of TSOFT tag
Line(const std::string &line)
constructor: swallow line
void series(const Tdseries &s)
set series
double sample(const int &i) const
return specific sample
libtime::TRelativeTime interval() const
return sampling interval
Dataline(const std::string &line)
swallow a line
int nsamples() const
return number of samples in line
const char * tagtimeformat
TSOFT timeformat tag.
bool Mhastag
true if this line contains a tag
aff::Series< double > Tdseries
libtime::TAbsoluteTime Mdate
time of first sample
int nsamples() const
return number of samples
int nchannels() const
return number of channels
std::vector< double > Tvod
vector of doubles.
const Datatrace & trace(const unsigned int &i) const
return data trace
sequence of contiguous data.
Tdseries series() const
return samples in a series container
exception class declaration for libdatrwxx (prototypes)
std::string Mline
the actual line
libtime::TRelativeTime Minterval
sampling interval
libtime::TAbsoluteTime Mdate
time of first sample
void trimws(std::string &line)
helper function trimws
void interval(const libtime::TRelativeTime i)
set sampling interval
libtime::TRelativeTime interval() const
return sampling interval
libtime::TAbsoluteTime date() const
return time of first sample
Tdseries series() const
return series
std::string thecontent() const
return content
void resizetoindex(const unsigned int &i)
resize to index
std::string Mtag
the tag part of the line
const char * tagunits
TSOFT units tag.
libtime::TAbsoluteTime Mtime
time
const char * tagincrement
TSOFT increment tag.
const std::string & theinstrument() const
return instrument
Root namespace of library.
void chinfo(const Channelinfo &ci)
set channel info
const Channeldata & operator[](const unsigned int &i) const
return data for specific channel
const char * tagend
last character of TSOFT tag
const Channelinfo & chinfo() const
return channel info
void initialize()
initialize data sequence
Channelinfo()
standard constructor
Tlos channelinfofree(const Channelinfo &ci)
prepare free comment block from channel info
void setchannelinfo(const std::string &line)
set channel info
Tvos stringtovec(const std::string &line, const std::string &delimiters)
helper function stringtok
libtime::TAbsoluteTime date() const
return time of first sample
Datacontainer()
Default constructor.
std::string Mlocation
location field in channel name
const std::string & thelocation() const
return location
const char * NSP
value not specified
Datatrace & trace(const unsigned int &i)
return data trace
void flushcollector()
function to flush collector to vector of sequences
void checkindex(const unsigned int &i) const
check index
Channeldata & operator[](const unsigned int &i)
return data for specific channel
std::vector< Channeldata > Tvocd
vector of channels.
Datacontainer(const ReaderConfig &rc)
Config constructor.
void date(const libtime::TAbsoluteTime d)
set time of first sample
Datasequence Mcollector
vector of samples to collect from file
const char * tagfileid
TSOFT fileid tag.
void push_data(const std::string &line, const double &undetval, const libtime::TRelativeTime &dt, const bool &debug=false)
push a data line
void flushchannels()
flush all channels
void resetcollector()
function to reset collector
void date(const libtime::TAbsoluteTime d)
set time of first sample
const char * tagchannels
TSOFT channels tag.
const Channeldata & channel(const unsigned int &i, const bool &debug=false) const
return data for specific channel
double sample(const unsigned int &i) const
return sample
std::string Mdatatype
data type field in channel name
Tvod vectorofsamples() const
return vector of samples
Channeldata & channel(const unsigned int &i, const bool &debug=false)
return data for specific channel
void interval(const libtime::TRelativeTime i)
set sampling interval
bool hascontent() const
check whether this line has a content
bool hastag() const
check whether this line has a tag
std::string getDOSline(std::istream &is)
helper function getDOSline
const char * tagundetval
TSOFT undetval tag.
std::string theline() const
return line
Channelinfo Mchannelinfo
channel info