LTAVIEW: ~~~~~~~ A specialization of LTAFMT object which allows selections to be applied to the underlying LTAFMT object and presents the resultant view. Currently the only selection that can be applied is on the source name and scan numbers. It can also be used to average the data in time and frequency. Only the selected source will be visible via this object. Later as and when the need arises, selection on time, frequency, baseline etc can also be applied - but all that has be thought of and implemented carefully. The issues there would be that of efficiency and speed. Method: ~~~~~~ The following methods of the LTAFMT object have been overloaded. The calling signature remains same. However there behavior is slightly changed as explained below. All methods of LTAFMT (described in the documentation on LTAFMT object are available from this object as well). LTAVIEW(): A blank constructor. LTAVIEW(char *IFile, char *OFile=NULL, char *Obj=NULL); Alternate constructor which attach the input stream to the file named by IFile. The next two arguments are optional. If OFile is not given, the output stream will be attached to stdout. If Obj is not given, all sources in the file will be visible. If Obj is given, only the given source name would be visible. If the given source is not present in the file, a fatal error would be detected. ~LTAVIEW(); The destructor. int reset(char *IFile, char *OFile, char *Obj); Same function as the second constructor. This is used when an empty object (via the blank construct - also called the default constructor in the OOP jargon) has to be initialized. int getnscans(); Returns the no. of scan for the chosen source found. int skipscan(int n); Skips to the nth. scan of the chosen source. int rd_data(char *buf); Reads the next record corresponding the chosen source into the buffer buf. int rd_data(); Reads the next record corresponding the chosen source into an internal buffer. ----------------------------------------------------------------------- Policy regarding handling input data from a pipe: ------------------------------------------------ 1. LTAVIEW::getScanRecords(int n) This function returns the no. of records in the nth scan of the database in case of disk file. In case of a pipe, it throws an ltaError exception with a ErrorObj::Recoverable state set in the exception object. 2. LTAVIEW::getMaxRecords() Returns the max. no. of records in a ANY scan in case of a disk file. In case of a pipe, this throws an exception of type ltaError with ErrorObj::Recoverable state set in the exception object. 3. LTAVIEW::getnscans() Returns the no. of scans in case of a disk file. In case of a pipe, throws an exception of type ltaError with ErrorObj::Recoverable state set in the exception object. 4. LTAVIEW::scanSelect(int,int *) Sets the list of logical scan nos. of the selected object to be passed to the applications programm. This works for both cases. 5. LTAVIEW::avgrd_data(char *,.....) In case of disk file, does averaging and/or normalization of the data. In case of pipe, works for no averaging (ie. no further averaging of the data on-the-fly). In case more averaging is attempted, this might misbehave at scan boundaries where it might not have enough records left before the next scan begins to make the desired integration. The entire logic of handling data from a pipe is handled by the EatData, LTAInputFromPipe and ThisScan state variables. If LTAInputFromPipe is set, EatData is used to eat data to simulate the action of skipscan, skiprecord, etc. To determine if the current scan is the selected one (selection is a combination of SourceName (which is a regular expression comparator object) and the list of logical scan nos.), ThisScan is used which increments linearly with every new scan.