version  0.0.1
Defines the C++ API for MsPASS
Loading...
Searching...
No Matches
CoreTimeSeries.h
1#ifndef _MSPASS_CORETIMESERIES_H_
2#define _MSPASS_CORETIMESERIES_H_
3#include "mspass/seismic/BasicTimeSeries.h"
4#include "mspass/utility/Metadata.h"
5#include <vector>
6
7namespace mspass::seismic {
18public:
27 std::vector<double> s;
42 CoreTimeSeries(const size_t nsin);
43 virtual ~CoreTimeSeries() {};
54 CoreTimeSeries(const BasicTimeSeries &bts, const Metadata &md);
59 /* These overload virtual methods in BasicTimeSeries. */
72 void set_dt(const double sample_interval);
94 void set_npts(const size_t npts);
101 void sync_npts();
118 void set_t0(const double t0in);
119 /* Depricated in 2020 API change - no longer needed with new BasicTimeSeries.
120 Returns the end time (time associated with last data sample)
121 of this data object.
122
123 */
124 /*
125 double endtime()const noexcept
126 {
127 return(mt0+mdt*static_cast<double>(s.size()-1));
128 };
129 */
158 const CoreTimeSeries operator+(const CoreTimeSeries &other) const;
159
161 CoreTimeSeries &operator*=(const double);
186 const CoreTimeSeries operator-(const CoreTimeSeries &other) const;
198 double operator[](size_t const sample) const;
199};
200} // namespace mspass::seismic
201#endif // end guard
Base class for time series objects.
Definition BasicTimeSeries.h:35
size_t npts() const
Definition BasicTimeSeries.h:171
Scalar time series data object.
Definition CoreTimeSeries.h:17
CoreTimeSeries()
Definition CoreTimeSeries.cc:14
CoreTimeSeries & operator=(const CoreTimeSeries &parent)
Definition CoreTimeSeries.cc:57
const CoreTimeSeries operator+(const CoreTimeSeries &other) const
Definition CoreTimeSeries.cc:150
const CoreTimeSeries operator-(const CoreTimeSeries &other) const
Definition CoreTimeSeries.cc:156
double operator[](size_t const sample) const
Definition CoreTimeSeries.cc:240
void set_dt(const double sample_interval)
Set the sample interval.
Definition CoreTimeSeries.cc:165
CoreTimeSeries & operator*=(const double)
Definition CoreTimeSeries.cc:161
CoreTimeSeries & operator+=(const CoreTimeSeries &d)
Summation operator.
Definition CoreTimeSeries.cc:67
std::vector< double > s
Definition CoreTimeSeries.h:27
void sync_npts()
Sync the number of samples attribute with actual data size.
Definition CoreTimeSeries.cc:220
void set_npts(const size_t npts)
Set the number of samples attribute for data.
Definition CoreTimeSeries.cc:196
void set_t0(const double t0in)
Set the data start time.
Definition CoreTimeSeries.cc:180
CoreTimeSeries & operator-=(const CoreTimeSeries &d)
Subtraction operator.
Definition CoreTimeSeries.cc:110
Definition Metadata.h:71
Define metadata keys.
Definition BasicSpectrum.h:6