Changeset 2829 for trunk/src


Ignore:
Timestamp:
07/31/13 12:22:38 (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): asap.scantable.average_time, asap.asapmath.average_time,

and all SD tasks that does averaging.

Description: STMath::average function now takes FLAGROW of scantable

into account in averaging.


File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/STMath.cpp

    r2818 r2829  
    128128  ScalarColumn<uInt> cycColOut(tout,"CYCLENO");
    129129  ScalarColumn<uInt> scanColOut(tout,"SCANNO");
     130  ScalarColumn<uInt> flagRowColOut(tout,"FLAGROW");
    130131
    131132  // set up the output table rows. These are based on the structure of the
     
    141142  ROScalarColumn<Double> mjdCol, intCol;
    142143  ROScalarColumn<Int> scanIDCol;
     144  ROScalarColumn<uInt> flagRowCol;
    143145
    144146  //Vector<uInt> rowstodelete;
     
    240242    intCol.attach(baset,"INTERVAL");
    241243    mjdCol.attach(baset,"TIME");
     244    flagRowCol.attach(baset,"FLAGROW");
    242245    Vector<Float> spec,tsys;
    243246    Vector<uChar> flag;
    244247    Double inter,time;
     248    uInt flagRow;
    245249
    246250    for (uInt l = 0; l < rows.nelements(); ++l ) {
     
    248252      flagCol.get(k, flag);
    249253      Vector<Bool> bflag(flag.shape());
    250       convertArray(bflag, flag);
     254      flagRowCol.get(k, flagRow);
     255      if (flagRow > 0)
     256        bflag = true;
     257      else
     258        convertArray(bflag, flag);
    251259      /*                                                                                                   
    252260        if ( allEQ(bflag, True) ) {                                                                         
     
    334342      intCol.attach(subt,"INTERVAL");
    335343      mjdCol.attach(subt,"TIME");
     344      flagRowCol.attach(subt,"FLAGROW");
    336345      for (uInt k = 0; k < subt.nrow(); ++k ) {
    337346        flagCol.get(k, flag);
    338347        Vector<Bool> bflag(flag.shape());
    339         convertArray(bflag, flag);
     348        flagRowCol.get(k, flagRow);
     349        if (flagRow > 0)
     350          bflag = true;
     351        else
     352          convertArray(bflag, flag);
    340353        /*
    341354        if ( allEQ(bflag, True) ) {
     
    387400      // which requires resetting this value
    388401      cycColOut.put(i, uInt(0));
     402      // completely flagged rows are removed anyway
     403      flagRowColOut.put(i, uInt(0));
    389404    } else {
    390405      os << "For output row="<<i<<", all input rows of data are flagged. no averaging" << LogIO::POST;
Note: See TracChangeset for help on using the changeset viewer.