In file dacc/Dacc.hh:

class Dacc : public DaccIn

LIGO Sandbox data access class.

Inheritance:


Public Methods

Dacc (void)
Default (Null) constructor
explicit Dacc (const char* Source, const Time& start=Time(0))
Construct and connect to source
explicit Dacc (FrameCPP::IFrameStream* reader)
Construct using an already allocated frame reader
~Dacc (void)
Destructor
void setBuffer (int N)
Set the DaccIn Buffer count.
void setDebug (int N)
Set the debug flag.
void setIgnoreMissingChannel (bool yn)
Set the debug flag.
void setNoWait (bool now=true)
Set the noWait flag.
void setStride (Interval Dt)
Define the default Stride.
void addChannel (const char* Name, int Decimate=0, TSeries **TSptr=0)
Add a channel to the request list.
void addFSeries (const char* Name, FSeries **FSptr=0)
Add an FSeries data channel to the request list.
void addProcessed (const char* Name, int Decimate=0, TSeries **TSptr=0)
Add a processed data channel to the request list.
void addRaw (const char* Name, int Decimate=0, TSeries **TSptr=0)
Add a raw data channel to the request list.
void addSimulated (const char* Name, int Decimate=0, TSeries **TSptr=0)
Add a simulated data channel to the request list.
void rmChannel (const char* Name)
Remove a channel from the request list.
int flush (Interval Stride=Interval(0.0))
Skip data.
int fillData (Interval Stride=Interval(0.0), bool start=true)
Fill the requested TSeries.
void zeroChans (Interval Dt)
Reset channel TSeries.
int fillChans (Interval Offset, Interval Dt)
Fill the requested TSeries from a single frame.
int seek (Time STime=Time(0, 0))
Skip to the specified time.
int synch (void)
Synchronize the current frame buffer.
Time getCurrentTime (void) const
Get the Current time.
int getDebug (void)
Get the debug flag.
Time getFillTime (void) const
Get the start time of the last fill.
Interval getOffset (void) const
Get the current offset into the frame.
Interval getStride (void) const
Get the stride interval.
bool isChannelRead (const char* Name) const
Test if channel was requested.
std::ostream& list (std::ostream& out) const
List requested channels.
const TSeries* refData (const char* name) const
Get a pointer to the data.
const FSeries* refFData (const char* name) const
Get a pointer to the data.

Inherited from DaccIn:

Public Methods

void setTOCMode(bool toc=true)
void addFile(const char* File)
void addFileList(const char* File)
void close(void)
int open(void)
void endFrame(void)
int nextFrame(void)
Interval getDt(void) const
const char* getFile(void) const
bool getHistory(const std::string& name, Time& t, std::string& com) const
const FrameCPP::FrameH* getFrame(void) const
std::string getFrameID(void)
int getStaticData(const std::string& name=".*", const std::string& det=".*", const Time& startGps=Time(0), const Time& endGps=Time(0))
FSeries getStaticFSeries(const std::string& name, const Time& gps)
TSeries getStaticTSeries(const std::string& name, const Time& gps)
Time getTime(void) const
bool haveFrame(void) const
bool isOnline(void) const
std::ostream& listFiles(std::ostream& out) const
bool waitData(bool test_only=false) const
const FrameCPP::FrAdcData* findAdc(const std::string& name) const
const FrameCPP::FrAdcData* nextAdc(const std::string& name) const
const FrameCPP::FrProcData* findProc(const std::string& name) const
const FrameCPP::FrProcData* nextProc(const std::string& name) const
const FrameCPP::FrSimData* findSim(const std::string& name) const
const FrameCPP::FrSimData* nextSim(const std::string& name) const
FrStatDataRef findStat(const std::string& name, const Time& gps, int vsn=-1)

Documentation

Dacc methods are used to access individual data channels from frames. By decoupling the data access from the frame structure, Dacc relieves the Sandbox user from writing frame catination code, etc. The input data are unpacked by Dacc into the TSeries objects.
Dacc(void)
Default (Null) constructor

explicit Dacc(const char* Source, const Time& start=Time(0))
Construct and connect to source

explicit Dacc(FrameCPP::IFrameStream* reader)
Construct using an already allocated frame reader

~Dacc(void)
Destructor

void setBuffer(int N)
Set the DaccIn Buffer count.

void setDebug(int N)
If the debug flag is set, explanatory messages will be printed when an error is encountered.

void setIgnoreMissingChannel(bool yn)
If the debug flag is set, explanatory messages will be printed when an error is encountered.

void setNoWait(bool now=true)
Set the noWait flag as specified. If noWait is set, the Dacc methods that would otherwise wait for online data (e.g. synch, fillData) will instead return with error code -8.

void setStride(Interval Dt)
The default stride is used if a time interval is not specified when fillData() is invoked.

