In file rtddinput.h:

class rtddChannel : public rtddCallback

Class for channel input from the rtdd.

Inheritance:


Public Classes

class preprocessing
Data preprocessing.
friend class rtddChannel
rtddChannel is a friend
explicit preprocessing (int dataRate, int Decimate1 = 1, int Decimate2 = 1, tainsec_t Zoomstart = 0, double Zoomfreq = 0, bool rmvDelay = true)
Constructor.
preprocessing (const preprocessing& p)
Copy constructor.
preprocessing& operator= (const preprocessing& p)
Copy operator.
~preprocessing ()
Destructor.
bool operator== (const preprocessing& pre) const
Equality operator.
void setActiveTime (tainsec_t Start, tainsec_t Stop, bool obey = false, bool newValues = false)
set active time method.
bool operator) (taisec_t time, int epoch, float data[], int ndata, int err, partitionlist& partitions, mutex& mux, bool& update)
Data feeding method.
bool process (taisec_t time, int epoch, float data[], int ndata, int err, partitionlist& partitions, mutex& mux, bool& update)
Preprocessing method.
int datarate
channel data rate
int decimate1
first decimation rate (must be a power of 2)
int decimate2
second decimation rate (must be a power of 2)
tainsec_t zoomstart
time zero for down-conversion (nsec)
double zoomfreq
frequency of down-conversion (Hz)
double dt [3]
spacing of data points (Hz); original time series, and after 1st and 2nd decimation
bool removeDelay
remove decimation delay
double decdelay
decimation delay (in sec)
int delaytaps
number of taps in the delay filter
tainsec_t delayshift
delay shift (in nsec)
tainsec_t delay1
accumulated delay after first decimation stage (in nsec)
bool useActiveTime
if true do preprocessing only during active time
tainsec_t start
preprocessing start time; -1 ignore, 0 uninitialized
tainsec_t stop
preprocessing stop time; -1 ignore, 0 uninitialized
tainsec_t bufTime
buffer time
int bufSize
size of data in buffer
tainsec_t t0Grid
t = 0 of grid
float* buf
buffer for holding data segments which are too small
bool hpinit
primitive high pass for zomm analysis
float* tmpdelay1
temporary storage for delay filter
float* tmpdec1
temporary storage for 1st decimation filter
float* tmpdec2I
temporary storage for 2nd decimation filter, I phase
float* tmpdec2Q
temporary storage for 2nd decimation filter, Q phase
class partition
Data partition.
friend class rtddChannel
rtddChannel is a friend
friend class rtddChannel : preprocessing
rttChannel::partition is a friend, too
partition (string Name, tainsec_t Start, tainsec_t Duration, double Dt = 1.0, tainsec_t tp = 0)
Constructor.
partition (const partition& p)
Copy constructor.
void setup (double Dt, int Decimate1 = 1, int Decimate2 = 1, tainsec_t Zoomstart = 0, double Zoomfreq = 0, bool rmvDelay = true)
data point spacing function.
void fill (const float data[], int len, int bufnum = 0)
Fill function.
void copy (float data[], int max, bool cmplx = false)
Copy function.
int index (tainsec_t Start, int Length) const
Index function.
int range (tainsec_t Start, int Length) const
Range function.
void nomore ()
Stop waiting.
bool isFull () const
Is full function.
bool isDone () const
Is done function.
bool operator< (const partition& p) const
Less than operator.
string name
name of time series; will be used to store data
tainsec_t start
beginning of time series (GPS nsec)
tainsec_t duration
length of time series (GPS nsec)
tainsec_t precursor
precursor time
double dt
spacing of data points (sec)
int length
number of data points
std::vector <float> buf [2]
data buffers
int decimate1
first decimation rate (power fo 2)
int decimate2
second decimation rate (power of 2)
tainsec_t zoomstart
time zero for down-conversion (nsec)
double zoomfreq
frequency of down-conversion (Hz)
bool removeDelay
remove decimation filter delay
double decdelay
decimation delay (in sec)
int delaytaps
taps in time delay filter (in number of original samples)
double timedelay
remaining time delay of data

Public Fields

typedef std::vector <partition> partitionlist
list of partitions
typedef std::vector <preprocessing> preprocessinglist
list of preprocessing objects

Public Methods

