Changeset 3095 for trunk/external-alma/atnf
- Timestamp:
- 02/19/16 12:09:15 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/external-alma/atnf/PKSIO/NRODataset.cc
r3012 r3095 45 45 #include <math.h> 46 46 #include <fstream> 47 #include <iostream> 47 48 48 49 #define STRING2CHAR(s) const_cast<char *>((s).c_str()) … … 1221 1222 Bool match2 = false; 1222 1223 for (int i = 0; i < arrayMax(); i++) { 1223 //cout << "RX[" << i << "]=" << RX[i] << endl; 1224 //cout << "RX[" << i << "]=\"" << RX[i] << "\"" << endl; 1225 1226 String rxString(RX[i]); 1227 //cout << "rxString = \"" << rxString << "\" rxString.size() = " << rxString.size() << endl; 1228 1229 // RX may contain some null characters at the end 1230 // Remove it for pattern matching 1231 rxString.rtrim('\0'); 1232 //cout << "rxString (rtrim) = \"" << rxString << "\" rxString.size() = " << rxString.size() << endl; 1233 1234 // Also remove whitespaces 1235 rxString.trim(); 1236 //cout << "rxString (trim) = \"" << rxString << "\" rxString.size() = " << rxString.size() << endl; 1237 1224 1238 if (!match1) { 1225 match1 = (reRx1.match( RX[i].c_str(), RX[i].size()) != String::npos);1239 match1 = (reRx1.match(rxString.c_str(), rxString.size()) != String::npos); 1226 1240 } 1227 1241 if (!match2) { 1228 match2 = (reRx2.match( RX[i].c_str(), RX[i].size()) != String::npos);1242 match2 = (reRx2.match(rxString.c_str(), rxString.size()) != String::npos); 1229 1243 } 1230 1244 } … … 1577 1591 // For others, POLNO is always 0. 1578 1592 String rxString(rx); 1593 //cout << "rx='" << rxString << "' (size " << rxString.length() << ")" << endl; 1594 1595 // see getPolarizationNum for detail why we need to trim 1596 rxString.rtrim('\0'); 1579 1597 rxString.trim(); 1580 //cout << "rx='" << rxString << "' (size " << rxString.size() << ")" << endl; 1598 1581 1599 Regex reRx("(.*V|H20ch2)$"); 1582 if (reRx.match(rxString.c_str(), rxString. size()) != String::npos) {1600 if (reRx.match(rxString.c_str(), rxString.length()) != String::npos) { 1583 1601 //cout << "match!" << endl; 1584 1602 polno = 1; 1585 1603 } 1604 //cout << "polno = " << polno << endl; 1586 1605 return polno ; 1587 1606 }
Note:
See TracChangeset
for help on using the changeset viewer.