1 #ifndef _BASICTIMESERIES_H_
2 #define _BASICTIMESERIES_H_
4 #include <boost/archive/text_iarchive.hpp>
5 #include <boost/archive/text_oarchive.hpp>
63 double time(
const int i)
const
65 return(
mt0+
mdt*
static_cast<double>(i));
76 return(round((t-
mt0)/
mdt));
84 return(
mt0 + (
static_cast<double>(
nsamp) - 1.0)*
mdt);
90 return t0shift_is_valid;
118 t0shift_is_valid=
true;
129 virtual void ator(
const double tshift);
145 virtual void shift(
const double dt);
157 double dt()
const {
return this->
mdt;};
166 bool time_is_relative()
const
186 double t0()
const {
return this->
mt0;};
198 virtual void set_dt(
const double sample_interval)
282 bool t0shift_is_valid;
287 friend boost::serialization::access;
288 template<
class Archive>
289 void serialize(Archive& ar,
const unsigned int version)
296 ar & t0shift_is_valid;
Base class for time series objects.
Definition: BasicTimeSeries.h:35
BasicTimeSeries()
Definition: BasicTimeSeries.cc:42
size_t nsamp
Definition: BasicTimeSeries.h:268
virtual void set_dt(const double sample_interval)
Set the sample interval.
Definition: BasicTimeSeries.h:198
void set_live()
Definition: BasicTimeSeries.h:155
bool shifted() const
Definition: BasicTimeSeries.h:88
double samprate() const
Definition: BasicTimeSeries.h:178
virtual void rtoa()
Definition: BasicTimeSeries.cc:21
virtual ~BasicTimeSeries()
Virtual destructor.
Definition: BasicTimeSeries.h:56
size_t npts() const
Definition: BasicTimeSeries.h:183
virtual void shift(const double dt)
Definition: BasicTimeSeries.cc:76
virtual void set_npts(const size_t npts)
Set the number of samples attribute for data.
Definition: BasicTimeSeries.h:213
double time(const int i) const
Definition: BasicTimeSeries.h:63
double t0() const
Definition: BasicTimeSeries.h:186
bool mlive
Definition: BasicTimeSeries.h:256
double time_reference() const
Definition: BasicTimeSeries.cc:86
bool live() const
Definition: BasicTimeSeries.h:147
bool dead() const
Definition: BasicTimeSeries.h:149
BasicTimeSeries & operator=(const BasicTimeSeries &parent)
Definition: BasicTimeSeries.cc:62
bool time_is_UTC() const
Definition: BasicTimeSeries.h:159
void force_t0_shift(const double t)
Force a t0 shift value on data.
Definition: BasicTimeSeries.h:115
TimeReferenceType tref
Definition: BasicTimeSeries.h:278
int sample_number(double t) const
Definition: BasicTimeSeries.h:74
virtual void set_t0(const double t0in)
Set the data start time.
Definition: BasicTimeSeries.h:228
void set_tref(const TimeReferenceType newtref)
Force the time standard.
Definition: BasicTimeSeries.h:243
void kill()
Definition: BasicTimeSeries.h:151
virtual void ator(const double tshift)
Definition: BasicTimeSeries.cc:9
double mdt
Definition: BasicTimeSeries.h:260
double mt0
Definition: BasicTimeSeries.h:264
double dt() const
Definition: BasicTimeSeries.h:157
double endtime() const noexcept
Definition: BasicTimeSeries.h:82
Define metadata keys.
Definition: BasicSpectrum.h:6
TimeReferenceType
Type of time standard for time series data.
Definition: BasicTimeSeries.h:14