rtddChannel (string Chnname, gdsStorage& dat, int dataRate, int dataType)
Constructor.
rtddChannel (const rtddChannel& chn)
Copy constructor.
virtual ~rtddChannel ()
Destructor.
rtddChannel& operator= (const rtddChannel& chn)
Copy operator.
bool addPreprocessing (int Decimate1 = 1, int Decimate2 = 1, tainsec_t Zoomstart = 0, double Zoomfreq = 0, bool rmvDelay = true, bool useActiveTime = false, tainsec_t Start = -1, tainsec_t Stop = -1)
Add preprocessing stage.
bool addPartitions (const partitionlist& newPartitions, bool useActiveTime = false)
Add partitions.
void reset ()
Reset function.
void skip (tainsec_t stop)
Skip function.
tainsec_t timeStamp () const
Time stamp method.
tainsec_t maxDelay () const
Time delay method.
virtual int callback (taisec_t time, int epoch, float data[], int ndata, int err)
Callback method.
virtual void updateStorage (bool async = false)
Update storage object with finished partitions.

Protected Fields

int datarate
channel data rate
int datatype
channel data type
int databps
channel data type: bytes per sample
gdsStorage* storage
pointer to storage object
partitionlist partitions
list of partitions
preprocessinglist preprocessors
list of preprocessing stages
tainsec_t timestamp
time stamp of most recent data
int inUse
counts how many times channel is in use
bool isTP
true if channel is a test point

Inherited from rtddCallback:

Public Fields

string chnname

Public Methods

bool operator== (const rtddCallback& rtddchn) const
bool operator== (const string& name) const
bool operator!= (const rtddCallback& rtddchn) const
bool operator!= (const string& name) const
bool operator< (const rtddCallback& rtddchn) const
bool subscribe(tainsec_t start = 0, tainsec_t* active = 0)
bool unsubscribe()
bool isSet() const

Protected Fields

mutable recursivemutex mux

Documentation

Class for reading channel data from the real-time data distribution system. This class will receive data from the RTDD system through the callback mechanism. It implements the following prepropressing options: a first decimation stage, a down-conversion, a second decimation stage and automatic partition of data. Incoming data is buffered in a partition if of the right time frame. If a partition is complete it is automatically handed over to the diagnostics storage object. Partitions can have unique names, meaning a new data object is added for each partition, or they can have a name which was previously used, meaning the data is added to the data object of same name.
typedef std::vector <partition> partitionlist
list of partitions

typedef std::vector <preprocessing> preprocessinglist
list of preprocessing objects

class preprocessing
This class describes a channel preprocessing stage. A preprocessing stage contains an optional first decimation, an optional down-conversion and and optional second decimation.

explicit preprocessing(int dataRate, int Decimate1 = 1, int Decimate2 = 1, tainsec_t Zoomstart = 0, double Zoomfreq = 0, bool rmvDelay = true)
Constructs a preprocessing object.
Returns:
void
Parameters:
dataRate - channel data rate
Decimate1 - first decimation rate (power of 2)
Decimate2 - second decimation rate (power of 2)
Zoomstart - time zero for down-conversion
Zoomfreq - down-conversion frequency
rmvDelay - remove decimation delay

preprocessing(const preprocessing& p)
Constructs a preprocessing object.
Returns:
void
Parameters:
p - preprocessing object

preprocessing& operator= (const preprocessing& p)
Copies a preprocessing object.
Returns:
void
Parameters:
p - preprocessing object

~preprocessing()
Destructs a preprocessing object.
Returns:
void

bool operator== (const preprocessing& pre) const
Compares two preprocessing object.
Returns:
true if equal decimation and zoom parameters
Parameters:
pre - preprocessing object

void setActiveTime(tainsec_t Start, tainsec_t Stop, bool obey = false, bool newValues = false)
Sets the active time of a preprocessing object. When set, data is only sent through the decimation filters for the specified interval. To account for filter settling times, data pass through actually start earlier by 10 times the filter delay and stops later by twice the filter delay. A value of -1 indicates that the corresponding limit should be ignored, i.e. data will be processed irregardly. If this function is called multiple times, the active time will be the minimum/maximum of all supplied values. Setting newValues to true will override this behaviour and take them as is. Only when obey is set true, the active time will actually be used to determine if preprocessing should take place.

