Changeset 2858


Ignore:
Timestamp:
09/14/13 13:04:02 (11 years ago)
Author:
Kana Sugimoto
Message:

New Development: No

JIRA Issue: Yes

Ready for Test: Yes

Interface Changes: No

What Interface Changed:

Test Programs:

Put in Release Notes: No

Module(s):

Description: a bug fix to flag definition of lchan and rchan.


File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/STSideBandSep.cpp

    r2857 r2858  
    8888STSideBandSep::~STSideBandSep()
    8989{
    90 #ifdef KS_DEBUG
    91   cout << "Destructor ~STSideBandSep()" << endl;
    92 #endif
    9390};
    9491
     
    241238void STSideBandSep::separate(string outname)
    242239{
    243 #ifdef KS_DEBUG
    244   cout << "STSideBandSep::separate" << endl;
    245 #endif
    246240  LogIO os(LogOrigin("STSideBandSep","separate()", WHERE));
    247241  if (outname.empty())
     
    767761      accflag[j] |= shiftvec[j];
    768762  }
     763  outflag = accflag;
    769764  // Shift back Flag
    770   shiftFlag(accflag, thisShift->at(0), outflag);
     765  //cout << "Shifting FLAG back to " << thisShift->at(0) << " channels" << endl;
     766  //shiftFlag(accflag, thisShift->at(0), outflag);
    771767
    772768  return outflag;
     
    867863
    868864#ifdef KS_DEBUG
    869   cout << "Start shifting spectrum for " << shift << "channels" << endl;
     865  cout << "Start shifting spectrum for " << shift << " channels" << endl;
    870866#endif
    871867
     
    885881    outvec(lchan) += invec(i) * lweight;
    886882    outvec(rchan) += invec(i) * rweight;
     883#ifdef KS_DEBUG
     884    if (i == 2350 || i== 2930) {
     885      cout << "Channel= " << i << " of input vector: " << endl;
     886      cout << "L channel = " << lchan << endl;
     887      cout << "R channel = " << rchan << endl;
     888      cout << "L weight = " << lweight << endl;
     889      cout << "R weight = " << rweight << endl;
     890    }
     891#endif
    887892  }
    888893};
     
    913918  if (rweight < 0.) rweight += 1.;
    914919  if (rweight < tolerance){
     920    // the shift is almost lchan
     921    ruse = false;
     922    luse = true;
     923  }
     924  if (rweight > 1-tolerance){
     925    // the shift is almost rchan
    915926    ruse = true;
    916927    luse = false;
    917   }
    918   if (rweight > 1-tolerance){
    919     ruse = false;
    920     luse = true;
    921928  }
    922929  uInt lchan, rchan;
     
    929936    outvec(lchan) |= (invec(i) && luse);
    930937    outvec(rchan) |= (invec(i) && ruse);
     938#ifdef KS_DEBUG
     939    if (i == 2350 || i == 2930) {
     940      cout << "Channel= " << i << " of input vector: " << endl;
     941      cout << "L channel = " << lchan << endl;
     942      cout << "R channel = " << rchan << endl;
     943      cout << "L channel will be " << (luse ? "used" : "ignored") << endl;
     944      cout << "R channel will be " << (ruse ? "used" : "ignored") << endl;
     945    }
     946#endif
    931947  }
    932948};
Note: See TracChangeset for help on using the changeset viewer.