Changeset 1521 for branches


Ignore:
Timestamp:
03/06/09 11:42:46 (16 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: Yes CAS-1043

Ready to Release: Yes

Interface Changes: No

What Interface Changed: Please list interface changes

Test Programs: List test programs

Put in Release Notes: No

Module(s): atnf

Description:

Changes due to an update of NROReader.


File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/alma/src/STFiller.cpp

    r1519 r1521  
    479479    return ;
    480480  }
    481 
    482   // DEBUG
    483   //cout << "STFiller::openNRO()  getHeaderInfo " << endl ;
    484   //
    485481
    486482  ifOffset_ = 0;
     
    607603  Array<Double> scanrate ;
    608604  for ( i = 0 ; i < imax ; i++ ) {
    609     if( nreader_->getData( i ) != 0 ) {
    610       cerr << "STFiller::readNRO()  error while reading row " << i << endl ;
    611       return -1 ;
    612     }
     605//     if( nreader_->getDataset()->getRecord( i ) == NULL ) {
     606//       cerr << "STFiller::readNRO()  error while reading row " << i << endl ;
     607//       return -1 ;
     608//     }
    613609
    614610    string scanType = nreader_->getScanType( i ) ;
    615611    Int srcType = -1 ;
    616612    if ( scanType.compare( 0, 2, "ON") == 0 ) {
     613      // cout << "ON srcType: " << i << endl ;
    617614      srcType = 0 ;
    618615    }
     
    799796Bool STFiller::fileCheck()
    800797{
     798  bool bval = false ;
     799
    801800  // if filename_ is directory, return false
    802801  File inFile( filename_ ) ;
    803802  if ( inFile.isDirectory() )
    804     return false ;
     803    return bval ;
    805804 
    806805  // if beginning of header data is "RW", return true
     
    808807  FILE *fp = fopen( filename_.c_str(), "r" ) ;
    809808  char buf[9] ;
     809  char buf2[80] ;
    810810  fread( buf, 4, 1, fp ) ;
    811811  buf[4] = '\0' ;
    812   if ( ( strncmp( buf, "RW", 2 ) == 0 ) )
    813     return true ;
    814 
    815   return false ;
     812  fseek( fp, 640, SEEK_SET ) ;
     813  fread( buf2, 80, 1, fp ) ;
     814  if ( ( strncmp( buf, "RW", 2 ) == 0 ) || ( strstr( buf2, "NRO45M" ) != NULL ) ) {
     815    bval = true ;
     816  }
     817  fclose( fp ) ;
     818  return bval ;
    816819}
    817820
Note: See TracChangeset for help on using the changeset viewer.