Changeset 2288


Ignore:
Timestamp:
09/06/11 11:59:37 (13 years ago)
Author:
KohjiNakamura
Message:

dototalpower fixed

Location:
branches/parallel/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/parallel/src/STMath.cpp

    r2285 r2288  
    979979                                              const CountedPtr< Scantable >& caloff, Float tcal )
    980980{
    981 if ( ! calon->conformant(*caloff) ) {
     981  if ( ! calon->conformant(*caloff) ) {
    982982    throw(AipsError("'CAL on' and 'CAL off' scantables are not conformant."));
    983983  }
     
    987987  const Table& tcon = calon->table();
    988988  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");
    10061001
    10071002  if ( tout.nrow() != tcon.nrow() ) {
     
    10741069**/
    10751070      // get tcal if input tcal <= 0
    1076       String tcalt;
    10771071      Float tcalUsed;
    10781072      tcalUsed = tcal;
    10791073      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);
    10831076//         if (polno<=3) {
    10841077//           tcalUsed = tcalout[polno];
  • branches/parallel/src/STMath.h

    r2285 r2288  
    428428
    429429  bool insitu_;
    430 
    431   typedef std::map<std::vector<unsigned int>,std::vector<unsigned int> > TcalIDmap;
    432430};
    433431
Note: See TracChangeset for help on using the changeset viewer.