- Timestamp:
- 08/10/04 16:23:15 (20 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/SDMemTable.cc
r68 r78 50 50 #include <aips/Tables/TableRecord.h> 51 51 #include <aips/Measures/MFrequency.h> 52 #include <aips/Measures/MeasTable.h> 52 53 #include <aips/Quanta/MVTime.h> 53 54 … … 117 118 td.addColumn(ScalarColumnDesc<Double>("INTERVAL")); 118 119 td.addColumn(ArrayColumnDesc<uInt>("FREQID")); 120 td.addColumn(ArrayColumnDesc<Double>("DIRECTION")); 119 121 // Now create a new table from the description. 120 122 … … 234 236 std::vector<double> SDMemTable::getAbscissa(Int whichRow, 235 237 const std::string& whichUnit, 238 const std::string& whichFrame, 236 239 double restfreq) { 237 240 std::vector<double> absc(nChan()); … … 249 252 } 250 253 SpectralCoordinate spc = getCoordinate(specidx); 254 Table t = table_.keywordSet().asTable("FREQUENCIES"); 255 String rf; 256 t.keywordSet().get("REFFRAME",rf); 257 MDirection::Types mdr; 258 MDirection::getType(mdr, rf); 259 ROArrayColumn<Double> dir(table_, "DIRECTION"); 260 Array<Double> posit; 261 dir.get(whichRow,posit); 262 Vector<Double> wpos(2); 263 wpos[0] = posit(IPosition(2,beamSel_,0)); 264 wpos[1] = posit(IPosition(2,beamSel_,1)); 265 Quantum<Double> lon(wpos[0],Unit(String("rad"))); 266 Quantum<Double> lat(wpos[1],Unit(String("rad"))); 267 MDirection direct(lon, lat, mdr); 268 ROScalarColumn<Double> tme(table_, "TIME"); 269 Double obstime; 270 tme.get(whichRow,obstime); 271 Quantum<Double> tm(obstime, Unit(String("d"))); 272 MVEpoch tm2(tm); 273 MEpoch epoch(tm2); 274 275 Vector<Double> antpos; 276 table_.keywordSet().get("AntennaPosition", antpos); 277 //MPosition pos; 278 MVPosition mvpos(antpos(0),antpos(1),antpos(2)); 279 MPosition pos(mvpos); 280 //MeasTable::Observatory(pos, String("ATCA")); 281 282 MFrequency::Types mtype; 283 if (!MFrequency::getType(mtype, whichFrame)) { 284 cerr << "Frequency type unknown assuming TOPO" << endl; 285 mtype = MFrequency::TOPO; 286 } 287 spc.setReferenceConversion(mtype,epoch,pos,direct); 288 251 289 if ( u == Unit("km/s") ) { 252 290 if (Double(restfreq) > Double(0.000001)) { … … 394 432 return SpectralCoordinate(); 395 433 } 434 396 435 Double rp,rv,inc; 397 436 String rf; … … 471 510 ScalarColumn<Double> integr(table_, "INTERVAL"); 472 511 ArrayColumn<uInt> freqid(table_, "FREQID"); 512 ArrayColumn<Double> dir(table_, "DIRECTION"); 473 513 474 514 uInt rno = table_.nrow(); … … 483 523 integr.put(rno, sdc.interval); 484 524 freqid.put(rno, sdc.getFreqMap()); 525 dir.put(rno, sdc.getDirection()); 485 526 486 527 return true; … … 496 537 ROScalarColumn<Double> integr(table_, "INTERVAL"); 497 538 ROArrayColumn<uInt> freqid(table_, "FREQID"); 539 ROArrayColumn<Double> dir(table_, "DIRECTION"); 498 540 499 541 SDContainer sdc(nBeam(),nIF(),nPol(),nChan()); … … 506 548 Array<uChar> flagtrum; 507 549 Vector<uInt> fmap; 550 Array<Double> direction; 508 551 spec.get(whichRow, spectrum); 509 552 sdc.putSpectrum(spectrum); … … 514 557 freqid.get(whichRow, fmap); 515 558 sdc.putFreqMap(fmap); 559 dir.get(whichRow, direction); 560 sdc.putDirection(direction); 516 561 return sdc; 517 562 } 563 518 564 bool SDMemTable::putSDHeader(const SDHeader& sdh) { 519 565 table_.lock(); -
trunk/src/SDMemTable.h
r68 r78 138 138 std::vector<double> getAbscissa(int whichRow, 139 139 const std::string& whichUnit="GHz", 140 const std::string& whichFrame="TOPO", 140 141 double restfreq=0.0); 141 142 private:
Note:
See TracChangeset
for help on using the changeset viewer.