Changeset 2781


Ignore:
Timestamp:
03/07/13 16:44:44 (12 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: No

Ready for Test: Yes

Interface Changes: No

What Interface Changed: Please list interface changes

Test Programs: List test programs

Put in Release Notes: Yes/No

Module(s): Module Names change impacts.

Description: Describe your changes here...

Support SAM45 OTF data that is slightly different definition on
number of scans in the data (whether includes ZERO or not).


Location:
trunk/external-alma/atnf/PKSIO
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/external-alma/atnf/PKSIO/ASTEDataset.cc

    r2436 r2781  
    831831  //
    832832
    833 
    834   scanNum_ = NSCAN + 1 ; // includes ZERO scan
    835   rowNum_ = scanNum_ * ARYNM ;
     833  //scanNum_ = NSCAN + 1 ; // includes ZERO scan
    836834  scanLen_ = SCNLEN ;
    837835  dataLen_ = scanLen_ - SCAN_HEADER_SIZE ;
     836  scanNum_ = getScanNum();
     837  rowNum_ = scanNum_ * ARYNM ;
    838838  chmax_ = (int) ( dataLen_ * 8 / IBIT ) ;
    839839  record_->LDATA = new char[dataLen_] ;
    840840
     841  initArray();
     842
    841843  show() ;
    842844
  • trunk/external-alma/atnf/PKSIO/ASTEFXDataset.cc

    r2436 r2781  
    831831  //
    832832
    833   scanNum_ = NSCAN + 1 ; // includes ZERO scan
    834   rowNum_ = scanNum_ * ARYNM ;
     833  //scanNum_ = NSCAN + 1 ; // includes ZERO scan
    835834  scanLen_ = SCNLEN ;
    836835  dataLen_ = scanLen_ - SCAN_HEADER_SIZE ;
     836  scanNum_ = getScanNum();
     837  rowNum_ = scanNum_ * ARYNM ;
    837838  chmax_ = (int) ( dataLen_ * 8 / IBIT ) ;
    838839  record_->LDATA = new char[dataLen_] ;
    839840
     841  initArray();
     842
    840843  show() ;
    841844
  • trunk/external-alma/atnf/PKSIO/NRODataset.cc

    r2779 r2781  
    280280
    281281  // fill NRODataset
    282   int offset = getDataSize() + scanLen_ * i ;
     282  long offset = getDataSize() + scanLen_ * i ;
    283283  // DEBUG
    284284  //cout << "NRODataset::fillRecord()  offset (header) = " << offset << endl ;
     
    880880  //cout << "numArray=" << numArray << endl;
    881881}
     882
     883int NRODataset::getScanNum()
     884{
     885  long offset = getDataSize() + scanLen_ * NSCAN * ARYNM ;
     886  fseek( fp_, offset, SEEK_SET ) ;
     887  // try to read data
     888  fgetc( fp_ ) ;
     889  int eof = feof( fp_ ) ;
     890  //cout << "eof=" << eof << endl;
     891  // reset file pointer
     892  fseek( fp_, 0, SEEK_SET ) ;
     893  return NSCAN + (eof > 0 ? 0 : 1) ;
     894}
  • trunk/external-alma/atnf/PKSIO/NRODataset.h

    r2777 r2781  
    249249  virtual int arrayMax() {return 0;} ;
    250250
     251  // get scanNum from NSCAN (NSCAN or NSCAN + 1)
     252  int getScanNum();
     253
    251254  // Type of file record
    252255  std::string LOFIL ;
  • trunk/external-alma/atnf/PKSIO/NROOTFDataset.cc

    r2777 r2781  
    828828  //
    829829
    830   scanNum_ = NSCAN + 1 ; // includes ZERO scan
    831   //scanNum_ = NSCAN ;
    832   rowNum_ = scanNum_ * ARYNM ;
     830  //scanNum_ = NSCAN + 1 ; // includes ZERO scan
    833831  scanLen_ = SCNLEN ;
    834832  dataLen_ = scanLen_ - SCAN_HEADER_SIZE ;
     833  scanNum_ = getScanNum();
     834  rowNum_ = scanNum_ * ARYNM ;
    835835  chmax_ = (int) ( dataLen_ * 8 / IBIT ) ;
    836836  record_->LDATA = new char[dataLen_] ;
Note: See TracChangeset for help on using the changeset viewer.