Changeset 410 for trunk


Ignore:
Timestamp:
02/11/05 12:49:04 (20 years ago)
Author:
kil064
Message:

fix problems in average_time with output scan information being off by 1 scan !

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/SDMath.cc

    r397 r410  
    167167  ROScalarColumn<Double> intCol;
    168168  ROArrayColumn<uInt> fqIDCol;
     169  ROScalarColumn<Int> scanIDCol;
    169170
    170171// Create accumulation MaskedArray. We accumulate for each channel,if,pol,beam
     
    252253     intCol.attach(tabIn, "INTERVAL");
    253254     fqIDCol.attach(tabIn, "FREQID");
     255     scanIDCol.attach(tabIn, "SCANID");
     256
     257// Find list of start/end rows for each scan
    254258
    255259// Loop over rows in Table
     
    268272// frequency setup and warn if averaging across them
    269273
    270 // Get copy of Scan Container for this row
    271 
    272         SDContainer sc = in[iTab]->getSDContainer(iRow);
    273         scanID = sc.scanid;
     274        scanIDCol.getScalar(iRow, scanID);
    274275
    275276// Get quantities from columns
     
    300301           normalize(sum, sumSq, nPts, wtType, asap::ChanAxis, nAxesSub);
    301302
     303// Get ScanContainer for the first row of this averaged Scan
     304
     305           SDContainer scOut = in[iTab]->getSDContainer(rowStart);
     306
    302307// Fill scan container. The source and freqID come from the
    303308// first row of the first table that went into this average (
     
    305310
    306311           Float nR(nAccum);
    307            fillSDC(sc, sum.getMask(), sum.getArray(), tSysSum/nR, outScanID,
     312           fillSDC(scOut, sum.getMask(), sum.getArray(), tSysSum/nR, outScanID,
    308313                    timeSum/nR, intSum, sourceNameStart, freqIDStart);
    309314
    310315// Write container out to Table
    311316
    312            pTabOut->putSDContainer(sc);
     317           pTabOut->putSDContainer(scOut);
    313318
    314319// Reset accumulators
     
    351356//
    352357// Normalize data in 'sum' accumulation array according to weighting scheme
     358
    353359  normalize(sum, sumSq, nPts, wtType, asap::ChanAxis, nAxesSub);
    354360
     
    358364
    359365  Float nR(nAccum);
    360   SDContainer sc = in[tableStart]->getSDContainer(rowStart);
    361   fillSDC(sc, sum.getMask(), sum.getArray(), tSysSum/nR, outScanID,
     366  SDContainer scOut = in[tableStart]->getSDContainer(rowStart);
     367  fillSDC(scOut, sum.getMask(), sum.getArray(), tSysSum/nR, outScanID,
    362368           timeSum/nR, intSum, sourceNameStart, freqIDStart);
    363   pTabOut->putSDContainer(sc);
     369  pTabOut->putSDContainer(scOut);
    364370  pTabOut->resetCursor();
    365371//
Note: See TracChangeset for help on using the changeset viewer.