- Timestamp:
- 03/13/14 17:24:50 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/STMath.cpp
r2904 r2905 2581 2581 uInt ifnoCounter = max(ifnocol.getColumn()) + 1; 2582 2582 2583 // Here we assume that each IFNO has unique MOLECULE_ID 2584 // molIdMap: 2585 // KEY: IFNO 2586 // VALUE: MOLECULE_ID 2587 map<uInt, uInt> molIdMap; 2588 { 2589 TableIterator ifit(tout, "IFNO"); 2590 while (!ifit.pastEnd()) { 2591 ROTableRow row(ifit.table()); 2592 const TableRecord& rec = row.get(0); 2593 molIdMap[rec.asuInt("IFNO")] = rec.asuInt("MOLECULE_ID"); 2594 ifit.next(); 2595 } 2596 } 2597 2583 2598 while ( it != in.end() ){ 2584 2599 // Check FREQUENCIES/BASEFRAME … … 2599 2614 cols[1] = String("MOLECULE_ID"); 2600 2615 cols[2] = String("FOCUS_ID"); 2601 2616 2602 2617 TableIterator scanit(tab, "SCANNO"); 2603 2618 while (!scanit.pastEnd()) { … … 2624 2639 // default value is new unique IFNO 2625 2640 uInt newifno = ifnoCounter; 2641 Bool isIfMerged = False; 2626 2642 uInt nchan = rec.asArrayFloat("SPECTRA").shape()[0]; 2627 2643 //id = out->frequencies().addEntry(rp, rv, inc); … … 2663 2679 // renumber IFNO to be same as existing value that corresponds to nchan 2664 2680 newifno = nchanMap[nchan]; 2681 isIfMerged = True; 2665 2682 } 2666 2683 os << LogIO::DEBUGGING << "newifno = " << newifno << LogIO::POST; … … 2676 2693 (*it)->molecules().getEntry(rf, name, fname, rec.asuInt("MOLECULE_ID")); 2677 2694 id = out->molecules().addEntry(rf, name, fname); 2695 if (molIdMap.find(newifno) == molIdMap.end()) { 2696 // add new entry to molIdMap 2697 molIdMap[newifno] = id; 2698 } 2699 if (isIfMerged) { 2700 id = molIdMap[newifno]; 2701 } 2678 2702 thecolvals = id; 2679 2703 molidcol.putColumnRange(slice, thecolvals);
Note:
See TracChangeset
for help on using the changeset viewer.