Changeset 1518 for branches/alma/src


Ignore:
Timestamp:
02/25/09 16:48:24 (16 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: Yes CAS-1043

Ready to Release: No

Interface Changes: No

What Interface Changed: Please list interface changes

Test Programs: asap_init()

s=sd.scantable('NRO_DATA_FILE',False)

Put in Release Notes: No

Module(s): Module Names change impacts.

Description:

Changed to get header informations together using newly defined method
NROReader::getHeaderInfo().

File:
1 edited

Legend:

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

    r1495 r1518  
    455455       << ttm->tm_hour << ":" << ttm->tm_min << ":" << ttm->tm_sec
    456456       << ")" << endl ;
    457   //
    458 //   if ( nreader_->open() != 0 ) {
    459 //     throw( AipsError( "Error while opening file "+filename_ ) ) ;
    460 //   }
    461 
    462   isNRO_ = true ;
    463 
    464   // store data into  NROHeader and NRODataset
    465   //if ( nreader_->readHeader() != 0 ) {
    466   //throw( AipsError( "Error while reading file "+filename_ ) ) ;
    467   //}
    468 
    469   // get header data
    470   NROHeader *nheader =  nreader_->getHeader() ;
    471457
    472458  // fill STHeader
    473459  header_ = new STHeader() ;
    474460
    475   header_->nchan = nheader->getNUMCH() ;
    476   header_->npol = nreader_->getPolarizationNum() ;
    477   header_->observer = nheader->getOBSVR() ;
    478   header_->project = nheader->getPROJ() ;
    479   header_->obstype = nheader->getSWMOD() ;
    480   header_->antennaname = nheader->getSITE() ;
    481   // TODO: should be investigated antenna position since there are
    482   //       no corresponding information in the header
    483   // 2008/11/13 Takeshi Nakazato
    484   //
    485   // INFO: tentative antenna posiiton is obtained for NRO 45m from ITRF website
    486   // 2008/11/26 Takeshi Nakazato
    487   vector<double> pos = nreader_->getAntennaPosition() ;
    488   header_->antennaposition = pos ;
    489   char *eq = nheader->getEPOCH() ;
    490   if ( strncmp( eq, "B1950", 5 ) == 0 )
    491     header_->equinox = 1950.0 ;
    492   else if ( strncmp( eq, "J2000", 5 ) == 0 )
    493     header_->equinox = 2000.0 ;
    494 //   char *vref = nheader->getVREF() ;
    495 //   if ( strncmp( vref, "LSR", 3 ) == 0 ) {
    496 //     strcat( vref, "K" ) ;
    497 //   }
    498 //   header_->freqref = vref ;
    499   nreader_->getData( 0 ) ;
    500   header_->reffreq = nreader_->getData()->FREQ0 ;
    501   header_->bandwidth = nheader->getBEBW()[0] ;
    502   header_->utc = nreader_->getStartTime() ;
    503   header_->fluxunit = "K" ;
    504   header_->epoch = "UTC" ; 
    505   char *poltp = nheader->getPOLTP()[0] ;
    506   if ( strcmp( poltp, "" ) == 0 )
    507     poltp = "None" ;
    508   header_->poltype = poltp ;
    509   // DEBUG
    510   cout << "STFiller::openNRO()  poltype = " << header_->poltype << endl ;
    511   //
    512 
     461  if ( nreader_->getHeaderInfo( header_->nchan,
     462                                header_->npol,
     463                                nIF_,
     464                                nBeam_,
     465                                header_->observer,
     466                                header_->project,
     467                                header_->obstype,
     468                                header_->antennaname,
     469                                header_->antennaposition,
     470                                header_->equinox,
     471                                header_->freqref,
     472                                header_->reffreq,
     473                                header_->bandwidth,
     474                                header_->utc,
     475                                header_->fluxunit,
     476                                header_->epoch,
     477                                header_->poltype ) ) {
     478    cout << "STFiller::openNRO()  Failed to get header information." << endl ;
     479    return ;
     480  }
     481
     482  ifOffset_ = 0;
    513483  vector<Bool> ifs = nreader_->getIFs() ;
    514   ifOffset_ = 0;
    515   nIF_ = ifs.size() ;
    516484  if ( whichIF >= 0 ) {
    517485    if ( whichIF >= 0 && whichIF < nIF_ ) {
     
    533501  beamOffset_ = 0;
    534502  vector<Bool> beams = nreader_->getBeams() ;
    535   nBeam_ = beams.size() ;
    536503  if (whichBeam>=0) {
    537504    if (whichBeam>=0 && whichBeam<nBeam_) {
     
    550517    }
    551518  }
     519
    552520  header_->nbeam = nBeam_ ;
    553521  header_->nif = nIF_ ;
Note: See TracChangeset for help on using the changeset viewer.