Changeset 2793 for trunk


Ignore:
Timestamp:
03/15/13 17:28:55 (12 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: Yes CSV-2333

Ready for Test: Yes

Interface Changes: 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...

Fixed an issue that FIELD table sometimes has empty (invalid) rows.


File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/MSWriter.cpp

    r2746 r2793  
    866866    // fill empty SPECTRAL_WINDOW rows
    867867    infillSpectralWindow() ;
     868
     869    // fill empty FIELD rows
     870    infillField() ;
    868871  }
    869872
     
    10581061      if ( nchan[i] == 0 )
    10591062        tr.put( i ) ;
     1063    }
     1064  }
     1065  void infillField()
     1066  {
     1067    ScalarColumn<Int> sourceIdCol(fieldtab, "SOURCE_ID");
     1068    ArrayColumn<Double> delayDirCol(fieldtab, "DELAY_DIR");
     1069    ArrayColumn<Double> phaseDirCol(fieldtab, "PHASE_DIR");
     1070    ArrayColumn<Double> referenceDirCol(fieldtab, "REFERENCE_DIR");
     1071    uInt nrow = fieldtab.nrow();
     1072    Matrix<Double> dummy(IPosition(2, 2, 1), 0.0);
     1073    for (uInt irow = 0; irow < nrow; ++irow) {
     1074      if (!phaseDirCol.isDefined(irow)) {
     1075        delayDirCol.put(irow, dummy);
     1076        phaseDirCol.put(irow, dummy);
     1077        referenceDirCol.put(irow, dummy);
     1078        sourceIdCol.put(irow, -1);
     1079      }
    10601080    }
    10611081  }
Note: See TracChangeset for help on using the changeset viewer.