- Timestamp:
- 09/06/11 11:59:37 (13 years ago)
- Location:
- branches/parallel/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/parallel/src/STMath.cpp
r2285 r2288 979 979 const CountedPtr< Scantable >& caloff, Float tcal ) 980 980 { 981 if ( ! calon->conformant(*caloff) ) {981 if ( ! calon->conformant(*caloff) ) { 982 982 throw(AipsError("'CAL on' and 'CAL off' scantables are not conformant.")); 983 983 } … … 987 987 const Table& tcon = calon->table(); 988 988 Vector<Float> tcalout; 989 Vector<Float> tcalout2; //debug 990 991 const Table& subtcal = caloff->tcal().table(); 992 static STMath::TcalIDmap mt1; 993 const Table& tout_const = caloff->table(); 994 ROScalarColumn<uInt> outTcalIdCol(tout_const, "TCAL_ID"); 995 Vector<uInt> vinID = outTcalIdCol.getColumn(); 996 vector<unsigned int> vint,vintsub; 997 ROScalarColumn<uInt> outtcalSubIdCol(subtcal, "ID"); 998 Vector<uInt> vinSubRowNo = outtcalSubIdCol.getColumn(); 999 ROArrayColumn<Float> TCAL_Col(subtcal, "TCAL"); 1000 vector<unsigned int>::iterator ite_vint=vint.begin(),ite_vintsub=vintsub.begin(); 1001 vint.insert(ite_vint,vinID.begin(),vinID.end()); 1002 vintsub.insert(ite_vintsub,vinSubRowNo.begin(),vinSubRowNo.end()); 1003 mt1.insert(pair<vector<unsigned int>,vector<unsigned int> > (vint,vintsub) ); 1004 TcalIDmap::iterator ite_p; 1005 ite_p = mt1.find(vint); 989 990 std::map<uInt,uInt> tcalIdToRecNoMap; 991 const Table& calOffTcalTable = caloff->tcal().table(); 992 { 993 ROScalarColumn<uInt> calOffTcalTable_IDcol(calOffTcalTable, "ID"); 994 const Vector<uInt> tcalIds(calOffTcalTable_IDcol.getColumn()); 995 size_t tcalIdsEnd = tcalIds.nelements(); 996 for (uInt i = 0; i < tcalIdsEnd; i++) { 997 tcalIdToRecNoMap[tcalIds[i]] = i; 998 } 999 } 1000 ROArrayColumn<Float> calOffTcalTable_TCALcol(calOffTcalTable, "TCAL"); 1006 1001 1007 1002 if ( tout.nrow() != tcon.nrow() ) { … … 1074 1069 **/ 1075 1070 // get tcal if input tcal <= 0 1076 String tcalt;1077 1071 Float tcalUsed; 1078 1072 tcalUsed = tcal; 1079 1073 if ( tcal <= 0.0 ) { 1080 // caloff->tcal().getEntry(tcalt, tcalout, tcalId); 1081 uInt intTCAL = ite_p->second[(unsigned int)tcalId]; 1082 TCAL_Col.get(intTCAL,tcalout); 1074 uInt tcalRecNo = tcalIdToRecNoMap[tcalId]; 1075 calOffTcalTable_TCALcol.get(tcalRecNo, tcalout); 1083 1076 // if (polno<=3) { 1084 1077 // tcalUsed = tcalout[polno]; -
branches/parallel/src/STMath.h
r2285 r2288 428 428 429 429 bool insitu_; 430 431 typedef std::map<std::vector<unsigned int>,std::vector<unsigned int> > TcalIDmap;432 430 }; 433 431
Note:
See TracChangeset
for help on using the changeset viewer.