Returns:
void
Parameters:
Start - time when preprocessing must deliver first data
Stop - time when preprocessing can stop delivering data
obey - if true active time will actually be used
newValues - when false the min/max is calculated

bool operator) (taisec_t time, int epoch, float data[], int ndata, int err, partitionlist& partitions, mutex& mux, bool& update)
Data feeding function. If the number of data points fed into this routine is smaller than the decimation rate, data will be held back until enough data points have been received. Only when enough data points are ready will the process function be called. The number of data points fed into the routine has to be either a multiple of the total decimation rate or an integer fraction thereof. If an integer fraction, subsequent calls must be of equal length.
Returns:
true if successful
Parameters:
time - time of first data point (sec)
epoch - epoch of first data point
data - array of data points
ndata - number of data points
err - error code indicating invalid or missing data
partitions - list of partitions
mux - channel mutex
update - indicates if partition list needs to be updated

bool process(taisec_t time, int epoch, float data[], int ndata, int err, partitionlist& partitions, mutex& mux, bool& update)
Channel preprocessing function.
Returns:
true if successful
Parameters:
time - time of first data point (sec)
epoch - epoch of first data point
data - array of data points
ndata - number of data points
err - error code indicating invalid or missing data
partitions - list of partitions
mux - channel mutex
update - indicates if partition list needs to be updated

int datarate
channel data rate

int decimate1
first decimation rate (must be a power of 2)

int decimate2
second decimation rate (must be a power of 2)

tainsec_t zoomstart
time zero for down-conversion (nsec)

double zoomfreq
frequency of down-conversion (Hz)

double dt[3]
spacing of data points (Hz); original time series, and after 1st and 2nd decimation

bool removeDelay
remove decimation delay

double decdelay
decimation delay (in sec)

int delaytaps
number of taps in the delay filter

tainsec_t delayshift
delay shift (in nsec)

tainsec_t delay1
accumulated delay after first decimation stage (in nsec)

bool useActiveTime
if true do preprocessing only during active time

tainsec_t start
preprocessing start time; -1 ignore, 0 uninitialized

tainsec_t stop
preprocessing stop time; -1 ignore, 0 uninitialized

class partition
This class describes a channel data partition. A partition describes a finite time series. It contains a start time, a duration and the spacing of the data points. A partition can describe a single time series or the both in-phase and the quad-phase of a down-converted time series.

partition(string Name, tainsec_t Start, tainsec_t Duration, double Dt = 1.0, tainsec_t tp = 0)
Constructs a partition.
Returns:
void
Parameters:
Name - name of partition
Start - beginning of partition (nsec)
Duration - length of partition (nsec)
Dt - spacing of data points
tp - precursor time

partition(const partition& p)
Constructs a partition.
Returns:
void
Parameters:
p - partition

void setup(double Dt, int Decimate1 = 1, int Decimate2 = 1, tainsec_t Zoomstart = 0, double Zoomfreq = 0, bool rmvDelay = true)
data point spacing function.
Returns:
void
Parameters:
Dt - spacing of data points
Decimate1 - first decimation rate (power of 2)
Decimate2 - second decimation rate (power of 2)
Zoomstart - time zero for down-conversion
Zoomfreq - down-conversion frequency
rmvDelay - remove decimation filter delay

void fill(const float data[], int len, int bufnum = 0)
Copies new data points into the partition.
Returns:
void
Parameters:
data - data array
len - number of data points
bufnum - buffer ID (0 = in-phase; 1 = quad-phase)

void copy(float data[], int max, bool cmplx = false)
Copies data points from the partition into a data array.
Returns:
void
Parameters:
data - data array
len - maximum number of data points
cmplx - true if down-converted time series

int index(tainsec_t Start, int Length) const
Returns the index of data array to be copied given the start time of the time series and its length. Returns -1 if the time series is ahead of the partion interval, and -2 if the time series is past the partition interval.
Returns:
time series index to fill partition
Parameters:
Start - beginning of time series (nsec)
Length - number of data points in time series

int range(tainsec_t Start, int Length) const
Returns the number of points to be copied from the time series into the partition.
Returns:
void
Parameters:
Start - beginning of time series (nsec)
Length - number of data points in time series

void nomore()
Indicates to the partition that it can not expect any more data. Sets the error flag if partition is not full.
Returns:
void

