Changeset 2958 for trunk/src


Ignore:
Timestamp:
06/26/14 18:08:46 (10 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: Yes CAS-6582, CAS-6571

Ready for Test: Yes

Interface Changes: Yes/No

What Interface Changed: Please list interface changes

Test Programs: List test programs

Put in Release Notes: Yes/No

Module(s): Module Names change impacts.

Description: Describe your changes here...

Take into account row and channel flag when generating caltables.


Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/STCalSkyTable.h

    r2955 r2958  
    5757  casa::Vector<casa::Float> getElevation() {return elCol_.getColumn();}
    5858  casa::Matrix<casa::Float> getSpectra() {return spectraCol_.getColumn();}
     59  casa::Matrix<casa::uChar> getFlagtra() {return flagtraCol_.getColumn();}
    5960  casa::uInt nchan(casa::uInt ifno);
    6061
  • trunk/src/STCalTsys.cpp

    r2955 r2958  
    9191      size_t end = std::min((size_t)channel_range[i] + 1, averaged_data.size());
    9292      os << LogIO::DEBUGGING << "start=" << start << ", end=" << end << LogIO::POST;
    93       //Vector<Float> segment = any_data(Slice(start, end - 1, 1, False));
    94       //averaged_value += sum(segment);
    95       //num_value += segment.size();
    9693      float sum_per_segment = 0.0;
     94      size_t count = 0;
    9795      for (size_t j = start; j < end; ++j) {
    98         sum_per_segment += any_data[j];
     96        if (channel_flag[j] == 0) {
     97          sum_per_segment += any_data[j];
     98          count += 1;
     99        }
    99100      }
    100101      averaged_value += sum_per_segment;
    101       num_value += end - start;
     102      num_value += count;
    102103    }
    103104    averaged_value /= (Float)num_value;
  • trunk/src/STCalTsysTable.h

    r2955 r2958  
    5555  casa::Vector<casa::Float> getElevation() {return elCol_.getColumn();}
    5656  casa::Matrix<casa::Float> getTsys() {return tsysCol_.getColumn();}
     57  casa::Matrix<casa::uChar> getFlagtra() {return flagtraCol_.getColumn();}
    5758  casa::uInt nchan(casa::uInt ifno);
    5859
  • trunk/src/STCalibration.cpp

    r2955 r2958  
    5858  ROArrayColumn<uChar> flagCol(scantable_->table(), "FLAGTRA");
    5959  ROScalarColumn<uInt> freqidCol(scantable_->table(), "FREQ_ID");
     60  ROScalarColumn<uInt> flagrowCol(scantable_->table(), "FLAGROW");
     61  Vector<uInt> flagrow = flagrowCol.getColumn();
    6062
    6163  // dummy Tsys: the following process doesn't need Tsys but RowAccumulator
     
    7880    else if (len == 1) {
    7981      uInt irow = rows[0];
    80       appenddata(0, 0, current.asuInt("BEAMNO"), current.asuInt("IFNO"), current.asuInt("POLNO"),
    81                  freqidCol(irow), timeSec[irow], elevation[irow], specCol(irow),
    82                  flagCol(irow));
     82      if (flagrow[irow] == 0) {
     83        appenddata(0, 0, current.asuInt("BEAMNO"), current.asuInt("IFNO"), current.asuInt("POLNO"),
     84                   freqidCol(irow), timeSec[irow], elevation[irow], specCol(irow),
     85                   flagCol(irow));
     86      }
    8387      iter.next();
    8488      continue;
     
    107111      convertArray(bflag, flag);
    108112      specCol.get(irow, spec);
    109       if ( !allEQ(bflag,True) )
     113      if ( !allEQ(bflag,True) && flagrow[irow] == 0 )
    110114        acc.add( spec, !bflag, tsys, intervalSec[irow], timeSec[irow] ) ;
    111115      timeCen += timeSec[irow];
     
    131135          const uChar userFlag = 1 << 7;
    132136          for (uInt k = 0; k < flag.nelements(); ++k) {
    133             if (mask[k] == True)
     137            if (mask[k] == False)
    134138              flag[k] = userFlag;
    135139          }
Note: See TracChangeset for help on using the changeset viewer.