class Trend Accumulate and write trend data frames.
| | TrendType Enumerate trend types |
| | count_t Data type for data counts |
| | math_t Arithmetic data type |
| | trend_t Type of data contained in TSeries |
| | Trend (void) Default contructor. |
| | Trend (const Trend& x) Copy constructor |
| | Trend (const char* Name, TrendType type=kSecond, count_t FrameL=0) Data constructor. |
| | ~Trend (void) Destructor |
| | exists (const char* ChName) const test for channel |
| | find (const char* ChName) Find a channel entry. |
| | find (const char* ChName) const Find a channel entry. |
| | getName (void) const Trend channel group name. |
| | getFileName (void) const Trend file name. |
| | isEmpty (void) const Test for non-zero data. |
| | isEmpty (const Time& start, const Time& stop) const Test for non-zero data. |
| | addChannel (const char* Name) Add a trend channel. |
| | clear (void) Clear the trend. |
| | close (void) Close the trend. |
| | dump (std::ostream& os) const Dump the trend status. |
| | open (void) open the trend FrWriter. |
| | read (const std::string& file) Read a trend from the sppecified frame file |
| | trendData (const char* Name, const TSeries& ts) Add points from a time series to the trend. |
| | trendData (const char* Name, const Time& t, math_t point) Trend a single point. |
| | setAutoUpdate (bool enable) Set auto-update mode. |
| | setFile (const char* Name) Set the trend name. |
| | setFrameCount (int nFrame) Set the maximum number of frames in a file. |
| | setFrameLen (int nSample) Set the maximum number of samples in a frame. |
| | setIFO (const char* ifo) Set IFO name. |
| | setMonID (const std::string& Name) Set the channel monitor ID. |
| | setName (const char* Name) Set the trend channel group name. |
| | setSample (Interval time) Set the sample interval |
| | setType (TrendType type) Set the trend type. |
| | Update (const Time& t=Time(0)) Write trend if time is past. |
| | writeIndex (const char* file=0) const Write an NDS index file |
The Trend class collects LIGO standard trend information and records it in trend frames. Multiple channels may be trended and recorded by a single Trend object. The trend is specified with a sample interval and a number of points per frame. The Trend class averages over all data within the sample interval and produces a frame after the desired number of sample intervals has been accumulated.The trender can write data frames automatically or only when an Update() command is issued. By default, the updates are made automatically. This option can be reset using setAutoUpdate(false). This option must be set (i.e. no automatic update) if data being added to multi-channel trend may overlap the end of a frame.
The trend file name may be specified explicitly with the setFile() method or may be left to default. The default value for the trend file name is $DMTRENDOUT/<ifo>-<name>_[MT]-<gps>_<sec>.gwf, where <ifo> is the specified IFO name, <name> is the channel group (or monitor) name, [MT] is "M" for minute trends or "T" for second trends, <gps> is the GPS time of the start of the trend and <sec> is the number of seconds of data in the trend frame file.
An channel index file may be written in the format used by the Network Data Server (NDS) by calling writeIndex() after all trend channels have been configured.
The basic steps to using the Trend class are shown below:
---- Initialization Trend trend; trend.setName("MyTrend"); trend.setType(Trend::kSecond); trend.setIFO("H2"); trend.setAutoUpdate(false); trend.setFrameCount(1); trend.addChannel("MyChannelA"); trend.addChannel("MyChannelB"); trend.writeIndex(); ---- Adding data Time t; TSeries ts; Trend::math_t Data; ... trend.trendData("MyChannelA", t, Data); trend.trendData("MyChannelB", ts); ... trend.Update(ts.getEndTime()); ---- Clean up and go away trend.write(); trend.close();
typedef TrendAcc::math_t math_t
typedef float trend_t
enum TrendType
Trend(void)
Trend(const Trend& x)
explicit Trend(const char* Name, TrendType type=kSecond, count_t FrameL=0)
~Trend(void)
bool exists(const char* ChName) const
TrendChan& find(const char* ChName)
const TrendChan& find(const char* ChName) const
std::string getName(void) const
std::string getFileName(void) const
bool isEmpty(void) const
bool isEmpty(const Time& start, const Time& stop) const
void addChannel(const char* Name)
void clear(void)
void close(void)
std::ostream& dump(std::ostream& os) const
void open(void)
void read(const std::string& file)
void trendData(const char* Name, const TSeries& ts)
ts - Time series containing data to be trended.
void trendData(const char* Name, const Time& t, math_t point)
t - Time of trended point.
point - The value of the next element of a series.
void setAutoUpdate(bool enable)
void setFile(const char* Name)
void setFrameCount(int nFrame)
void setFrameLen(int nSample)
void setIFO(const char* ifo)
void setMonID(const std::string& Name)
void setName(const char* Name)
void setSample(Interval time)
void setType(TrendType type)
void Update(const Time& t=Time(0))
void writeIndex(const char* file=0) const
alphabetic index hierarchy of classes
Please send questions and comments to zweizig_j@ligo.caltech.edu
generated by doc++