Changeset 2220


Ignore:
Timestamp:
07/13/11 17:54:48 (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...

Number of IFs is not a number of rows of SpectralWindow table,
but a number of frequency groups.
When freqGroup is not defined, number of IFs is set to number
of non-WVR spectral windows plus 1 (WVR spectral window).


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

Legend:

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

    r2218 r2220  
    6969  table_->frequencies().setFrame( freqFrame, false ) ;
    7070  table_->frequencies().setFrame( freqFrame, true ) ;
     71  //logsink_->postLocally( LogMessage("sFreqFrame = "+sFreqFrame,LogOrigin(className_,funcName,WHERE)) ) ;
    7172 
    7273  Vector<casa::Double> antpos = table_->getHeader().antennaposition ;
     
    111112      uInt nrow = reader_->getNumMainRow() ;
    112113
    113       //logsink_->postLocally( LogMessage("There are "+String::toString(nrow)+" rows in Main table corresponding to configDescId "+String::toString(configDescIdList[icon]+" fieldId "+String::toString(fieldIdList[ifield]),LogOrigin(className_,funcName,WHERE)) ) ;
     114      //logsink_->postLocally( LogMessage("There are "+String::toString(nrow)+" rows in Main table corresponding to configDescId "+String::toString(configDescIdList[icon])+" fieldId "+String::toString(fieldIdList[ifield]),LogOrigin(className_,funcName,WHERE)) ) ;
    114115     
    115116      // CYCLENO
     
    132133        if ( !(reader_->setData()) ) {
    133134          // skip row since reader failed to retrieve data
    134           //logsink_->postLocally( LogMessage("skip "+String::toString(irow),LogOrigin(className_,funcName,WHRER)) ) ;
     135          //logsink_->postLocally( LogMessage("skip "+String::toString(irow),LogOrigin(className_,funcName,WHERE)) ) ;
    135136          continue ;
    136137        }
  • trunk/external-alma/asdm2ASAP/ASDMReader.cc

    r2218 r2220  
    212212  processStation() ;
    213213
    214   logsink_->postLocally( LogMessage(  "antennaId_ = "+String::toString(antennaId_), LogOrigin() ) ) ;
    215   logsink_->postLocally( LogMessage(  "antennaName_ = "+antennaName_, LogOrigin() ) ) ;
     214  logsink_->postLocally( LogMessage(  "antennaId_ = "+String::toString(antennaId_), LogOrigin(className_,funcName,WHERE) ) ) ;
     215  logsink_->postLocally( LogMessage(  "antennaName_ = "+antennaName_, LogOrigin(className_,funcName,WHERE) ) ) ;
    216216
    217217  return true ;
     
    294294  SpectralWindowTable &spwtab = asdm_->getSpectralWindow() ;
    295295  vector<SpectralWindowRow *> spwrows = spwtab.get() ;
     296  int nspwrow = spwrows.size() ;
    296297
    297298  // nif
    298   nif = spwrows.size() ;
     299  //nif = spwrows.size() ;
     300  nif = getNumIFs() ;
    299301
    300302  // nchan
    301303  int refidx = -1 ;
    302304  vector<int> nchans ;
    303   for ( int irow = 0 ; irow < nif ; irow++ ) {
     305  for ( int irow = 0 ; irow < nspwrow ; irow++ ) {
    304306    nchans.push_back( spwrows[irow]->getNumChan() ) ;
    305307    if ( refidx == -1 && nchans[irow] != 1 && nchans[irow] != 4 )
     
    312314  // bandwidth
    313315  vector<double> bws ;
    314   for ( int irow = 0 ; irow < nif ; irow++ ) {
     316  for ( int irow = 0 ; irow < nspwrow ; irow++ ) {
    315317    if ( nchans[irow] != 4 ) { // exclude WVR data
    316318      bws.push_back( spwrows[irow]->getTotBandwidth().get() ) ;
     
    16741676  }
    16751677 
    1676   logsink_->postLocally( LogMessage("frame = "+String::toString(frame),LogOrigin(className_,funcName,WHERE)) ) ;
     1678  //logsink_->postLocally( LogMessage("frame = "+String::toString(frame),LogOrigin(className_,funcName,WHERE)) ) ;
    16771679
    16781680  return frame ;
    16791681}
     1682
     1683int ASDMReader::getNumIFs()
     1684{
     1685  String funcName = "getNumIFs" ;
     1686
     1687  int nif = 0 ;
     1688  vector<SpectralWindowRow *> rows = asdm_->getSpectralWindow().get() ;
     1689  unsigned int nrow = rows.size() ;
     1690  // check if all rows have freqGroup attribute
     1691  bool freqGroupExists = true ;
     1692  bool countedWvr = false ;
     1693  for ( unsigned int irow = 0 ; irow < nrow ; irow++ ) {
     1694    freqGroupExists &= rows[irow]->isFreqGroupExists() ;
     1695    if ( rows[irow]->getNumChan() == 4 ) {
     1696      if ( !countedWvr ) {
     1697        countedWvr = true ;
     1698        nif++ ;
     1699      }
     1700    }
     1701    else {
     1702      nif++ ;
     1703    }
     1704  }
     1705 
     1706  if ( freqGroupExists ) {
     1707    vector<int> freqGroup(0) ;
     1708    for ( unsigned int irow = 0 ; irow < nrow ; irow++ ) {
     1709      int fg = rows[irow]->getFreqGroup() ;
     1710      if ( (int)count( freqGroup.begin(), freqGroup.end(), fg ) == 0 ) {
     1711        freqGroup.push_back( fg ) ;
     1712      }
     1713    }
     1714    nif = freqGroup.size() ;
     1715  }
     1716
     1717  //logsink_->postLocally( LogMessage("nif = "+String::toString(nif),LogOrigin(className_,funcName,WHERE)) ) ;
     1718
     1719  return nif ;
     1720}
  • trunk/external-alma/asdm2ASAP/ASDMReader.h

    r2218 r2220  
    495495                double mjd,
    496496                casa::Vector<casa::Double> antpos ) ;
     497
     498  /**
     499   * get nIF
     500   *
     501   * @return number of IFs
     502   **/
     503  int getNumIFs() ;
    497504
    498505  asdm::ASDM *asdm_ ; // pointer to ASDM object
  • trunk/external-alma/asdm2ASAP/asdm2ASAP.cc

    r2216 r2220  
    148148    if ( dir.exists() ) {
    149149      if ( overwrite ) {
    150         //*os << "Delete existing file " << outname << " ..." << LogIO::POST ;
    151150        logsink_p->postLocally( LogMessage("Delete existing file "+outname+" ...",LogOrigin(funcname,WHERE)) ) ;
    152151        dir.removeRecursive() ;
    153152      }
    154153      else {
    155         //*os << LogIO::WARN << "Output file " << outname << " exists." << LogIO::POST ;
    156154        logsink_p->postLocally( LogMessage("Output file "+outname+" exists.",LogOrigin(funcname,WHERE),LogMessage::WARN) ) ;
    157155        return 1 ;
     
    167165    // save data only if nrow is not zero
    168166    if ( stable->nrow() > 0 ) {
    169       //*os << "Creating " << outname << "..." << LogIO::POST ;
    170167      logsink_p->postLocally( LogMessage("Creating "+outname+"...",LogOrigin(funcname,WHERE)) ) ;
    171168      stable->makePersistent( outname ) ;
    172169    }
    173170    else {
    174       //*os << outname << " will not be created since there are no data associate with the selection" << LogIO::POST ;
    175171      logsink_p->postLocally( LogMessage(outname+" will not be created since there are no data associate with the selection",LogOrigin(funcname,WHERE)) ) ;
    176172    }
     
    184180  if ( logfile.size() != 0 )
    185181    ofs.close() ;
    186   //delete os ;
    187182
    188183  return 0 ;
Note: See TracChangeset for help on using the changeset viewer.