Changeset 401 for trunk/src/SDMemTable.cc
- Timestamp:
- 02/09/05 22:28:48 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/SDMemTable.cc
r395 r401 742 742 // Set reference frame conversion (requires row) 743 743 744 MDirection dir ect= getDirection(whichRow);744 MDirection dir = getDirection(whichRow); 745 745 MEpoch epoch = getEpoch(whichRow); 746 746 MPosition pos = getAntennaPosition(); 747 if (!spec.setReferenceConversion(mtype,epoch,pos,direct)) { 747 // 748 if (!spec.setReferenceConversion(mtype,epoch,pos,dir)) { 748 749 throw(AipsError("Couldn't convert frequency frame.")); 749 750 } … … 1326 1327 } 1327 1328 1328 casa::Bool SDMemTable::setRestFreqs (const casa::Vector<Double>& restFreqs, const String& sUnit, 1329 const casa::String& source, 1330 casa::Int whichIF) 1329 Bool SDMemTable::setRestFreqs (const Vector<Double>& restFreqsIn, 1330 const String& sUnit, 1331 const vector<string>& lines, 1332 const String& source, 1333 Int whichIF) 1331 1334 { 1332 1335 const Int nIFs = nIF(); … … 1335 1338 } 1336 1339 1340 // FInd vector of restfrequencies 1341 // Double takes precedence over String 1342 1343 Unit unit; 1344 Vector<Double> restFreqs; 1345 if (restFreqsIn.nelements()>0) { 1346 restFreqs.resize(restFreqsIn.nelements()); 1347 restFreqs = restFreqsIn; 1348 unit = Unit(sUnit); 1349 } else if (lines.size()>0) { 1350 const uInt nLines = lines.size(); 1351 unit = Unit("Hz"); 1352 restFreqs.resize(nLines); 1353 MFrequency lineFreq; 1354 for (uInt i=0; i<nLines; i++) { 1355 String tS(lines[i]); 1356 tS.upcase(); 1357 if (MeasTable::Line(lineFreq, tS)) { 1358 restFreqs[i] = lineFreq.getValue().getValue(); // Hz 1359 } else { 1360 String s = String(lines[i]) + String(" is an unrecognized spectral line"); 1361 throw(AipsError(s)); 1362 } 1363 } 1364 } else { 1365 throw(AipsError("You have not specified any rest frequencies or lines")); 1366 } 1367 1337 1368 // If multiple restfreqs, must be length nIF. In this 1338 1369 // case we will just replace the rest frequencies … … 1340 1371 1341 1372 const uInt nRestFreqs = restFreqs.nelements(); 1342 Unit unit(sUnit);1343 1373 Int idx = -1; 1344 1374 SDFrequencyTable sdft = getSDFreqTable(); … … 1408 1438 } 1409 1439 1440 void SDMemTable::spectralLines () const 1441 { 1442 Vector<String> lines = MeasTable::Lines(); 1443 MFrequency lineFreq; 1444 Double freq; 1445 // 1446 cerr.flags(std::ios_base::left); 1447 cerr << "Line Frequency (Hz)" << endl; 1448 cerr << "-----------------------" << endl; 1449 for (uInt i=0; i<lines.nelements(); i++) { 1450 MeasTable::Line(lineFreq, lines[i]); 1451 freq = lineFreq.getValue().getValue(); // Hz 1452 // 1453 cerr << setw(11) << lines[i] << setprecision(10) << freq << endl; 1454 } 1455 } 1410 1456 1411 1457 void SDMemTable::renumber()
Note: See TracChangeset
for help on using the changeset viewer.