Changeset 317
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/SDMath.cc
r315 r317 108 108 109 109 110 SDMemTable* SDMath::frequencyAlignment (const SDMemTable& in, const String& refTime ) const110 SDMemTable* SDMath::frequencyAlignment (const SDMemTable& in, const String& refTime, const String& method) const 111 111 { 112 112 … … 128 128 // Do it 129 129 130 return frequencyAlign (in, freqSystem, refTime );130 return frequencyAlign (in, freqSystem, refTime, method); 131 131 } 132 132 … … 635 635 } 636 636 637 638 637 // Interpolation method 639 638 640 Int interpMethod = 0; 641 convertInterpString(interpMethod, methodStr); 639 InterpolateArray1D<Double,Float>::InterpolationMethod interp; 640 convertInterpString(interp, methodStr); 641 Int interpMethod(interp); 642 642 643 643 // Make output table … … 1253 1253 SDMemTable* SDMath::frequencyAlign (const SDMemTable& in, 1254 1254 MFrequency::Types freqSystem, 1255 const String& refTime ) const1255 const String& refTime, const String& methodStr) const 1256 1256 { 1257 1257 // Get Header … … 1312 1312 freqSystem, refPos, refEpoch); 1313 1313 1314 // Interpolation method 1315 1316 InterpolateArray1D<Double,Float>::InterpolationMethod interp; 1317 convertInterpString(interp, methodStr); 1318 1314 1319 // New output Table 1315 1320 … … 1319 1324 1320 1325 const IPosition polChanAxes(2, asap::PolAxis, asap::ChanAxis); 1321 FrequencyAligner<Float>::Method method = FrequencyAligner<Float>::LINEAR; 1326 1322 1327 Bool extrapolate=False; 1323 1328 Bool useCachedAbcissa = False; … … 1376 1381 while (!itValuesVec.pastEnd()) { 1377 1382 ok = a[faIdx]->align (yOut, maskOut, itValuesVec.vector(), 1378 1379 method, extrapolate);1383 itMaskVec.vector(), epoch, useCachedAbcissa, 1384 interp, extrapolate); 1380 1385 itValuesVec.vector() = yOut; 1381 1386 itMaskVec.vector() = maskOut; … … 1631 1636 } 1632 1637 1633 void SDMath::convertInterpString(Int& type, const String& interp) const 1638 1639 void SDMath::convertInterpString(casa::InterpolateArray1D<Double,Float>::InterpolationMethod& type, 1640 const casa::String& interp) const 1634 1641 { 1635 1642 String tStr(interp); 1636 1643 tStr.upcase(); 1637 1644 if (tStr.contains(String("NEAR"))) { 1638 type = InterpolateArray1D< Float,Float>::nearestNeighbour;1645 type = InterpolateArray1D<Double,Float>::nearestNeighbour; 1639 1646 } else if (tStr.contains(String("LIN"))) { 1640 type = InterpolateArray1D< Float,Float>::linear;1647 type = InterpolateArray1D<Double,Float>::linear; 1641 1648 } else if (tStr.contains(String("CUB"))) { 1642 type = InterpolateArray1D< Float,Float>::cubic;1649 type = InterpolateArray1D<Double,Float>::cubic; 1643 1650 } else if (tStr.contains(String("SPL"))) { 1644 type = InterpolateArray1D< Float,Float>::spline;1651 type = InterpolateArray1D<Double,Float>::spline; 1645 1652 } else { 1646 1653 throw(AipsError("Unrecognized interpolation type")); … … 1698 1705 // Interpolate (and extrapolate) with desired method 1699 1706 1700 Int method = 0;1707 InterpolateArray1D<Double,Float>::InterpolationMethod method; 1701 1708 convertInterpString(method, methodStr); 1709 Int intMethod(method); 1702 1710 // 1703 1711 Vector<Float> yOut; 1704 1712 Vector<Bool> maskOut; 1705 1713 InterpolateArray1D<Float,Float>::interpolate(yOut, maskOut, xOut, 1706 xIn, yIn, maskIn, method,1714 xIn, yIn, maskIn, intMethod, 1707 1715 True, True); 1708 1716 // Apply -
trunk/src/SDMath.h
r315 r317 106 106 107 107 // Frequency Alignment 108 SDMemTable* frequencyAlignment (const SDMemTable& in, const casa::String& refTime) const; 108 SDMemTable* frequencyAlignment (const SDMemTable& in, const casa::String& refTime, 109 const casa::String& method) const; 109 110 110 111 // Opacity correction … … 165 166 166 167 // Convert interpolation type string 167 void convertInterpString(casa::Int& type, const casa::String& interp) const; 168 // void convertInterpString(casa::Int& type, const casa::String& interp) const; 169 void convertInterpString(casa::InterpolateArray1D<casa::Double,casa::Float>::InterpolationMethod& method, 170 const casa::String& interp) const; 168 171 169 172 // Correct data from an ascii Table … … 206 209 SDMemTable* frequencyAlign (const SDMemTable& in, 207 210 casa::MFrequency::Types system, 208 const casa::String& timeRef) const; 211 const casa::String& timeRef, 212 const casa::String& method) const; 209 213 210 214 // Convert time String to Epoch
Note:
See TracChangeset
for help on using the changeset viewer.