Changeset 2289 for trunk/src/STMath.cpp
- Timestamp:
- 09/08/11 19:35:40 (13 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src
- Property svn:mergeinfo changed
/branches/parallel/src (added) merged: 2205,2240,2247,2262-2263,2267,2274,2281-2285,2287-2288
- Property svn:mergeinfo changed
-
trunk/src/STMath.cpp
r2278 r2289 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 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"); 990 1001 991 1002 if ( tout.nrow() != tcon.nrow() ) { … … 1058 1069 **/ 1059 1070 // get tcal if input tcal <= 0 1060 String tcalt;1061 1071 Float tcalUsed; 1062 1072 tcalUsed = tcal; 1063 1073 if ( tcal <= 0.0 ) { 1064 caloff->tcal().getEntry(tcalt, tcalout, tcalId); 1074 uInt tcalRecNo = tcalIdToRecNoMap[tcalId]; 1075 calOffTcalTable_TCALcol.get(tcalRecNo, tcalout); 1065 1076 // if (polno<=3) { 1066 1077 // tcalUsed = tcalout[polno]; … … 2418 2429 out->appendToHistoryTable((*it)->history()); 2419 2430 const Table& tab = (*it)->table(); 2431 2432 Block<String> cols(3); 2433 cols[0] = String("FREQ_ID"); 2434 cols[1] = String("MOLECULE_ID"); 2435 cols[2] = String("FOCUS_ID"); 2436 2420 2437 TableIterator scanit(tab, "SCANNO"); 2421 2438 while (!scanit.pastEnd()) { 2422 TableIterator freqit(scanit.table(), "FREQ_ID"); 2423 while ( !freqit.pastEnd() ) { 2424 Table thetab = freqit.table(); 2439 ScalarColumn<uInt> thescannocol(scanit.table(),"SCANNO"); 2440 Vector<uInt> thescannos(thescannocol.nrow(),newscanno); 2441 thescannocol.putColumn(thescannos); 2442 TableIterator subit(scanit.table(), cols); 2443 while ( !subit.pastEnd() ) { 2425 2444 uInt nrow = tout.nrow(); 2445 Table thetab = subit.table(); 2446 ROTableRow row(thetab); 2447 Vector<uInt> thecolvals(thetab.nrow()); 2448 ScalarColumn<uInt> thefreqidcol(thetab,"FREQ_ID"); 2449 ScalarColumn<uInt> themolidcol(thetab, "MOLECULE_ID"); 2450 ScalarColumn<uInt> thefocusidcol(thetab,"FOCUS_ID"); 2451 // The selected subset of table should have 2452 // the equal FREQ_ID, MOLECULE_ID, and FOCUS_ID values. 2453 const TableRecord& rec = row.get(0); 2454 // Set the proper FREQ_ID 2455 Double rv,rp,inc; 2456 (*it)->frequencies().getEntry(rp, rv, inc, rec.asuInt("FREQ_ID")); 2457 uInt id; 2458 id = out->frequencies().addEntry(rp, rv, inc); 2459 thecolvals = id; 2460 thefreqidcol.putColumn(thecolvals); 2461 // Set the proper MOLECULE_ID 2462 Vector<String> name,fname;Vector<Double> rf; 2463 (*it)->molecules().getEntry(rf, name, fname, rec.asuInt("MOLECULE_ID")); 2464 id = out->molecules().addEntry(rf, name, fname); 2465 thecolvals = id; 2466 themolidcol.putColumn(thecolvals); 2467 // Set the proper FOCUS_ID 2468 Float fpa,frot,fax,ftan,fhand,fmount,fuser, fxy, fxyp; 2469 (*it)->focus().getEntry(fpa, fax, ftan, frot, fhand, fmount,fuser, 2470 fxy, fxyp, rec.asuInt("FOCUS_ID")); 2471 id = out->focus().addEntry(fpa, fax, ftan, frot, fhand, fmount,fuser, 2472 fxy, fxyp); 2473 thecolvals = id; 2474 thefocusidcol.putColumn(thecolvals); 2475 2426 2476 tout.addRow(thetab.nrow()); 2427 2477 TableCopy::copyRows(tout, thetab, nrow, 0, thetab.nrow()); 2428 ROTableRow row(thetab); 2429 for ( uInt i=0; i<thetab.nrow(); ++i) { 2430 uInt k = nrow+i; 2431 scannocol.put(k, newscanno); 2432 const TableRecord& rec = row.get(i); 2433 Double rv,rp,inc; 2434 (*it)->frequencies().getEntry(rp, rv, inc, rec.asuInt("FREQ_ID")); 2435 uInt id; 2436 id = out->frequencies().addEntry(rp, rv, inc); 2437 freqidcol.put(k,id); 2438 //String name,fname;Double rf; 2439 Vector<String> name,fname;Vector<Double> rf; 2440 (*it)->molecules().getEntry(rf, name, fname, rec.asuInt("MOLECULE_ID")); 2441 id = out->molecules().addEntry(rf, name, fname); 2442 molidcol.put(k, id); 2443 Float fpa,frot,fax,ftan,fhand,fmount,fuser, fxy, fxyp; 2444 (*it)->focus().getEntry(fpa, fax, ftan, frot, fhand, 2445 fmount,fuser, fxy, fxyp, 2446 rec.asuInt("FOCUS_ID")); 2447 id = out->focus().addEntry(fpa, fax, ftan, frot, fhand, 2448 fmount,fuser, fxy, fxyp); 2449 focusidcol.put(k, id); 2450 } 2451 ++freqit; 2478 2479 ++subit; 2452 2480 } 2453 2481 ++newscanno;
Note: See TracChangeset
for help on using the changeset viewer.