void addChannel(const char* Name, int Decimate=0, TSeries **TSptr=0)
The specified channel is added to the list of channels to be processed by fillData. fillData looks for the channel name first in the FrAdcData list folowed by the FrProcData list. A channel may be included in the list only once. Subsequent calls to addChannel will replace the original request. TSptr is used by the calling program to access the data. If the pointer address is NULL or not specified, an internal pointer is allocated, and the channel is accessed exclusively with the refData method. The TSeries is then created and destroyed under Dacc control. If the pointer address is specified a non-zero pointer indicates a pre-allocated TSeries. If the pointer is NULL no TSeries is pre-allocated and the TSeries will be created when fillData is invoked. Note that if the TSeries is not preallocated, the TSeries data vector will have the same data type as the channel data (usually short). Decimate gives the number of samples to be averaged together before they are entered into the TSeries. If Decimate <= 0, it is set to 1. If no TSeries is passed to fillData and the Decimation > 1, a float data vector is allocated.
Parameters:
Name - Name of channel to collect data from.
Decimate - Decimation factor.
TSptr - Address of TSeries pointer.

void addFSeries(const char* Name, FSeries **FSptr=0)
Add an process frequency series to the list. The purpose of the method is similar to that of addChannel except that the channel being searched for is a processed data frequency series.
Parameters:
Name - Name of channel to collect data from.
FSptr - Address of an FSeries pointer.

void addProcessed(const char* Name, int Decimate=0, TSeries **TSptr=0)
Add a Processed data channel to the list. The purpose of the method and its arguments are identical to those for addChannel except that any search for the channel is limited to Processed data.
Parameters:
Name - Name of channel to collect data from.
Decimate - Decimation factor.
TSptr - Address of TSeries pointer.

void addRaw(const char* Name, int Decimate=0, TSeries **TSptr=0)
Add an Adc channel to the list. The purpose of the method and its arguments are identical to those for addChannel except that any search for the channel is limited to the raw ADC data.
Parameters:
Name - Name of channel to collect data from.
Decimate - Decimation factor.
TSptr - Address of TSeries pointer.

void addSimulated(const char* Name, int Decimate=0, TSeries **TSptr=0)
Add a Simulated data channel to the list. The purpose of the method and its arguments are identical to those for addChannel except that any search for the channel is limited to Simulated data.
Parameters:
Name - Name of channel to collect data from.
Decimate - Decimation factor.
TSptr - Address of TSeries pointer.

void rmChannel(const char* Name)
The named channel is removed from the request list.

int flush(Interval Stride=Interval(0.0))
The data pointer for the frame currently in memory is incremented past the specified time. If the interval is not specified, negative or zero, the rest of the data in the current frame are skipped. If a discontinuity in the frame times is found, flush stops skipping at the start of the new data segment.
Returns:
Non-zero if an end of file is found.
Parameters:
Stride - Time interval to be skipped.

int fillData(Interval Stride=Interval(0.0), bool start=true)
Data from channels specified by addChannel() are copied to TSeries objects.
Returns:
0 Successful completion
-1 Frame start not contiguous to previous data
-2 Sample rate isn't compatible with previous data.
-3 Requested data not found in current frame
-4 Error reading frame
-5 Frame data are not self-consistent.
-6 TSeries is not allocated.
-7 Unsupported data type
-8 Signal received while reading
Parameters:
Stride - Time interval to be read in.
start - Start a stride.

void zeroChans(Interval Dt)
Zero all TSeries in the channel list. Allocate sufficient memory to hold the given sample time.
Parameters:
Dt - Time interval to be used in allocating memory.

int fillChans(Interval Offset, Interval Dt)
Fill the requested TSeries from a single frame.
Returns:
0 Successful completion
-1 Frame start not contiguous to previous data
-2 Sample rate isn't compatible with previous data.
-3 Requested data not found in current frame
-4 Error reading frame
-5 Frame data are not self-consistent.
-6 TSeries is not allocated.
-7 Unsupported data type
Parameters:
Offset - Offset of start of data from start of fram.
Dt - Time interval to be read in.

int seek(Time STime=Time(0, 0))
Frames are read from the specified input file(s) until one containing the specified time is found.
Returns:
Zero if open was successful.

int synch(void)
The frame that will provide the data for the next read operation is read into memory.
Returns:
Zero if successful or -1 if unable to read in a frame.

Time getCurrentTime(void) const
Returns the current data collection time i.e. the time of the first sample not used by fillData. getCurrentTime() returns Time(0) if no frame has been read. Note that data filling may not start at getCurrentTime if there are gaps in the data stream or if filData errors occur. Use synch to position the current time to the start of the next frame if current frame is not available.
Returns:
Start time for next data fill.

int getDebug(void)
Returns the level of debug information that was requested.
Returns:
Debug print level.

Time getFillTime(void) const
Returns the time at which data collection started with the last invocation of fillData.
Returns:
Start time of last fillData stride.

Interval getOffset(void) const
Returns an offset of the current point in the frame.

Interval getStride(void) const
Returns the time interval over which data are collected.

bool isChannelRead(const char* Name) const
Test to see is the names channel has been requested..
Returns:
True if the specified channel has been requested.
Parameters:
Name - Channel name to be tested.

std::ostream& list(std::ostream& out) const
A formatted list of requested channels, their decimation factors, and latest time copied is printed to the specified output stream.

const TSeries* refData(const char* name) const
Returns a pointer to the last TSeries filled for the named channel.

const FSeries* refFData(const char* name) const
Returns a pointer to the last TSeries filled for the named channel.


This class has no child classes.
Author:
John G. Zweizig
Version:
1.6; Last modified June 15, 2001

alphabetic index hierarchy of classes


Please send questions and comments to zweizig_j@ligo.caltech.edu


generated by doc++