Ignore:
Timestamp:
07/13/11 15:23:29 (13 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: Yes CAS-1913

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...

Get frequency reference frame from the data.


Location:
trunk/external-alma/asdm2ASAP
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/external-alma/asdm2ASAP/ASDMFiller.cc

    r2208 r2218  
    6363  // header
    6464  fillHeader() ;
     65
     66  // set Frame for FREQUENCIES table
     67  string sFreqFrame = reader_->getFrame() ;
     68  MFrequency::Types freqFrame = toFrameType( sFreqFrame ) ;
     69  table_->frequencies().setFrame( freqFrame, false ) ;
     70  table_->frequencies().setFrame( freqFrame, true ) ;
    6571 
    6672  Vector<casa::Double> antpos = table_->getHeader().antennaposition ;
     
    506512}
    507513
     514MFrequency::Types ASDMFiller::toFrameType( string &s )
     515{
     516  MFrequency::Types ftype = MFrequency::DEFAULT ;
     517  if ( s == "LABREST" )
     518    ftype = MFrequency::REST ;
     519  else {
     520    Bool b = MFrequency::getType( ftype, String(s) ) ;
     521    if (!b)
     522      ftype = MFrequency::DEFAULT ;
     523  }
     524  return ftype ;
     525}
  • trunk/external-alma/asdm2ASAP/ASDMFiller.h

    r2208 r2218  
    7474                casa::Vector<casa::Double> antpos ) ;
    7575
     76  // get frequency frame enum value from string
     77  casa::MFrequency::Types toFrameType( std::string &s ) ;
     78
    7679  casa::CountedPtr<ASDMReader> reader_ ;
    7780  casa::Int antennaId_ ;
  • trunk/external-alma/asdm2ASAP/ASDMReader.cc

    r2216 r2218  
    16491649  logsink_ = logsink ;
    16501650}
     1651
     1652string ASDMReader::getFrame()
     1653{
     1654  String funcName = "getFrame" ;
     1655 
     1656  // default is TOPO
     1657  string frame = "TOPO" ;
     1658
     1659  SpectralWindowTable &spwtab = asdm_->getSpectralWindow() ;
     1660  vector<SpectralWindowRow *> rows = spwtab.get() ;
     1661  vector<FrequencyReferenceCode> measFreqRef( rows.size() ) ;
     1662  int nref = 0 ;
     1663  for ( unsigned int irow = 0 ; irow < rows.size() ; irow++ ) {
     1664    int nchan = rows[irow]->getNumChan() ;
     1665    if ( nchan != 4 ) {
     1666      if ( rows[irow]->isMeasFreqRefExists() ) {
     1667        measFreqRef[nref] = rows[irow]->getMeasFreqRef() ;
     1668        nref++ ;
     1669      }
     1670    }
     1671  }
     1672  if ( nref != 0 ) {
     1673    frame = CFrequencyReferenceCode::toString( measFreqRef[0] ) ;
     1674  }
     1675 
     1676  logsink_->postLocally( LogMessage("frame = "+String::toString(frame),LogOrigin(className_,funcName,WHERE)) ) ;
     1677
     1678  return frame ;
     1679}
  • trunk/external-alma/asdm2ASAP/ASDMReader.h

    r2215 r2218  
    392392   **/
    393393  unsigned int getNumData() { return numData_ ; } ;
     394
     395  /**
     396   * get frequency frame
     397   *
     398   * @return string representating frequency frame
     399   **/
     400  std::string getFrame() ;
    394401
    395402  /**
Note: See TracChangeset for help on using the changeset viewer.