SCANINFO(1) IFRSOFT++ LIBRARY SCANINFO(1) NAME SCANINFO, ~SCANINFO, reset, getNumOfScans, getScanOffset, getScanRecords, getScanRecordOffset, getCurrentPosition, skipRecords, skipbackRecords, getFileSize, gotoStart, gotoOffset, gotoScan, gotoScanRecord, gotoEnd : scan-record related C++ functions for the GMRT LTAfile. SYNOPSIS #include SCANINFO::SCANINFO(); SCANINFO::SCANINFO(fp, reclen) FILE *fp; const int &reclen; SCANINFO::SCANINFO(fp, reclen, nscans) FILE *fp; const int &reclen; const int &nscans; SCANINFO::~SCANINFO(); SCANINFO::reset(fp, reclen) FILE *fp; const int &reclen; SCANINFO::reset(fp, reclen, nscans) FILE *fp; const int &reclen; const int &nscans; int SCANINFO::getNumOfScans(); streampos SCANINFO::getScanOffset(scanNum) const int &scanNum; int SCANINFO::getScanRecords(scanNum) const int &scanNum; streamoff SCANINFO::getScanRecordOffset(scanNum, recNum) const int &scanNum; const int &recNum; streampos SCANINFO::getCurrentPosition(); int SCANINFO::skipRecords(recNum) const int &recNum; int SCANINFO::skipbackRecords(recNum) const int &recNum; NCRA Release Last change: 21 August 1995 1 SCANINFO(1) IFRSOFT++ LIBRARY SCANINFO(1) long SCANINFO::getFileSize(); int SCANINFO::gotoStart(); int SCANINFO::gotoOffset(offset) const streamoff &offset; int SCANINFO::gotoScan(scanNum) const int &scanNum; int SCANINFO::gotoScanRecord(scanNum, recNum) const int &scanNum; const int &recNum; void gotoEnd(void); DESCRIPTION SCANINFO class public functions are totally independent of all other IFRSOFT libraries. These functions operate on the GMRT LTAfile for various operations on scans and records (timestamps). SCANINFO::SCANINFO() is the default constructor for defining SCANINFO class. SCANINFO::SCANINFO(FILE *fp, const int &reclen) is another constructor for defining and initializing SCANINFO class. This constructor internally calls SCANINFO::reset(FILE *fp, const int &reclen) function. Arguments to this constructor are the input file pointer fp and the length of each record reclen in the given file. The value of reclen can be set using LTAFMT library calls. SCANINFO::SCANINFO(FILE *fp, const int &reclen, const int &nscans) is the other constructor for defining and initial- izing SCANINFO class. This constructor internally calls SCANINFO::reset(FILE *fp, const int &reclen, const int &nscans) function. Arguments to this constructor are the input file pointer fp, the length of each record reclen and the number of scans nscans in the given file. The values of reclen and nscans can be set using LTAFMT library calls. This constructor is more robust than the previous one and can even detect and neglect the faulty records in the file. SCANINFO::~SCANINFO() is the default destructor of SCANINFO class. SCANINFO::reset(FILE *fp, const int &reclen) resets the pre- vious SCANINFO constructor and redefines the hidden data structures of this class. This function will work when there are no bad records in the input file. On success, this returns the number of scans in the input file, otherwise NCRA Release Last change: 21 August 1995 2 SCANINFO(1) IFRSOFT++ LIBRARY SCANINFO(1) returns -1 on failure. Arguments to this function are the input file pointer fp and the length of each record reclen in the given file. The value of reclen can be set using LTAFMT library calls. SCANINFO::reset(FILE *fp, const int &reclen, const int &nscans) resets the previous SCANINFO constructor and rede- fines the hidden data structures of this class. This func- tion will work when there are no bad records in the input file. On success, this returns the number of scans found in the input file, otherwise this returns -1 on failure. Argu- ments to this function are the input file pointer fp, the length of each record reclen and the number of scans nscans in the given file. The values of reclen and nscans can be set using LTAFMT library calls. This function is more robust than the previous one and can even detect and neglect the faulty records in the file. However it is slower than the previous reset function. Hence it is recommended that the previous reset should be invoked first. If it returns -1, then invoke this call. If both of these reset functions return -1, then there is seriously wrong in the format of the input file, which would need to be debugged separately. SCANINFO::getNumOfScans() returns the number of scans found in the input LTAfile. SCANINFO::getScanOffset(const int &scanNum) returns the offset value of the given scan scanNum from the beginning of the input LTAfile. scanNum starts from zero. SCANINFO::getScanRecords(const int &scanNum) returns the number of records (timestamps) in a given scan scanNum. SCANINFO::getScanRecordOffset(const int &scanNum, const int &recNum) returns the offset value of a given record recNum of a given scan scanNum from the beginning of the LTAfile. scanNum and recNum start from zero. This function returns -1 on failure. This function may not work properly (in this version) if there are any bad records in the file. SCANINFO::getCurrentPosition() returns the current position (offset) of the file pointer in the LTAfile from the begin- ning of the file. SCANINFO::skipRecords(const int &recNum) skips forward (ahead) recNum number of records (timestamps) from the current position of the file pointer. This function returns -1 on failure and 0 on success. This function may not work properly (in this version) if there are any bad records in the file. NCRA Release Last change: 21 August 1995 3 SCANINFO(1) IFRSOFT++ LIBRARY SCANINFO(1) SCANINFO::skipbackRecords(const int &recNum) skips backward (upward) recNum number of records (timestamps) from the current position of the file pointer. This function returns -1 on failure and 0 on success. This function may not work properly (in this version) if there are any bad records in the file. SCANINFO::getFileSize() returns the size of the input file in bytes. This function returns -1 on failure. SCANINFO::gotoStart() puts the file pointer at the beginning of the file. This call is equivalent to the call rewind(FILE *) in C. This function returns -1 on failure and 0 on success. SCANINFO::gotoOffset(const streamoff &offset) puts the file pointer at the offset location from the beginning of the file. This function returns -1 on failure and 0 on success. SCANINFO::gotoScan(const int &scanNum) puts the file pointer at the start of a given scan scanNum. This function returns -1 on failure and 0 on success. SCANINFO::gotoScanRecord(const int &scanNum, const int &rec- Num) puts the file pointer at the start of a given record recNum of a given scan scanNum. This function returns -1 on failure and 0 on success. This function may not work prop- erly (in this version) if there are any bad records in the file. SCANINFO::gotoEnd() puts the file pointer at the end of the file. This function returns -1 on failure and 0 on success. SEE ALSO Note on showscaninfo(1), LTAFMT, LTAVIEW, hlib, glib. NOTE Any problems regarding this library can be directed to Shyam Khobragade. NCRA Release Last change: 21 August 1995 4