Changeset 2748 for trunk/external-alma/atnf/PKSIO/NRODataset.cc
- Timestamp:
- 01/23/13 19:48:24 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/external-alma/atnf/PKSIO/NRODataset.cc
r2643 r2748 33 33 #include <atnf/PKSIO/NRODataset.h> 34 34 #include <casa/OS/Time.h> 35 #include <casa/Utilities/Regex.h> 35 36 #include <scimath/Mathematics/InterpolateArray1D.h> 36 37 … … 377 378 LogIO os( LogOrigin("NRODataset","getSpectrum",WHERE) ) ; 378 379 os << LogIO::WARN << "zero spectrum for row " << i << LogIO::POST ; 379 if ( spec.size() != nchan )380 if ( spec.size() != (unsigned int)nchan ) 380 381 spec.resize( nchan ) ; 381 382 for ( vector<double>::iterator i = spec.begin() ; … … 418 419 LogIO os( LogOrigin( "NRODataset", "getSpectrum", WHERE ) ) ; 419 420 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 ) 421 422 spec.resize( nchan ) ; 422 423 for ( vector<double>::iterator i = spec.begin() ; … … 840 841 // cout << "HORN[" << idx << "]=" << HORN[idx] 841 842 // << ", 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 846 uInt NRODataset::polNoFromRX( const string &rx ) 846 847 { 847 848 uInt polno = 0 ; 848 // 201 2/03/15TN849 // T100H/V is multi-polarization receiver which is installed850 // 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: 851 852 // 852 // POLNO=0: T100H853 // 1: T100V853 // xxxH for horizontal component, 854 // xxxV for vertical component. 854 855 // 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 } 858 871 return polno ; 859 872 }
Note: See TracChangeset
for help on using the changeset viewer.