Ignore:
Timestamp:
06/25/14 15:28:36 (10 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: Yes CAS-6585, 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...

Added FLAGTRA column to sky and Tsys caltable.
To support previous versions of caltabls that don't have FLAGTRA
column, the code automatically add FLAGTRA column and initialize
it with initial value (uChar)0 if no FLAGTRA exists.


File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/STCalTsysTable.cpp

    r2756 r2955  
    1919#include <tables/Tables/ScaColDesc.h>
    2020#include <tables/Tables/TableRecord.h>
     21#include <tables/Tables/TableIter.h>
    2122#include <measures/TableMeasures/TableMeasDesc.h>
    2223#include <measures/TableMeasures/TableMeasRefDesc.h>
     
    4243  : STApplyTable(name)
    4344{
     45  if (!table_.tableDesc().isColumn("FLAGTRA")) {
     46    LogIO os(LogOrigin("STCalTsysTable", "STCalTsysTable", WHERE));
     47    os << "Adding FLAGTRA column to " << name << " with initial value of 0 (all data valid)." << LogIO::POST;
     48    table_.addColumn(ArrayColumnDesc<uChar>("FLAGTRA"));
     49    TableIterator iter(table_, "IFNO");
     50    while (!iter.pastEnd()) {
     51      Table t = iter.table();
     52      ArrayColumn<Float> tsysCol(t, "TSYS");
     53      IPosition shape(2, tsysCol.shape(0)[0], t.nrow());
     54      ArrayColumn<uChar> flagtraCol(t, "FLAGTRA");
     55      Array<uChar> flagtra(shape, (uChar)0);
     56      flagtraCol.putColumn(flagtra);
     57      iter.next();
     58    }
     59  }
     60 
    4461  attachOptionalColumns();
    4562}
     
    5269{
    5370  table_.addColumn(ArrayColumnDesc<Float>("TSYS"));
     71  table_.addColumn(ArrayColumnDesc<uChar>("FLAGTRA"));
    5472  table_.addColumn(ScalarColumnDesc<Float>("ELEVATION"));
    5573
     
    6280{
    6381  tsysCol_.attach(table_, "TSYS");
     82  flagtraCol_.attach(table_, "FLAGTRA");
    6483  elCol_.attach(table_,"ELEVATION");
    6584 
     
    6887void STCalTsysTable::setdata(uInt irow, uInt scanno, uInt cycleno,
    6988                             uInt beamno, uInt ifno, uInt polno, uInt freqid, 
    70                              Double time, Float elevation, Vector<Float> tsys)
     89                             Double time, Float elevation,
     90                             const Vector<Float> &tsys,
     91                             const Vector<uChar> &flagtra)
    7192{
    7293  if (irow >= (uInt)nrow()) {
     
    82103  elCol_.put(irow, elevation);
    83104  tsysCol_.put(irow, tsys);
     105  flagtraCol_.put(irow, flagtra);
    84106}
    85107
    86108void STCalTsysTable::appenddata(uInt scanno, uInt cycleno,
    87109                                uInt beamno, uInt ifno, uInt polno, uInt freqid,
    88                                 Double time, Float elevation, Vector<Float> tsys)
     110                                Double time, Float elevation,
     111                                const Vector<Float> &tsys,
     112                                const Vector<uChar> &flagtra)
    89113{
    90114  uInt irow = nrow();
    91115  table_.addRow(1, True);
    92   setdata(irow, scanno, cycleno, beamno, ifno, polno, freqid, time, elevation, tsys);
     116  setdata(irow, scanno, cycleno, beamno, ifno, polno, freqid, time, elevation,
     117          tsys, flagtra);
    93118}
    94119
Note: See TracChangeset for help on using the changeset viewer.