Changeset 779 for branches/Release12


Ignore:
Timestamp:
12/07/05 14:14:45 (18 years ago)
Author:
mar637
Message:

log message issues in calcazel

Location:
branches/Release12/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/Release12/src/SDMath.cc

    r716 r779  
    101101}
    102102
    103 SDMath& SDMath::operator=(const SDMath& other) 
     103SDMath& SDMath::operator=(const SDMath& other)
    104104{
    105105  if (this != &other) {
     
    113113
    114114
    115 SDMemTable* SDMath::frequencyAlignment(const SDMemTable& in, 
    116                                        const String& refTime,
    117                                        const String& method,
    118                                        Bool perFreqID)
     115SDMemTable* SDMath::frequencyAlignment(const SDMemTable& in,
     116                                       const String& refTime,
     117                                       const String& method,
     118                                       Bool perFreqID)
    119119{
    120120  // Get frame info from Table
     
    136136
    137137
    138 CountedPtr<SDMemTable> 
     138CountedPtr<SDMemTable>
    139139SDMath::average(const std::vector<CountedPtr<SDMemTable> >& in,
    140                 const Vector<Bool>& mask, Bool scanAv,
    141                 const String& weightStr, Bool alignFreq)
     140                const Vector<Bool>& mask, Bool scanAv,
     141                const String& weightStr, Bool alignFreq)
    142142// Weighted averaging of spectra from one or more Tables.
    143143{
    144   // Convert weight type 
     144  // Convert weight type
    145145  WeightType wtType = NONE;
    146146  convertWeightString(wtType, weightStr, True);
     
    242242    // Should check that the frequency tables don't change if doing
    243243    // FreqAlignment
    244    
     244
    245245    // Attach columns to Table
    246246     const Table& tabIn = in[iTab]->table();
     
    258258        IPosition shp2 = in[iTab]->rowAsMaskedArray(iRow).shape();
    259259        if (!shp.isEqual(shp2)) {
    260           delete pTabOut;
     260          delete pTabOut;
    261261           throw (AipsError("Shapes for all rows must be the same"));
    262262        }
    263263
    264         // If we are not doing scan averages, make checks for source
    265         // and frequency setup and warn if averaging across them
     264        // If we are not doing scan averages, make checks for source
     265        // and frequency setup and warn if averaging across them
    266266        scanIDCol.getScalar(iRow, scanID);
    267267
    268         // Get quantities from columns
     268        // Get quantities from columns
    269269        srcNameCol.getScalar(iRow, sourceName);
    270270        mjdCol.get(iRow, time);
     
    273273        fqIDCol.get(iRow, freqID);
    274274
    275         // Initialize first source and freqID
     275        // Initialize first source and freqID
    276276        if (iRow==0 && iTab==0) {
    277277          sourceNameStart = sourceName;
     
    279279        }
    280280
    281         // If we are doing scan averages, see if we are at the end of
    282         // an accumulation period (scan).  We must check soutce names
    283         // too, since we might have two tables with one scan each but
    284         // different source names; we shouldn't average different
    285         // sources together
     281        // If we are doing scan averages, see if we are at the end of
     282        // an accumulation period (scan).  We must check soutce names
     283        // too, since we might have two tables with one scan each but
     284        // different source names; we shouldn't average different
     285        // sources together
    286286        if (scanAv && ( (scanID != oldScanID)  ||
    287287                        (iRow==0 && iTab>0 && sourceName!=oldSourceName))) {
    288288
    289           // Normalize data in 'sum' accumulation array according to
    290           // weighting scheme
    291            normalize(sum, sumSq, tSysSqSum, nPts, intSum, wtType, 
    292                      asap::ChanAxis, nAxesSub);
    293 
    294            // Get ScanContainer for the first row of this averaged Scan
     289          // Normalize data in 'sum' accumulation array according to
     290          // weighting scheme
     291           normalize(sum, sumSq, tSysSqSum, nPts, intSum, wtType,
     292                     asap::ChanAxis, nAxesSub);
     293
     294           // Get ScanContainer for the first row of this averaged Scan
    295295           SDContainer scOut = in[iTab]->getSDContainer(rowStart);
    296296
    297            // Fill scan container. The source and freqID come from the
    298            // first row of the first table that went into this average
    299            // ( should be the same for all rows in the scan average)
     297           // Fill scan container. The source and freqID come from the
     298           // first row of the first table that went into this average
     299           // ( should be the same for all rows in the scan average)
    300300
    301301           Float nR(nAccum);
    302302           fillSDC(scOut, sum.getMask(), sum.getArray(), tSysSum/nR, outScanID,
    303                    timeSum/nR, intSum, sourceNameStart, freqIDStart);
    304            
    305            // Write container out to Table
     303                   timeSum/nR, intSum, sourceNameStart, freqIDStart);
     304
     305           // Write container out to Table
    306306           pTabOut->putSDContainer(scOut);
    307            
    308            // Reset accumulators           
     307
     308           // Reset accumulators
    309309           sum = 0.0;
    310310           sumSq = 0.0;
     
    315315           timeSum = 0.0;
    316316           intSum = 0.0;
    317            nPts = 0.0;
    318 
    319            // Increment
     317           nPts = 0.0;
     318
     319           // Increment
    320320           rowStart = iRow;              // First row for next accumulation
    321321           tableStart = iTab;            // First table for next accumulation
    322322           sourceNameStart = sourceName; // First source name for next
    323                                         // accumulation
     323                                        // accumulation
    324324           freqIDStart = freqID;         // First FreqID for next accumulation
    325325
    326326           oldScanID = scanID;
    327327           outScanID += 1;               // Scan ID for next
    328                                         // accumulation period
     328                                        // accumulation period
    329329        }
    330330
    331         // Accumulate
    332         accumulate(timeSum, intSum, nAccum, sum, sumSq, nPts, 
    333                    tSysSum, tSysSqSum, tSys,
    334                    nInc, mask, time, interval, in, iTab, iRow, asap::ChanAxis,
     331        // Accumulate
     332        accumulate(timeSum, intSum, nAccum, sum, sumSq, nPts,
     333                   tSysSum, tSysSqSum, tSys,
     334                   nInc, mask, time, interval, in, iTab, iRow, asap::ChanAxis,
    335335                   nAxesSub, useMask, wtType);
    336         oldSourceName = sourceName;
    337         oldFreqID = freqID;
     336        oldSourceName = sourceName;
     337        oldFreqID = freqID;
    338338     }
    339339  }
     
    347347  // scheme
    348348
    349   normalize(sum, sumSq, tSysSqSum, nPts, intSum, wtType, 
    350             asap::ChanAxis, nAxesSub);
     349  normalize(sum, sumSq, tSysSqSum, nPts, intSum, wtType,
     350            asap::ChanAxis, nAxesSub);
    351351
    352352  // Create and fill container.  The container we clone will be from
     
    356356  SDContainer scOut = in[tableStart]->getSDContainer(rowStart);
    357357  fillSDC(scOut, sum.getMask(), sum.getArray(), tSysSum/nR, outScanID,
    358           timeSum/nR, intSum, sourceNameStart, freqIDStart);
     358          timeSum/nR, intSum, sourceNameStart, freqIDStart);
    359359  pTabOut->putSDContainer(scOut);
    360360  pTabOut->resetCursor();
     
    365365
    366366
    367 CountedPtr<SDMemTable> 
     367CountedPtr<SDMemTable>
    368368SDMath::binaryOperate(const CountedPtr<SDMemTable>& left,
    369                       const CountedPtr<SDMemTable>& right,
    370                       const String& op, Bool preserve, Bool doTSys)
     369                      const CountedPtr<SDMemTable>& right,
     370                      const String& op, Bool preserve, Bool doTSys)
    371371{
    372372
     
    399399  }
    400400
    401   // Input Tables 
     401  // Input Tables
    402402  const Table& tLeft = left->table();
    403403  const Table& tRight = right->table();
     
    413413  Array<Float> tSysLeftArr, tSysRightArr;
    414414  if (doTSys) tSysRightCol.get(0, tSysRightArr);
    415   MaskedArray<Float>* pMRight = 
     415  MaskedArray<Float>* pMRight =
    416416    new MaskedArray<Float>(right->rowAsMaskedArray(0));
    417417
     
    424424  // Loop over rows
    425425  for (uInt i=0; i<nRowLeft; i++) {
    426    
    427     // Get data 
     426
     427    // Get data
    428428    MaskedArray<Float> mLeft(left->rowAsMaskedArray(i));
    429429    IPosition shpLeft = mLeft.shape();
    430430    if (doTSys) tSysLeftCol.get(i, tSysLeftArr);
    431    
     431
    432432    if (nRowRight>1) {
    433433      delete pMRight;
     
    444444    if (doTSys) {
    445445      if (!tSysRightArr.shape().isEqual(tSysRightArr.shape())) {
    446         delete pTabOut;
    447         delete pMRight;
    448         throw(AipsError("left and right Tsys data are not conformant"));
     446        delete pTabOut;
     447        delete pMRight;
     448        throw(AipsError("left and right Tsys data are not conformant"));
    449449      }
    450450      if (!shpRight.isEqual(tSysRightArr.shape())) {
    451         delete pTabOut;
    452         delete pMRight;
    453         throw(AipsError("left and right scan tables are not conformant"));
     451        delete pTabOut;
     452        delete pMRight;
     453        throw(AipsError("left and right scan tables are not conformant"));
    454454      }
    455455    }
     
    459459
    460460     // Operate on data and TSys
    461      if (what==0) {                               
     461     if (what==0) {
    462462        MaskedArray<Float> tmp = mLeft + *pMRight;
    463463        putDataInSDC(sc, tmp.getArray(), tmp.getMask());
     
    476476        if (doTSys) sc.putTsys(tSysLeftArr/tSysRightArr);
    477477     } else if (what==4) {
    478        if (preserve) {     
    479          MaskedArray<Float> tmp = (tSysRightArr * mLeft / *pMRight) -
    480            tSysRightArr;
    481         putDataInSDC(sc, tmp.getArray(), tmp.getMask());
     478       if (preserve) {
     479         MaskedArray<Float> tmp = (tSysRightArr * mLeft / *pMRight) -
     480           tSysRightArr;
     481        putDataInSDC(sc, tmp.getArray(), tmp.getMask());
    482482       } else {
    483          MaskedArray<Float> tmp = (tSysRightArr * mLeft / *pMRight) -
    484            tSysLeftArr;
    485         putDataInSDC(sc, tmp.getArray(), tmp.getMask());
     483         MaskedArray<Float> tmp = (tSysRightArr * mLeft / *pMRight) -
     484           tSysLeftArr;
     485        putDataInSDC(sc, tmp.getArray(), tmp.getMask());
    486486       }
    487487       sc.putTsys(tSysRightArr);
     
    493493  if (pMRight) delete pMRight;
    494494  pTabOut->resetCursor();
    495  
     495
    496496  return CountedPtr<SDMemTable>(pTabOut);
    497497}
     
    499499
    500500std::vector<float> SDMath::statistic(const CountedPtr<SDMemTable>& in,
    501                                      const Vector<Bool>& mask,
    502                                      const String& which, Int row) const
     501                                     const Vector<Bool>& mask,
     502                                     const String& which, Int row) const
    503503//
    504504// Perhaps iteration over pol/beam/if should be in here
     
    519519  uInt iStart = 0;
    520520  uInt iEnd = in->nRow()-1;
    521 // 
     521//
    522522  if (row>=0) {
    523523     iStart = row;
     
    569569    CoordinateSystem cSys;
    570570    cSys.addCoordinate(in.getSpectralCoordinate(j));
    571     CoordinateSystem cSysBin = 
     571    CoordinateSystem cSysBin =
    572572      CoordinateUtil::makeBinnedCoordinateSystem(factors, cSys, False);
    573573//
     
    584584
    585585// Loop over rows and bin along channel axis
    586  
     586
    587587  for (uInt i=0; i < in.nRow(); ++i) {
    588588    SDContainer sc = in.getSDContainer(i);
     
    603603    putDataInSDC(sc, marrout.getArray(), marrout.getMask());
    604604
    605 // Bin up Tsys. 
     605// Bin up Tsys.
    606606
    607607    Array<Bool> allGood(tSys.shape(),True);
    608608    MaskedArray<Float> tSysIn(tSys, allGood, True);
    609609//
    610     MaskedArray<Float> tSysOut;   
     610    MaskedArray<Float> tSysOut;
    611611    LatticeUtilities::bin(tSysOut, tSysIn, asap::ChanAxis, width);
    612612    sc.putTsys(tSysOut.getArray());
     
    618618
    619619SDMemTable* SDMath::resample(const SDMemTable& in, const String& methodStr,
    620                              Float width)
     620                             Float width)
    621621//
    622622// Should add the possibility of width being specified in km/s. This means
    623 // that for each freqID (SpectralCoordinate) we will need to convert to an 
    624 // average channel width (say at the reference pixel).  Then we would need 
    625 // to be careful to make sure each spectrum (of different freqID) 
     623// that for each freqID (SpectralCoordinate) we will need to convert to an
     624// average channel width (say at the reference pixel).  Then we would need
     625// to be careful to make sure each spectrum (of different freqID)
    626626// is the same length.
    627627//
     
    632632         SpectralCoordinate sC = in.getSpectralCoordinate(j);
    633633      }
    634    } 
     634   }
    635635
    636636// Interpolation method
     
    691691
    692692  Array<Float> valuesOut;
    693   Array<Bool> maskOut; 
     693  Array<Bool> maskOut;
    694694  Array<Float> tSysOut;
    695695  Array<Bool> tSysMaskIn(shapeIn,True);
     
    702702
    703703// Get data and Tsys
    704    
     704
    705705     const Array<Float>& tSysIn = sc.getTsys();
    706706     const MaskedArray<Float>& dataIn(in.rowAsMaskedArray(i));
     
    710710// Interpolate data
    711711
    712      InterpolateArray1D<Float,Float>::interpolate(valuesOut, maskOut, xOut, 
     712     InterpolateArray1D<Float,Float>::interpolate(valuesOut, maskOut, xOut,
    713713                                                  xIn, valuesIn, maskIn,
    714714                                                  interpMethod, True, True);
     
    718718// Interpolate TSys
    719719
    720      InterpolateArray1D<Float,Float>::interpolate(tSysOut, tSysMaskOut, xOut, 
     720     InterpolateArray1D<Float,Float>::interpolate(tSysOut, tSysMaskOut, xOut,
    721721                                                  xIn, tSysIn, tSysMaskIn,
    722722                                                  interpMethod, True, True);
     
    739739   SDMemTable* pOut = new SDMemTable(in,False);
    740740   const Table& tOut = pOut->table();
    741    ArrayColumn<Float> specCol(tOut,"SPECTRA"); 
    742    ArrayColumn<Float> tSysCol(tOut,"TSYS"); 
     741   ArrayColumn<Float> specCol(tOut,"SPECTRA");
     742   ArrayColumn<Float> tSysCol(tOut,"TSYS");
    743743   Array<Float> tSysArr;
    744744
     
    797797  const Table& tabIn = in.table();
    798798
    799 // Shape of input and output data 
     799// Shape of input and output data
    800800
    801801  const IPosition& shapeIn = in.rowAsMaskedArray(0).shape();
     
    826826     tSysCol.attach(tabIn,"TSYS");
    827827  }
    828 // 
     828//
    829829  const Bool useMask = (mask.nelements() == shapeIn(asap::ChanAxis));
    830830
     
    838838      Array<Float>& arr = marr.getRWArray();
    839839      const Array<Bool>& barr = marr.getMask();
    840      
     840
    841841// Get Tsys
    842842
     
    852852      ReadOnlyArrayIterator<Bool> itMaskPlane(barr, axes);
    853853      ReadOnlyArrayIterator<Float>* pItTsysPlane = 0;
    854       if (wtType==TSYS) 
    855         pItTsysPlane = new ReadOnlyArrayIterator<Float>(tSys, axes);
     854      if (wtType==TSYS)
     855        pItTsysPlane = new ReadOnlyArrayIterator<Float>(tSys, axes);
    856856
    857857// Accumulations
     
    868868        Vector<Float> t1(nChan); t1 = 0.0;
    869869        Vector<Bool> t2(nChan); t2 = True;
    870         Float tSys = 0.0;
     870        Float tSys = 0.0;
    871871        MaskedArray<Float> vecSum(t1,t2);
    872872        Float norm = 0.0;
     
    876876//
    877877           ReadOnlyVectorIterator<Float>* pItTsysVec = 0;
    878            if (wtType==TSYS) {
    879               pItTsysVec = 
    880                 new ReadOnlyVectorIterator<Float>(pItTsysPlane->array(), 1);
    881            }             
    882 //
    883            while (!itDataVec.pastEnd()) {     
     878           if (wtType==TSYS) {
     879              pItTsysVec =
     880                new ReadOnlyVectorIterator<Float>(pItTsysPlane->array(), 1);
     881           }
     882//
     883           while (!itDataVec.pastEnd()) {
    884884
    885885// Create MA of data & mask (optionally including OTF mask) and  get variance for this spectrum
     
    887887              if (useMask) {
    888888                 const MaskedArray<Float> spec(itDataVec.vector(),
    889                                                mask&&itMaskVec.vector());
     889                                               mask&&itMaskVec.vector());
    890890                 if (wtType==VAR) {
    891891                    fac = 1.0 / variance(spec);
    892892                 } else if (wtType==TSYS) {
    893                     tSys = pItTsysVec->vector()[0];      // Drop pseudo channel dependency
     893                    tSys = pItTsysVec->vector()[0];      // Drop pseudo channel dependency
    894894                    fac = 1.0 / tSys / tSys;
    895                  }                   
     895                 }
    896896              } else {
    897897                 const MaskedArray<Float> spec(itDataVec.vector(),
    898                                                itMaskVec.vector());
     898                                               itMaskVec.vector());
    899899                 if (wtType==VAR) {
    900900                    fac = 1.0 / variance(spec);
    901901                 } else if (wtType==TSYS) {
    902                     tSys = pItTsysVec->vector()[0];      // Drop pseudo channel dependency
     902                    tSys = pItTsysVec->vector()[0];      // Drop pseudo channel dependency
    903903                    fac = 1.0 / tSys / tSys;
    904904                 }
     
    908908
    909909              const MaskedArray<Float> spec(fac*itDataVec.vector(),
    910                                             itMaskVec.vector());
     910                                            itMaskVec.vector());
    911911              vecSum += spec;
    912912              norm += fac;
     
    916916              itDataVec.next();
    917917              itMaskVec.next();
    918               if (wtType==TSYS) pItTsysVec->next();
     918              if (wtType==TSYS) pItTsysVec->next();
    919919           }
    920            
     920
    921921// Clean up
    922922
    923            if (pItTsysVec) {
    924               delete pItTsysVec; 
     923           if (pItTsysVec) {
     924              delete pItTsysVec;
    925925              pItTsysVec = 0;
    926            }           
     926           }
    927927        }
    928928
     
    936936        IPosition pos = itDataPlane.pos();
    937937
    938 // Write out data. This is a bit messy. We have to reform the Vector 
     938// Write out data. This is a bit messy. We have to reform the Vector
    939939// accumulator into an Array of shape (1,1,1,nChan)
    940940
    941941        start = pos;
    942         end = pos; 
     942        end = pos;
    943943        end(asap::ChanAxis) = nChan-1;
    944944        outData(start,end) = vecSum.getArray().reform(vecShapeOut);
     
    949949        itDataPlane.next();
    950950        itMaskPlane.next();
    951         if (wtType==TSYS) pItTsysPlane->next();
     951        if (wtType==TSYS) pItTsysPlane->next();
    952952      }
    953953
     
    974974
    975975
    976 SDMemTable* SDMath::smooth(const SDMemTable& in, 
    977                            const casa::String& kernelType,
    978                            casa::Float width, Bool doAll)
     976SDMemTable* SDMath::smooth(const SDMemTable& in,
     977                           const casa::String& kernelType,
     978                           casa::Float width, Bool doAll)
    979979//
    980980// Should smooth TSys as well
     
    10141014      Array<Bool> maskIn = dataIn.getMask();
    10151015
    1016       Array<Float> valuesIn2 = valuesIn(start,end);       // ref to valuesIn 
     1016      Array<Float> valuesIn2 = valuesIn(start,end);       // ref to valuesIn
    10171017      Array<Bool> maskIn2 = maskIn(start,end);
    10181018
     
    10211021      VectorIterator<Bool> itMask(maskIn2, asap::ChanAxis);
    10221022      while (!itValues.pastEnd()) {
    1023        
    1024         // Smooth
    1025         if (kernelType==VectorKernel::HANNING) {
    1026           mathutil::hanning(valuesOut, maskOut, itValues.vector(),
    1027                             itMask.vector());
    1028           itMask.vector() = maskOut;
    1029         } else {
    1030           mathutil::replaceMaskByZero(itValues.vector(), itMask.vector());
    1031           conv.linearConv(valuesOut, itValues.vector());
    1032         }
    1033 
    1034         itValues.vector() = valuesOut;
    1035         itValues.next();
    1036         itMask.next();
     1023
     1024        // Smooth
     1025        if (kernelType==VectorKernel::HANNING) {
     1026          mathutil::hanning(valuesOut, maskOut, itValues.vector(),
     1027                            itMask.vector());
     1028          itMask.vector() = maskOut;
     1029        } else {
     1030          mathutil::replaceMaskByZero(itValues.vector(), itMask.vector());
     1031          conv.linearConv(valuesOut, itValues.vector());
     1032        }
     1033
     1034        itValues.vector() = valuesOut;
     1035        itValues.next();
     1036        itMask.next();
    10371037      }
    1038      
     1038
    10391039      // Create and put back
    10401040      SDContainer sc = in.getSDContainer(ri);
     
    10491049
    10501050
    1051 SDMemTable* SDMath::convertFlux(const SDMemTable& in, Float D, Float etaAp, 
    1052                                 Float JyPerK, Bool doAll)
    1053 // 
     1051SDMemTable* SDMath::convertFlux(const SDMemTable& in, Float D, Float etaAp,
     1052                                Float JyPerK, Bool doAll)
     1053//
    10541054// etaAp = aperture efficiency (-1 means find)
    10551055// D     = geometric diameter (m)  (-1 means find)
    1056 // JyPerK 
     1056// JyPerK
    10571057//
    10581058{
     
    10631063  // mJy or mK) Also automatically find out what we are converting to
    10641064  // according to the flux unit
    1065   Unit fluxUnit(sh.fluxunit); 
     1065  Unit fluxUnit(sh.fluxunit);
    10661066  Unit K(String("K"));
    10671067  Unit JY(String("Jy"));
    10681068
    10691069  Bool toKelvin = True;
    1070   Double cFac = 1.0;   
     1070  Double cFac = 1.0;
    10711071
    10721072  if (fluxUnit==JY) {
     
    10751075    Quantum<Double> t2 = t.get(JY);
    10761076    cFac = (t2 / t).getValue();               // value to Jy
    1077    
     1077
    10781078    toKelvin = True;
    10791079    sh.fluxunit = "K";
     
    10831083    Quantum<Double> t2 = t.get(K);
    10841084    cFac = (t2 / t).getValue();              // value to K
    1085    
     1085
    10861086    toKelvin = False;
    10871087    sh.fluxunit = "Jy";
     
    10911091
    10921092  pTabOut->putSDHeader(sh);
    1093  
     1093
    10941094  // Make sure input values are converted to either Jy or K first...
    10951095  Float factor = cFac;
     
    11211121    scaleByVector(pTabOut, in, doAll, factors, False);
    11221122  } else {
    1123    
     1123
    11241124    // OK now we must deal with automatic look up of values.
    11251125    // We must also deal with the fact that the factors need
    11261126    // to be computed per IF and may be different and may
    11271127    // change per integration.
    1128    
     1128
    11291129    pushLog("Looking up conversion factors");
    11301130    convertBrightnessUnits (pTabOut, in, toKelvin, cFac, doAll);
     
    11341134
    11351135
    1136 SDMemTable* SDMath::gainElevation(const SDMemTable& in, 
    1137                                   const Vector<Float>& coeffs,
    1138                                   const String& fileName,
    1139                                   const String& methodStr, Bool doAll)
     1136SDMemTable* SDMath::gainElevation(const SDMemTable& in,
     1137                                  const Vector<Float>& coeffs,
     1138                                  const String& fileName,
     1139                                  const String& methodStr, Bool doAll)
    11401140{
    11411141
     
    11491149  Vector<Float> x = elev.getColumn();
    11501150  x *= Float(180 / C::pi);                        // Degrees
    1151  
     1151
    11521152  const uInt nC = coeffs.nelements();
    11531153  if (fileName.length()>0 && nC>0) {
    11541154    throw(AipsError("You must choose either polynomial coefficients or an ascii file, not both"));
    11551155  }
    1156  
     1156
    11571157  // Correct
    11581158  if (nC>0 || fileName.length()==0) {
     
    11601160     Bool throwIt = True;
    11611161     Instrument inst = SDAttr::convertInstrument (sh.antennaname, throwIt);
    1162      
     1162
    11631163     // Set polynomial
    11641164     Polynomial<Float>* pPoly = 0;
     
    11751175       msg = String("built in");
    11761176     }
    1177      
     1177
    11781178     if (coeff.nelements()>0) {
    11791179       pPoly->setCoefficients(coeff);
     
    11821182       throw(AipsError("There is no known gain-elevation polynomial known for this instrument"));
    11831183     }
    1184      pushLog("Making polynomial correction with "+msg+" coefficients");
     1184     ostringstream oss;
     1185     oss << "Making polynomial correction with " << msg << " coefficients:" << endl;
     1186     oss << "   " <<  coeff;
     1187     pushLog(String(oss));
    11851188     const uInt nRow = in.nRow();
    11861189     Vector<Float> factor(nRow);
     
    11921195
    11931196  } else {
    1194    
     1197
    11951198    // Indicate which columns to read from ascii file
    11961199    String col0("ELEVATION");
    11971200    String col1("FACTOR");
    1198    
     1201
    11991202    // Read and correct
    1200    
     1203
    12011204    pushLog("Making correction from ascii Table");
    1202     scaleFromAsciiTable (pTabOut, in, fileName, col0, col1, 
    1203                         methodStr, doAll, x, True);
     1205    scaleFromAsciiTable (pTabOut, in, fileName, col0, col1,
     1206                        methodStr, doAll, x, True);
    12041207  }
    12051208
    12061209  return pTabOut;
    12071210}
    1208  
     1211
    12091212
    12101213SDMemTable* SDMath::opacity(const SDMemTable& in, Float tau, Bool doAll)
     
    12561259      throw(AipsError("Only linear polarizations are supported"));
    12571260   }
    1258 //   
     1261//
    12591262   const Table& tabIn = in.table();
    1260    ArrayColumn<Float> specCol(tabIn,"SPECTRA"); 
     1263   ArrayColumn<Float> specCol(tabIn,"SPECTRA");
    12611264   IPosition start(asap::nAxes,0);
    12621265   IPosition end(asap::nAxes);
    12631266
    12641267// Set cursor slice. Assumes shape the same for all rows
    1265  
     1268
    12661269   setCursorSlice (start, end, doAll, in);
    12671270   IPosition start3(start);
    12681271   start3(asap::PolAxis) = 2;                 // Real(XY)
    12691272   IPosition end3(end);
    1270    end3(asap::PolAxis) = 2;   
     1273   end3(asap::PolAxis) = 2;
    12711274//
    12721275   IPosition start4(start);
     
    12741277   IPosition end4(end);
    12751278   end4(asap::PolAxis) = 3;
    1276 // 
     1279//
    12771280   uInt nRow = in.nRow();
    12781281   Array<Float> data;
     
    12801283      specCol.get(i,data);
    12811284      IPosition shape = data.shape();
    1282  
     1285
    12831286      // Get polarization slice references
    12841287      Array<Float> C3 = data(start3,end3);
    12851288      Array<Float> C4 = data(start4,end4);
    1286    
     1289
    12871290      // Rotate
    12881291      SDPolUtil::rotatePhase(C3, C4, value);
    1289    
     1292
    12901293      // Put
    12911294      specCol.put(i,data);
    12921295   }
    1293 }     
     1296}
    12941297
    12951298
     
    13101313      throw(AipsError("Only linear polarizations are supported"));
    13111314   }
    1312 //   
     1315//
    13131316   const Table& tabIn = in.table();
    1314    ArrayColumn<Float> specCol(tabIn,"SPECTRA"); 
    1315    ROArrayColumn<Float> stokesCol(tabIn,"STOKES"); 
     1317   ArrayColumn<Float> specCol(tabIn,"SPECTRA");
     1318   ROArrayColumn<Float> stokesCol(tabIn,"STOKES");
    13161319   IPosition start(asap::nAxes,0);
    13171320   IPosition end(asap::nAxes);
    13181321
    13191322// Set cursor slice. Assumes shape the same for all rows
    1320  
     1323
    13211324   setCursorSlice (start, end, doAll, in);
    13221325//
     
    13241327   start1(asap::PolAxis) = 0;                // C1 (XX)
    13251328   IPosition end1(end);
    1326    end1(asap::PolAxis) = 0;   
     1329   end1(asap::PolAxis) = 0;
    13271330//
    13281331   IPosition start2(start);
    13291332   start2(asap::PolAxis) = 1;                 // C2 (YY)
    13301333   IPosition end2(end);
    1331    end2(asap::PolAxis) = 1;   
     1334   end2(asap::PolAxis) = 1;
    13321335//
    13331336   IPosition start3(start);
    13341337   start3(asap::PolAxis) = 2;                 // C3 ( Real(XY) )
    13351338   IPosition end3(end);
    1336    end3(asap::PolAxis) = 2;   
     1339   end3(asap::PolAxis) = 2;
    13371340//
    13381341   IPosition startI(start);
    13391342   startI(asap::PolAxis) = 0;                 // I
    13401343   IPosition endI(end);
    1341    endI(asap::PolAxis) = 0;   
     1344   endI(asap::PolAxis) = 0;
    13421345//
    13431346   IPosition startQ(start);
    13441347   startQ(asap::PolAxis) = 1;                 // Q
    13451348   IPosition endQ(end);
    1346    endQ(asap::PolAxis) = 1;   
     1349   endQ(asap::PolAxis) = 1;
    13471350//
    13481351   IPosition startU(start);
    13491352   startU(asap::PolAxis) = 2;                 // U
    13501353   IPosition endU(end);
    1351    endU(asap::PolAxis) = 2;   
     1354   endU(asap::PolAxis) = 2;
    13521355
    13531356//
     
    13581361      stokesCol.get(i,stokes);
    13591362      IPosition shape = data.shape();
    1360  
     1363
    13611364// Get linear polarization slice references
    1362  
     1365
    13631366      Array<Float> C1 = data(start1,end1);
    13641367      Array<Float> C2 = data(start2,end2);
     
    13701373      Array<Float> Q = stokes(startQ,endQ);
    13711374      Array<Float> U = stokes(startU,endU);
    1372    
     1375
    13731376// Rotate
    1374  
     1377
    13751378      SDPolUtil::rotateLinPolPhase(C1, C2, C3, I, Q, U, value);
    1376    
     1379
    13771380// Put
    1378    
     1381
    13791382      specCol.put(i,data);
    13801383   }
    1381 }     
     1384}
    13821385
    13831386// 'private' functions
    13841387
    1385 void SDMath::convertBrightnessUnits (SDMemTable* pTabOut, const SDMemTable& in, 
     1388void SDMath::convertBrightnessUnits (SDMemTable* pTabOut, const SDMemTable& in,
    13861389                                     Bool toKelvin, Float cFac, Bool doAll)
    13871390{
     
    14381441// Loop over rows and apply correction factor
    14391442
    1440    Float factor = 1.0; 
     1443   Float factor = 1.0;
    14411444   const uInt axis = asap::ChanAxis;
    14421445   for (uInt i=0; i < in.nRow(); ++i) {
     
    14571460
    14581461// Now the conversion factor depends only upon frequency
    1459 // So we need to iterate through by IF only giving 
     1462// So we need to iterate through by IF only giving
    14601463// us BEAM/POL/CHAN cubes
    14611464
     
    14791482SDMemTable* SDMath::frequencyAlign(const SDMemTable& in,
    14801483                                   MFrequency::Types freqSystem,
    1481                                    const String& refTime, 
     1484                                   const String& refTime,
    14821485                                   const String& methodStr,
    14831486                                   Bool perFreqID)
     
    15011504   Vector<Double> times = mjdCol.getColumn();
    15021505
    1503 // Generate DataDesc table 
    1504  
     1506// Generate DataDesc table
     1507
    15051508   Matrix<uInt> ddIdx;
    15061509   SDDataDesc dDesc;
    1507    generateDataDescTable(ddIdx, dDesc, nIF, in, tabIn, srcCol, 
    1508                           fqIDCol, perFreqID);
     1510   generateDataDescTable(ddIdx, dDesc, nIF, in, tabIn, srcCol,
     1511                          fqIDCol, perFreqID);
    15091512
    15101513// Get reference Epoch to time of first row or given String
    1511    
     1514
    15121515   Unit DAY(String("d"));
    15131516   MEpoch::Ref epochRef(in.getTimeReference());
     
    15181521     refEpoch = in.getEpoch(0);
    15191522   }
    1520    pushLog("Aligning at reference Epoch "+formatEpoch(refEpoch)
    1521                   +" in frame "+MFrequency::showType(freqSystem));
    1522    
     1523   ostringstream oss;
     1524   oss << "Aligned at reference Epoch " << formatEpoch(refEpoch) << " in frame " << MFrequency::showType(freqSystem);
     1525   pushLog(String(oss));
     1526
    15231527   // Get Reference Position
    1524    
     1528
    15251529   MPosition refPos = in.getAntennaPosition();
    1526    
     1530
    15271531   // Create FrequencyAligner Block. One FA for each possible
    15281532   // source/freqID (perFreqID=True) or source/IF (perFreqID=False)
    15291533   // combination
    1530    
     1534
    15311535   PtrBlock<FrequencyAligner<Float>* > a(dDesc.length());
    1532    generateFrequencyAligners (a, dDesc, in, nChan, freqSystem, refPos,
     1536   generateFrequencyAligners(a, dDesc, in, nChan, freqSystem, refPos,
    15331537                              refEpoch, perFreqID);
    1534    
     1538
    15351539   // Generate and fill output Frequency Table.  WHen perFreqID=True,
    15361540   // there is one output FreqID for each entry in the SDDataDesc
    15371541   // table.  However, in perFreqID=False mode, there may be some
    15381542   // degeneracy, so we need a little translation map
    1539    
     1543
    15401544   SDFrequencyTable freqTabOut = in.getSDFreqTable();
    15411545   freqTabOut.setLength(0);
     
    15481552
    15491553     // Get Aligned SC in Hz
    1550      
     1554
    15511555     SpectralCoordinate sC = a[i]->alignedSpectralCoordinate(linear);
    15521556     sC.setWorldAxisUnits(units);
    1553      
     1557
    15541558     // Add FreqID
    1555      
     1559
    15561560     uInt idx = freqTabOut.addFrequency(sC.referencePixel()[0],
    1557                                         sC.referenceValue()[0],
    1558                                         sC.increment()[0]);
     1561                                        sC.referenceValue()[0],
     1562                                        sC.increment()[0]);
    15591563     // output FreqID = ddFQTrans(ddIdx)
    15601564     ddFQTrans(i) = idx;
    15611565   }
    1562    
     1566
    15631567   // Interpolation method
    1564    
     1568
    15651569   InterpolateArray1D<Double,Float>::InterpolationMethod interp;
    15661570   convertInterpString(interp, methodStr);
    1567    
     1571
    15681572   // New output Table
    1569    
    1570    pushLog("Create output table");
     1573
     1574   //pushLog("Create output table");
    15711575   SDMemTable* pTabOut = new SDMemTable(in,True);
    15721576   pTabOut->putSDFreqTable(freqTabOut);
    1573    
     1577
    15741578   // Loop over rows in Table
    1575    
     1579
    15761580   Bool extrapolate=False;
    15771581   const IPosition polChanAxes(2, asap::PolAxis, asap::ChanAxis);
     
    15861590   //
    15871591   for (uInt iRow=0; iRow<nRows; ++iRow) {
    1588      if (iRow%10==0) {
    1589        pushLog("Processing row "+iRow);
    1590      }
    1591      
     1592//      if (iRow%10==0) {
     1593//        ostringstream oss;
     1594//        oss << "Processing row " << iRow;
     1595//        pushLog(String(oss));
     1596//      }
     1597
    15921598     // Get EPoch
    1593      
     1599
    15941600     Quantum<Double> tQ2(times[iRow],DAY);
    15951601     MVEpoch mv2(tQ2);
    15961602     MEpoch epoch(mv2, epochRef);
    1597      
     1603
    15981604     // Get copy of data
    1599      
     1605
    16001606     const MaskedArray<Float>& mArrIn(in.rowAsMaskedArray(iRow));
    16011607     Array<Float> values = mArrIn.getArray();
    1602      Array<Bool> mask = mArrIn.getMask(); 
    1603      
     1608     Array<Bool> mask = mArrIn.getMask();
     1609
    16041610     // For each row, the Frequency abcissa will be the same
    16051611     // regardless of polarization.  For all other axes (IF and BEAM)
     
    16071613     // pol-chan planes to mimimize the work.  Probably won't work for
    16081614     // multiple beams at this point.
    1609      
     1615
    16101616     ArrayIterator<Float> itValuesPlane(values, polChanAxes);
    16111617     ArrayIterator<Bool> itMaskPlane(mask, polChanAxes);
     
    16131619
    16141620       // Find the IF index and then the FA PtrBlock index
    1615        
     1621
    16161622       const IPosition& pos = itValuesPlane.pos();
    16171623       ifIdx = pos(asap::IFAxis);
    16181624       faIdx = ddIdx(iRow,ifIdx);
    1619        
     1625
    16201626       // Generate abcissa for perIF.  Could cache this in a Matrix on
    16211627       // a per scan basis.  Pretty expensive doing it for every row.
    1622        
     1628
    16231629       if (!perFreqID) {
    1624         xIn.resize(nChan);
    1625         uInt fqID = dDesc.secID(ddIdx(iRow,ifIdx));
    1626         SpectralCoordinate sC = in.getSpectralCoordinate(fqID);
     1630        xIn.resize(nChan);
     1631        uInt fqID = dDesc.secID(ddIdx(iRow,ifIdx));
     1632        SpectralCoordinate sC = in.getSpectralCoordinate(fqID);
    16271633           Double w;
    16281634           for (uInt i=0; i<nChan; i++) {
    1629              sC.toWorld(w,Double(i));
     1635             sC.toWorld(w,Double(i));
    16301636              xIn[i] = w;
    16311637           }
    16321638       }
    1633        
    1634        VectorIterator<Float> itValuesVec(itValuesPlane.array(), 1); 
     1639
     1640       VectorIterator<Float> itValuesVec(itValuesPlane.array(), 1);
    16351641       VectorIterator<Bool> itMaskVec(itMaskPlane.array(), 1);
    16361642
    16371643       // Iterate through the plane by vector and align
    1638        
     1644
    16391645        first = True;
    16401646        useCachedAbcissa=False;
    1641         while (!itValuesVec.pastEnd()) {     
    1642           if (perFreqID) {
    1643             ok = a[faIdx]->align (yOut, maskOut, itValuesVec.vector(),
    1644                                   itMaskVec.vector(), epoch, useCachedAbcissa,
    1645                                   interp, extrapolate);
    1646           } else {
    1647             ok = a[faIdx]->align (yOut, maskOut, xIn, itValuesVec.vector(),
    1648                                   itMaskVec.vector(), epoch, useCachedAbcissa,
    1649                                   interp, extrapolate);
    1650           }
    1651           //
    1652           itValuesVec.vector() = yOut;
    1653           itMaskVec.vector() = maskOut;
    1654           //
    1655           itValuesVec.next();
    1656           itMaskVec.next();
    1657           //
    1658           if (first) {
    1659             useCachedAbcissa = True;
    1660             first = False;
    1661           }
     1647        while (!itValuesVec.pastEnd()) {
     1648          if (perFreqID) {
     1649            ok = a[faIdx]->align (yOut, maskOut, itValuesVec.vector(),
     1650                                  itMaskVec.vector(), epoch, useCachedAbcissa,
     1651                                  interp, extrapolate);
     1652          } else {
     1653            ok = a[faIdx]->align (yOut, maskOut, xIn, itValuesVec.vector(),
     1654                                  itMaskVec.vector(), epoch, useCachedAbcissa,
     1655                                  interp, extrapolate);
     1656          }
     1657          //
     1658          itValuesVec.vector() = yOut;
     1659          itMaskVec.vector() = maskOut;
     1660          //
     1661          itValuesVec.next();
     1662          itMaskVec.next();
     1663          //
     1664          if (first) {
     1665            useCachedAbcissa = True;
     1666            first = False;
     1667          }
    16621668        }
    1663         //
    1664         itValuesPlane.next();
    1665         itMaskPlane.next();
     1669        //
     1670        itValuesPlane.next();
     1671        itMaskPlane.next();
    16661672     }
    1667      
     1673
    16681674     // Create SDContainer and put back
    1669      
     1675
    16701676     SDContainer sc = in.getSDContainer(iRow);
    16711677     putDataInSDC(sc, values, mask);
    1672      
     1678
    16731679     // Set output FreqIDs
    1674      
     1680
    16751681     for (uInt i=0; i<nIF; i++) {
    16761682       uInt idx = ddIdx(iRow,i);               // Index into SDDataDesc table
     
    16811687     pTabOut->putSDContainer(sc);
    16821688   }
    1683    
     1689
    16841690   // Now we must set the base and extra frames to the input frame
    16851691   std::vector<string> info = pTabOut->getCoordInfo();
     
    16881694   pTabOut->setCoordInfo(info);
    16891695
    1690    // Clean up PointerBlock   
     1696   // Clean up PointerBlock
    16911697   for (uInt i=0; i<a.nelements(); i++) delete a[i];
    16921698
     
    17041710  const Table& tabIn = in.table();
    17051711
    1706   // Shape of input and output data 
     1712  // Shape of input and output data
    17071713  const IPosition& shapeIn = in.rowAsMaskedArray(0).shape();
    17081714
     
    17501756
    17511757void SDMath::fillSDC(SDContainer& sc,
    1752                      const Array<Bool>& mask,
    1753                      const Array<Float>& data,
    1754                      const Array<Float>& tSys,
    1755                      Int scanID, Double timeStamp,
    1756                      Double interval, const String& sourceName,
    1757                      const Vector<uInt>& freqID)
     1758                     const Array<Bool>& mask,
     1759                     const Array<Float>& data,
     1760                     const Array<Float>& tSys,
     1761                     Int scanID, Double timeStamp,
     1762                     Double interval, const String& sourceName,
     1763                     const Vector<uInt>& freqID)
    17581764{
    17591765// Data and mask
     
    17761782
    17771783void SDMath::accumulate(Double& timeSum, Double& intSum, Int& nAccum,
    1778                         MaskedArray<Float>& sum, Array<Float>& sumSq,
    1779                         Array<Float>& nPts, Array<Float>& tSysSum,
     1784                        MaskedArray<Float>& sum, Array<Float>& sumSq,
     1785                        Array<Float>& nPts, Array<Float>& tSysSum,
    17801786                        Array<Float>& tSysSqSum,
    1781                         const Array<Float>& tSys, const Array<Float>& nInc,
    1782                         const Vector<Bool>& mask, Double time, Double interval,
    1783                         const std::vector<CountedPtr<SDMemTable> >& in,
    1784                         uInt iTab, uInt iRow, uInt axis,
    1785                         uInt nAxesSub, Bool useMask,
    1786                         WeightType wtType)
     1787                        const Array<Float>& tSys, const Array<Float>& nInc,
     1788                        const Vector<Bool>& mask, Double time, Double interval,
     1789                        const std::vector<CountedPtr<SDMemTable> >& in,
     1790                        uInt iTab, uInt iRow, uInt axis,
     1791                        uInt nAxesSub, Bool useMask,
     1792                        WeightType wtType)
    17871793{
    17881794
     
    18101816      ReadOnlyVectorIterator<Bool> itMask(maskIn, axis);
    18111817      Float fac = 1.0;
    1812       IPosition pos(nAxesSub,0); 
     1818      IPosition pos(nAxesSub,0);
    18131819//
    18141820      while (!itData.pastEnd()) {
     
    18461852// We will take a short cut and just use the value from the first channel
    18471853// for now.
    1848 // 
     1854//
    18491855      VectorIterator<Float> itData(valuesIn, axis);
    18501856      ReadOnlyVectorIterator<Float> itTSys(tSys, axis);
    1851       IPosition pos(nAxesSub,0); 
     1857      IPosition pos(nAxesSub,0);
    18521858//
    18531859      Float fac = 1.0;
     
    19231929      }
    19241930   } else if (wtType==TSYS || wtType==TINTSYS) {
    1925    
     1931
    19261932// Normalize each spectrum by sum(1/Tsys**2) (TSYS) or
    19271933// sum(Tint/Tsys**2) (TINTSYS) where the pseudo
     
    20002006
    20012007
    2002 void SDMath::convertInterpString(casa::InterpolateArray1D<Double,Float>::InterpolationMethod& type, 
     2008void SDMath::convertInterpString(casa::InterpolateArray1D<Double,Float>::InterpolationMethod& type,
    20032009                                 const casa::String& interp)
    20042010{
     
    20192025
    20202026void SDMath::putDataInSDC(SDContainer& sc, const Array<Float>& data,
    2021                           const Array<Bool>& mask)
     2027                          const Array<Bool>& mask)
    20222028{
    20232029    sc.putSpectrum(data);
     
    20512057}
    20522058
    2053 void SDMath::scaleFromTable(SDMemTable* pTabOut, const SDMemTable& in, 
    2054                             const Table& tTable, const String& col0, 
     2059void SDMath::scaleFromTable(SDMemTable* pTabOut, const SDMemTable& in,
     2060                            const Table& tTable, const String& col0,
    20552061                            const String& col1,
    20562062                            const String& methodStr, Bool doAll,
     
    20742080   Vector<Float> yOut;
    20752081   Vector<Bool> maskOut;
    2076    InterpolateArray1D<Float,Float>::interpolate(yOut, maskOut, xOut, 
     2082   InterpolateArray1D<Float,Float>::interpolate(yOut, maskOut, xOut,
    20772083                                                xIn, yIn, maskIn, intMethod,
    20782084                                                True, True);
    2079 // Apply 
     2085// Apply
    20802086
    20812087   scaleByVector(pTabOut, in, doAll, Float(1.0)/yOut, doTsys);
     
    20832089
    20842090
    2085 void SDMath::scaleByVector(SDMemTable* pTabOut, const SDMemTable& in, 
     2091void SDMath::scaleByVector(SDMemTable* pTabOut, const SDMemTable& in,
    20862092                           Bool doAll, const Vector<Float>& factor,
    20872093                           Bool doTSys)
     
    21002106
    21012107// Loop over rows and apply correction factor
    2102  
     2108
    21032109  const uInt axis = asap::ChanAxis;
    21042110  for (uInt i=0; i < in.nRow(); ++i) {
     
    21932199
    21942200
    2195 void SDMath::generateFrequencyAligners(PtrBlock<FrequencyAligner<Float>* >& a, 
    2196                                        const SDDataDesc& dDesc,
    2197                                        const SDMemTable& in, uInt nChan,
    2198                                        MFrequency::Types system,
    2199                                        const MPosition& refPos,
    2200                                        const MEpoch& refEpoch,
    2201                                        Bool perFreqID)
     2201void SDMath::generateFrequencyAligners(PtrBlock<FrequencyAligner<Float>* >& a,
     2202                                       const SDDataDesc& dDesc,
     2203                                       const SDMemTable& in, uInt nChan,
     2204                                       MFrequency::Types system,
     2205                                       const MPosition& refPos,
     2206                                       const MEpoch& refEpoch,
     2207                                       Bool perFreqID)
    22022208{
    22032209   for (uInt i=0; i<dDesc.length(); i++) {
     
    22082214      if (perFreqID) {
    22092215
    2210 // One aligner per source/FreqID pair. 
     2216// One aligner per source/FreqID pair.
    22112217
    22122218         SpectralCoordinate sC = in.getSpectralCoordinate(ID);
     
    22302236   return range;
    22312237}
    2232    
     2238
    22332239
    22342240Bool SDMath::rowInRange(uInt i, const Vector<uInt>& range) const
  • branches/Release12/src/SDMemTable.cc

    r773 r779  
    17031703     }
    17041704     ostringstream oss;
    1705      oss << "Replacing rest frequencies, one per IF, with given list : " << restFreqs;
     1705     oss << "Replaced rest frequencies, one per IF, with given list : " << restFreqs;
    17061706     sdft.deleteRestFrequencies();
    17071707     for (uInt i=0; i<nRestFreqs; i++) {
     
    17151715      idx = sdft.addRestFrequency(rf.getValue("Hz"));
    17161716      if (whichIF>=0) {
    1717          oss << "Selecting given rest frequency (" << restFreqs[0] << ") for IF " << whichIF << endl;
     1717         oss << "Selected given rest frequency (" << restFreqs[0] << ") for IF " << whichIF << endl;
    17181718      } else {
    1719          oss << "Selecting given rest frequency (" << restFreqs[0] << ") for all IFs" << endl;
     1719         oss << "Selected given rest frequency (" << restFreqs[0] << ") for all IFs" << endl;
    17201720      }
    17211721   }
     
    18391839{
    18401840  MPosition mp = getAntennaPosition();
    1841 
     1841  ostringstream oss;
     1842  oss << "Computed azimuth/elevation using " << endl
     1843      << mp << endl;
    18421844  for (uInt i=0; i<nRow();++i) {
    18431845    MEpoch me = getEpoch(i);
    18441846    MDirection md = getDirection(i,False);
     1847    oss  << " Time: " << getTime(i,False) << " Direction: " << formatDirection(md)
     1848         << endl << "     => ";
    18451849    MeasFrame frame(mp, me);
    18461850    Vector<Double> azel =
     
    18501854    azCol_.put(i,azel[0]);
    18511855    elCol_.put(i,azel[1]);
    1852   }
    1853 }
     1856    oss << "azel: " << azel[0]/C::pi*180.0 << " "
     1857        << azel[1]/C::pi*180.0 << " (deg)" << endl;
     1858  }
     1859  pushLog(String(oss));
     1860}
Note: See TracChangeset for help on using the changeset viewer.