Ignore:
Timestamp:
03/07/13 14:01:29 (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...

Refactoring reader.


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

Legend:

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

    r1757 r2780  
    5353}
    5454 
    55 // Read data header
    56 Int ASTEFXReader::read()
     55void ASTEFXReader::initDataset()
    5756{
    58   LogIO os( LogOrigin( "ASTEFXReader", "read()", WHERE ) ) ;
    59 
    60   int status = 0 ;
    61 
    62   // create ASTEFXDataset
    6357  dataset_ = new ASTEFXDataset( filename_ ) ;
    64 
    65   // fill ASTEFXDataset
    66   status = dataset_->fillHeader() ;
    67 
    68   if ( status != 0 ) {
    69     //cerr << "Failed to fill data header." << endl ;
    70     os << LogIO::SEVERE << "Failed to fill data header." << LogIO::EXCEPTION ;
    71   }
    72 
    73   return status ;
    7458}
    75 
  • trunk/external-alma/atnf/PKSIO/ASTEFXReader.h

    r1757 r2780  
    7979  ~ASTEFXReader() ;
    8080
    81   // Read data header
    82   virtual int read() ;
     81  protected:
     82  // initialize Dataset
     83  void initDataset();
    8384};
    8485
  • trunk/external-alma/atnf/PKSIO/ASTEReader.cc

    r2154 r2780  
    5353}
    5454 
    55 // Read data header
    56 Int ASTEReader::read()
     55void ASTEReader::initDataset()
    5756{
    58   LogIO os( LogOrigin( "ASTEReader", "read()", WHERE ) ) ;
    59 
    60   int status = 0 ;
    61 
    62   // create ASTEDataset
    6357  dataset_ = new ASTEDataset( filename_ ) ;
    64 
    65   // fill ASTEDataset
    66   status = dataset_->fillHeader() ;
    67 
    68   if ( status != 0 ) {
    69     os << LogIO::SEVERE << "Failed to fill data header." << LogIO::EXCEPTION ;
    70   }
    71 
    72   return status ;
    7358}
    7459
  • trunk/external-alma/atnf/PKSIO/ASTEReader.h

    r2154 r2780  
    7878  ~ASTEReader() ;
    7979
    80   // Read data header
    81   virtual int read() ;
    82 
    8380  // get number of IF
    8481  virtual Int getNumIF() ;
     
    8885
    8986 protected:
     87  // initialize Dataset
     88  void initDataset();
     89
    9090  // Get Antenna Position in ITRF coordinate
    9191  virtual vector<double> getAntennaPosition() ;
  • trunk/external-alma/atnf/PKSIO/NRO45Reader.cc

    r2154 r2780  
    5353}
    5454 
    55 // Read data header
    56 Int NRO45Reader::read()
     55void NRO45Reader::initDataset()
    5756{
    58   LogIO os( LogOrigin( "NRO45Reader", "read()", WHERE ) ) ;
    59 
    60   // DEBUG
    61   //cout << "NRO45Reader::read()" << endl ;
    62   //
    63   int status = 0 ;
    64 
    65   // create NROOTFDataset
    6657  dataset_ = new NROOTFDataset( filename_ ) ;
    67 
    68   // fill NROOTFDataset
    69   status = dataset_->fillHeader() ;
    70 
    71   if ( status != 0 ) {
    72     os << LogIO::SEVERE << "Failed to fill data header." << LogIO::EXCEPTION ;
    73   }
    74 
    75   return status ;
    7658}
    7759
  • trunk/external-alma/atnf/PKSIO/NRO45Reader.h

    r2154 r2780  
    8080  ~NRO45Reader() ;
    8181
    82   // Read data header
    83   virtual int read() ;
    84 
    8582  // get number of IF
    8683  virtual Int getNumIF() ;
     
    9087
    9188 protected:
     89  // initialize Dataset
     90  virtual void initDataset();
     91 
    9292  // Get Antenna Position in ITRF coordinate
    9393  virtual vector<double> getAntennaPosition() ;
  • trunk/external-alma/atnf/PKSIO/NROReader.cc

    r2777 r2780  
    197197NROReader::~NROReader()
    198198{
     199}
     200
     201// Read data header
     202Int NROReader::read()
     203{
     204  LogIO os( LogOrigin( "NROReader", "read()", WHERE ) ) ;
     205
     206  int status = 0 ;
     207
     208  // initialize Dataset object
     209  initDataset();
     210 
     211  // fill Dataset
     212  status = dataset_->fillHeader() ;
     213
     214  if ( status != 0 ) {
     215    os << LogIO::SEVERE << "Failed to fill data header." << LogIO::EXCEPTION ;
     216  }
     217
     218  return status ;
    199219}
    200220
  • trunk/external-alma/atnf/PKSIO/NROReader.h

    r2764 r2780  
    108108
    109109  // Read data header
    110   virtual Int read() = 0 ;
     110  virtual Int read() ;
    111111
    112112  // Get header information
     
    186186
    187187 protected:
     188  // get Dataset object
     189  virtual void initDataset() = 0;
     190
    188191  // convert time in character representation to MJD representation
    189192  virtual double getMJD( char *time ) ;
Note: See TracChangeset for help on using the changeset viewer.