Changeset 1757 for branches/alma/src/Scantable.cpp
- Timestamp:
- 06/09/10 19:03:06 (14 years ago)
- Location:
- branches/alma
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/alma
-
Property
svn:ignore
set to
.sconf_temp
.sconsign.dblite
-
Property
svn:mergeinfo
set to
/branches/asap-3.x merged eligible
-
Property
svn:ignore
set to
-
branches/alma/src/Scantable.cpp
r1707 r1757 261 261 td.addColumn(ScalarColumnDesc<Float>("AZIMUTH")); 262 262 td.addColumn(ScalarColumnDesc<Float>("ELEVATION")); 263 td.addColumn(ScalarColumnDesc<Float>("PARANGLE"));264 263 td.addColumn(ScalarColumnDesc<Float>("OPACITY")); 265 264 … … 303 302 elCol_.attach(table_, "ELEVATION"); 304 303 dirCol_.attach(table_, "DIRECTION"); 305 paraCol_.attach(table_, "PARANGLE");306 304 fldnCol_.attach(table_, "FIELDNAME"); 307 305 rbeamCol_.attach(table_, "REFBEAMNO"); 308 306 307 mweatheridCol_.attach(table_,"WEATHER_ID"); 309 308 mfitidCol_.attach(table_,"FIT_ID"); 310 309 mfreqidCol_.attach(table_, "FREQ_ID"); … … 501 500 } 502 501 503 MPosition Scantable::getAntennaPosition 502 MPosition Scantable::getAntennaPosition() const 504 503 { 505 504 Vector<Double> antpos; … … 515 514 /// @todo reindex SCANNO, recompute nbeam, nif, npol 516 515 inname = path.expandedName(); 517 table_.deepCopy(inname, Table::New); 516 // WORKAROUND !!! for Table bug 517 // Remove when fixed in casacore 518 if ( table_.tableType() == Table::Memory && !selector_.empty() ) { 519 Table tab = table_.copyToMemoryTable(generateName()); 520 tab.deepCopy(inname, Table::New); 521 tab.markForDelete(); 522 523 } else { 524 table_.deepCopy(inname, Table::New); 525 } 518 526 } 519 527 … … 646 654 } 647 655 648 std::vector<uint> Scantable::getNumbers( ScalarColumn<uInt>& col)656 std::vector<uint> Scantable::getNumbers(const ScalarColumn<uInt>& col) const 649 657 { 650 658 Vector<uInt> nos(col.getColumn()); … … 840 848 specCol_.get(whichrow, arr); 841 849 } else { 842 CountedPtr<STPol> stpol(STPol::getPolClass(Scantable::factories_, basetype)); 850 CountedPtr<STPol> stpol(STPol::getPolClass(Scantable::factories_, 851 basetype)); 843 852 uInt row = uInt(whichrow); 844 853 stpol->setSpectra(getPolMatrix(row)); 845 854 Float fang,fhand,parang; 846 fang = focusTable_.getTotal FeedAngle(mfocusidCol_(row));855 fang = focusTable_.getTotalAngle(mfocusidCol_(row)); 847 856 fhand = focusTable_.getFeedHand(mfocusidCol_(row)); 848 parang = paraCol_(row); 849 /// @todo re-enable this 850 // disable total feed angle to support paralactifying Caswell style 851 stpol->setPhaseCorrections(parang, -parang, fhand); 857 stpol->setPhaseCorrections(fang, fhand); 852 858 arr = stpol->getSpectrum(requestedpol, ptype); 853 859 } … … 921 927 << setw(15) << "Polarisations:" << setw(4) << npol() 922 928 << "(" << getPolType() << ")" << endl 923 << setw(15) << "Channels:" << setw(4) << nchan() << endl; 924 oss << endl; 929 << setw(15) << "Channels:" << nchan() << endl; 925 930 String tmp; 926 931 oss << setw(15) << "Observer:" … … 967 972 << setw(10) << "Time" << setw(18) << "Integration" << endl; 968 973 oss << setw(5) << "" << setw(5) << "Beam" << setw(3) << "" << dirtype << endl; 969 oss << setw(10) << "" << setw(3) << "IF" << setw( 6) << ""974 oss << setw(10) << "" << setw(3) << "IF" << setw(3) << "" 970 975 << setw(8) << "Frame" << setw(16) 971 << "RefVal" << setw(10) << "RefPix" << setw(12) << "Increment" <<endl; 976 << "RefVal" << setw(10) << "RefPix" << setw(12) << "Increment" 977 << setw(7) << "Channels" 978 << endl; 972 979 oss << asap::SEPERATOR << endl; 973 980 TableIterator iter(table_, "SCANNO"); … … 1004 1011 ROTableRow irow(isubt); 1005 1012 const TableRecord& irec = irow.get(0); 1006 oss << setw( 10) << "";1013 oss << setw(9) << ""; 1007 1014 oss << setw(3) << std::right << irec.asuInt("IFNO") << std::left 1008 << setw(2) << "" << frequencies().print(irec.asuInt("FREQ_ID")) 1015 << setw(1) << "" << frequencies().print(irec.asuInt("FREQ_ID")) 1016 << setw(3) << "" << nchan(irec.asuInt("IFNO")) 1009 1017 << endl; 1010 1018 … … 1040 1048 Double tm; 1041 1049 table_.keywordSet().get("UTC",tm); 1042 return MEpoch(MVEpoch(tm)); 1050 return MEpoch(MVEpoch(tm)); 1043 1051 } 1044 1052 } … … 1047 1055 { 1048 1056 return formatDirection(getDirection(uInt(whichrow))); 1057 } 1058 1059 1060 SpectralCoordinate Scantable::getSpectralCoordinate(int whichrow) const { 1061 const MPosition& mp = getAntennaPosition(); 1062 const MDirection& md = getDirection(whichrow); 1063 const MEpoch& me = timeCol_(whichrow); 1064 //Double rf = moleculeTable_.getRestFrequency(mmolidCol_(whichrow)); 1065 Vector<Double> rf = moleculeTable_.getRestFrequency(mmolidCol_(whichrow)); 1066 return freqTable_.getSpectralCoordinate(md, mp, me, rf, 1067 mfreqidCol_(whichrow)); 1049 1068 } 1050 1069 … … 1061 1080 return stlout; 1062 1081 } 1063 1064 const MPosition& mp = getAntennaPosition(); 1065 const MDirection& md = getDirection(whichrow); 1066 const MEpoch& me = timeCol_(whichrow); 1067 //Double rf = moleculeTable_.getRestFrequency(mmolidCol_(whichrow)); 1068 Vector<Double> rf = moleculeTable_.getRestFrequency(mmolidCol_(whichrow)); 1069 SpectralCoordinate spc = 1070 freqTable_.getSpectralCoordinate(md, mp, me, rf, mfreqidCol_(whichrow)); 1082 SpectralCoordinate spc = getSpectralCoordinate(whichrow); 1071 1083 Vector<Double> pixel(nchan); 1072 1084 Vector<Double> world; … … 1225 1237 Sort::QuickSort|Sort::NoDuplicates ); 1226 1238 for (uInt i=0; i<fids.nelements(); ++i) { 1227 frequencies().shiftRefPix(npix, i);1228 } 1229 } 1230 1231 std::string asap::Scantable::getAntennaName() const1239 frequencies().shiftRefPix(npix, fids[i]); 1240 } 1241 } 1242 1243 std::string Scantable::getAntennaName() const 1232 1244 { 1233 1245 String out; … … 1236 1248 } 1237 1249 1238 int asap::Scantable::checkScanInfo(const std::vector<int>& scanlist) const1250 int Scantable::checkScanInfo(const std::vector<int>& scanlist) const 1239 1251 { 1240 1252 String tbpath; … … 1321 1333 } 1322 1334 1323 std::vector<double> asap::Scantable::getDirectionVector(int whichrow) const1335 std::vector<double> Scantable::getDirectionVector(int whichrow) const 1324 1336 { 1325 1337 Vector<Double> Dir = dirCol_(whichrow).getAngle("rad").getValue(); … … 1681 1693 } 1682 1694 1695 std::vector<float> Scantable::getWeather(int whichrow) const 1696 { 1697 std::vector<float> out(5); 1698 //Float temperature, pressure, humidity, windspeed, windaz; 1699 weatherTable_.getEntry(out[0], out[1], out[2], out[3], out[4], 1700 mweatheridCol_(uInt(whichrow))); 1701 1702 1703 return out; 1704 } 1705 1683 1706 } 1684 1707 //namespace asap
Note: See TracChangeset
for help on using the changeset viewer.