Changeset 1387 for branches/alma/src/Scantable.cpp
- Timestamp:
- 07/27/07 02:00:22 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/alma/src/Scantable.cpp
r1375 r1387 1028 1028 } 1029 1029 1030 std::string asap::Scantable::getAntennaName() const 1031 { 1032 String out; 1033 table_.keywordSet().get("AntennaName", out); 1034 return out; 1035 } 1036 1037 int asap::Scantable::checkScanInfo(const std::vector<int>& scanlist) const 1038 { 1039 String tbpath; 1040 int ret = 0; 1041 if ( table_.keywordSet().isDefined("GBT_GO") ) { 1042 table_.keywordSet().get("GBT_GO", tbpath); 1043 Table t(tbpath,Table::Old); 1044 // check each scan if other scan of the pair exist 1045 int nscan = scanlist.size(); 1046 for (int i = 0; i < nscan; i++) { 1047 Table subt = t( t.col("SCAN") == scanlist[i]+1 ); 1048 if (subt.nrow()==0) { 1049 cerr <<"Scan "<<scanlist[i]<<" cannot be found in the scantable."<<endl; 1050 ret = 1; 1051 break; 1052 } 1053 ROTableRow row(subt); 1054 const TableRecord& rec = row.get(0); 1055 int scan1seqn = rec.asuInt("PROCSEQN"); 1056 int laston1 = rec.asuInt("LASTON"); 1057 if ( rec.asuInt("PROCSIZE")==2 ) { 1058 if ( i < nscan-1 ) { 1059 Table subt2 = t( t.col("SCAN") == scanlist[i+1]+1 ); 1060 if ( subt2.nrow() == 0) { 1061 cerr<<"Scan "<<scanlist[i+1]<<" cannot be found in the scantable."<<endl; 1062 ret = 1; 1063 break; 1064 } 1065 ROTableRow row2(subt2); 1066 const TableRecord& rec2 = row2.get(0); 1067 int scan2seqn = rec2.asuInt("PROCSEQN"); 1068 int laston2 = rec2.asuInt("LASTON"); 1069 if (scan1seqn == 1 && scan2seqn == 2) { 1070 if (laston1 == laston2) { 1071 cerr<<"A valid scan pair ["<<scanlist[i]<<","<<scanlist[i+1]<<"]"<<endl; 1072 i +=1; 1073 } 1074 else { 1075 cerr<<"Incorrect scan pair ["<<scanlist[i]<<","<<scanlist[i+1]<<"]"<<endl; 1076 } 1077 } 1078 else if (scan1seqn==2 && scan2seqn == 1) { 1079 if (laston1 == laston2) { 1080 cerr<<"["<<scanlist[i]<<","<<scanlist[i+1]<<"] is a valid scan pair but in incorrect order."<<endl; 1081 ret = 1; 1082 break; 1083 } 1084 } 1085 else { 1086 cerr<<"The other scan for "<<scanlist[i]<<" appears to be missing. Check the input scan numbers."<<endl; 1087 ret = 1; 1088 break; 1089 } 1090 } 1091 } 1092 else { 1093 cerr<<"The scan does not appear to be standard obsevation."<<endl; 1094 } 1095 //if ( i >= nscan ) break; 1096 } 1097 } 1098 else { 1099 cerr<<"No reference to GBT_GO table."<<endl; 1100 ret = 1; 1101 } 1102 return ret; 1103 } 1104 1105 std::vector<double> asap::Scantable::getDirectionVector(int whichrow) const 1106 { 1107 Vector<Double> Dir = dirCol_(whichrow).getAngle("rad").getValue(); 1108 std::vector<double> dir; 1109 Dir.tovector(dir); 1110 return dir; 1111 } 1112 1030 1113 } 1031 1114 //namespace asap
Note: See TracChangeset
for help on using the changeset viewer.