Ignore:
Timestamp:
01/23/13 19:48:24 (11 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...

POLNO is properly set according to RX name. When RX name ends with 'V'
or is 'H20ch2', POLNO will be set to 1. Otherwise, POLNO is 0.


File:
1 edited

Legend:

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

    r2643 r2748  
    3333#include <atnf/PKSIO/NRODataset.h>
    3434#include <casa/OS/Time.h>
     35#include <casa/Utilities/Regex.h>
    3536#include <scimath/Mathematics/InterpolateArray1D.h>
    3637
     
    377378    LogIO os( LogOrigin("NRODataset","getSpectrum",WHERE) ) ;
    378379    os << LogIO::WARN << "zero spectrum for row " << i << LogIO::POST ;
    379     if ( spec.size() != nchan )
     380    if ( spec.size() != (unsigned int)nchan )
    380381      spec.resize( nchan ) ;
    381382    for ( vector<double>::iterator i = spec.begin() ;
     
    418419      LogIO os( LogOrigin( "NRODataset", "getSpectrum", WHERE ) ) ;
    419420      os << LogIO::SEVERE << "ivalue for row " << i << " is out of range" << LogIO::EXCEPTION ;
    420       if ( spec.size() != nchan )
     421      if ( spec.size() != (unsigned int)nchan )
    421422        spec.resize( nchan ) ;
    422423      for ( vector<double>::iterator i = spec.begin() ;
     
    840841//   cout << "HORN[" << idx << "]=" << HORN[idx]
    841842//        << ", RX[" << idx << "]=" << RX[idx] << endl ;
    842   return polNoFromRX( RX[idx].c_str() ) ;
    843 }
    844 
    845 uInt NRODataset::polNoFromRX( const char *rx )
     843  return polNoFromRX( RX[idx] ) ;
     844}
     845
     846uInt NRODataset::polNoFromRX( const string &rx )
    846847{
    847848  uInt polno = 0 ;
    848   // 2012/03/15 TN
    849   // T100H/V is multi-polarization receiver which is installed
    850   // on NRO 45m telescope. Here, POLNO is assigned as follows:
     849  // 2013/01/23 TN
     850  // In NRO 45m telescope, naming convension for dual-polarization
     851  // receiver is as follows:
    851852  //
    852   //    POLNO=0: T100H
    853   //          1: T100V
     853  //    xxxH for horizontal component,
     854  //    xxxV for vertical component.
    854855  //
    855   // For other receivers, POLNO is always 0.
    856   if ( strncmp( rx, "T100V", 5 ) == 0 )
    857     polno = 1 ;
     856  // Exception is H20ch1/ch2.
     857  // Here, POLNO is assigned as follows:
     858  //
     859  //    POLNO=0: xxxH or H20ch1
     860  //          1: xxxV or H20ch2
     861  //
     862  // For others, POLNO is always 0.
     863  String rxString(rx);
     864  rxString.trim();
     865  //cout << "rx='" << rxString << "' (size " << rxString.size() << ")" << endl;
     866  Regex reRx("(.*V|H20ch2)$");
     867  if (reRx.match(rxString.c_str(), rxString.size()) != String::npos) {
     868    //cout << "match!" << endl;
     869    polno = 1;
     870  }
    858871  return polno ;
    859872}
Note: See TracChangeset for help on using the changeset viewer.