bool isFull() const
Checks if partition is full, meaning all data points have been filled into the internal buffer.
Returns:
true if partition is full

bool isDone() const
Checks if partition is done, meaning it is either full or no more data can be expected.
Returns:
true if partition is done

bool operator< (const partition& p) const
Compares two partitions using their start time.
Returns:
true if smaller
Parameters:
p - another partition

string name
name of time series; will be used to store data

tainsec_t start
beginning of time series (GPS nsec)

tainsec_t duration
length of time series (GPS nsec)

tainsec_t precursor
precursor time

double dt
spacing of data points (sec)

int length
number of data points

std::vector <float> buf[2]
data buffers

int decimate1
first decimation rate (power fo 2)

int decimate2
second decimation rate (power of 2)

tainsec_t zoomstart
time zero for down-conversion (nsec)

double zoomfreq
frequency of down-conversion (Hz)

bool removeDelay
remove decimation filter delay

double decdelay
decimation delay (in sec)

int delaytaps
taps in time delay filter (in number of original samples)

double timedelay
remaining time delay of data

rtddChannel(string Chnname, gdsStorage& dat, int dataRate, int dataType)
Constructs a channel object.
Returns:
void
Parameters:
Chnname - channel name
dat - storage object for storing partition data
dataRate - data rate in Hz
dataType - data type as defined by the nds

rtddChannel(const rtddChannel& chn)
Constructs a channel object.
Returns:
void
Parameters:
chn - channel object

virtual ~rtddChannel()
Destructs the channel object.
Returns:
void

rtddChannel& operator= (const rtddChannel& chn)
Copies a channel object.
Returns:
channel object
Parameters:
chn - channel object

bool addPreprocessing(int Decimate1 = 1, int Decimate2 = 1, tainsec_t Zoomstart = 0, double Zoomfreq = 0, bool rmvDelay = true, bool useActiveTime = false, tainsec_t Start = -1, tainsec_t Stop = -1)
Adds a new preprocessing stage. Usually, this is done automatically by addPartitions.
Returns:
true if successful
Parameters:
Decimate1 - first decimation rate (power of 2)
Decimate2 - second decimation rate (power of 2)
Zoomstart - time zero for down-conversion
Zoomfreq - down-conversion frequency
rmvDelay - remove decimation filter delay
useActiveTime - if true active time will be used
Start - time when preprocessing must deliver first data
Stop - time when preprocessing can stop delivering data

bool addPartitions(const partitionlist& newPartitions, bool useActiveTime = false)
Adds another list of partitions to the channel object. This function also adds all necessary preprocessing objects.
Returns:
true if successful
Parameters:
newPartitions - list of new partitions
useActiveTime - if true active time will be used

void reset()
Resets the partition list.

void skip(tainsec_t stop)
Skips partitions which require data from the time before stop.
Parameters:
stop - skip partitions before this time

tainsec_t timeStamp() const
Returns the time of the last received data block (or zero if none was received yet). The returned time represents the time of the (last + 1) data sample in GPS nsec, i.e. all data sample with a time earlier than returned were received.
Returns:
time of last received data block

tainsec_t maxDelay() const
Returns the maximum time delay introduced by the preprocessing (mainly FIR filter delays).
Returns:
maximum time delay through preprocessing

virtual int callback(taisec_t time, int epoch, float data[], int ndata, int err)
Callback method for channel data (see description of parent).
Returns:
0 to continue
Parameters:
time - time of first data point (sec)
epoch - epoch of first data point
data - array of data points
ndata - number of data points
err - error code indicating invalid or missing data

virtual void updateStorage(bool async = false)
Looks for finished partitions and stores them in the diagnostics storage object.
Returns:
void
Parameters:
async - runs asynchronous if true

int datarate
channel data rate

int datatype
channel data type

int databps
channel data type: bytes per sample

gdsStorage* storage
pointer to storage object

partitionlist partitions
list of partitions

preprocessinglist preprocessors
list of preprocessing stages

tainsec_t timestamp
time stamp of most recent data

int inUse
counts how many times channel is in use

bool isTP
true if channel is a test point


This class has no child classes.
Author:
DS, November 98
See Also:
Real-time data distribution input API

alphabetic index hierarchy of classes


Please send questions and comments to sigg_d@ligo-wa.caltech.edu


generated by doc++