- Timestamp:
- 01/27/05 21:47:09 (20 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/SDMemTable.cc
r303 r306 331 331 { 332 332 std::vector<string>::iterator it; 333 String un,rfrm,dpl; 334 un = theinfo[0]; 335 rfrm = theinfo[1]; 336 dpl = theinfo[2]; 337 333 String un,rfrm, brfrm,dpl; 334 un = theinfo[0]; // Abcissa unit 335 rfrm = theinfo[1]; // Active (or conversion) frame 336 dpl = theinfo[2]; // Doppler 337 brfrm = theinfo[3]; // Base frame 338 // 338 339 Table t = table_.rwKeywordSet().asTable("FREQUENCIES"); 340 // 339 341 Vector<Double> rstf; 340 342 t.keywordSet().get("RESTFREQS",rstf); 343 // 341 344 Bool canDo = True; 342 345 Unit u1("km/s");Unit u2("Hz"); … … 370 373 t.rwKeywordSet().define("DOPPLER",dpl); 371 374 } 375 // 376 if (!MFrequency::getType(mdr, brfrm)) { 377 Int a,b;const uInt* c; 378 const String* valid = MFrequency::allMyTypes(a, b, c); 379 String pfix = "Please specify a legal frame type. Types are\n"; 380 throw(AipsError(pfix+(*valid))); 381 } else { 382 t.rwKeywordSet().define("BASEREFFRAME",brfrm); 383 } 372 384 } 373 385 … … 819 831 SDFrequencyTable SDMemTable::getSDFreqTable() const 820 832 { 821 // TODO !!!!! implement this properly USE with care822 833 const Table& t = table_.keywordSet().asTable("FREQUENCIES"); 823 834 SDFrequencyTable sdft; 824 sdft.setLength(t.nrow()); 835 836 // Add refpix/refval/incr. What are the units ? Hz I suppose 837 // but it's nowhere described... 838 839 Vector<Double> refPix, refVal, incr; 840 ScalarColumn<Double> refPixCol(t, "REFPIX"); 841 ScalarColumn<Double> refValCol(t, "REFVAL"); 842 ScalarColumn<Double> incrCol(t, "INCREMENT"); 843 refPix = refPixCol.getColumn(); 844 refVal = refValCol.getColumn(); 845 incr = incrCol.getColumn(); 846 // 847 uInt n = refPix.nelements(); 848 for (uInt i=0; i<n; i++) { 849 sdft.addFrequency(refPix[i], refVal[i], incr[i]); 850 } 851 852 // Frequency reference frame. I don't know if this 853 // is the correct frame. It might be 'REFFRAME' 854 // rather than 'BASEREFFRAME' ? 855 856 String baseFrame; 857 t.keywordSet().get("BASEREFFRAME",baseFrame); 858 sdft.setRefFrame(baseFrame); 859 860 // Equinox 861 862 Float equinox; 863 t.keywordSet().get("EQUINOX", equinox); 864 sdft.setEquinox(equinox); 865 866 // Rest Frequency 867 868 Vector<Double> restFreqs; 869 t.keywordSet().get("RESTFREQS", restFreqs); 870 for (uInt i=0; i<restFreqs.nelements(); i++) { 871 sdft.addRestFrequency(restFreqs[i]); 872 } 873 sdft.setRestFrequencyUnit(String("Hz")); 874 // 825 875 return sdft; 826 876 } -
trunk/src/SDMemTable.h
r303 r306 80 80 SDHeader getSDHeader() const; 81 81 82 // Get SD Frequency table. Note that this function is largely 83 // unimplemented. Only the number of freqIDs is filled in presently. 82 // Get SD Frequency table. 84 83 SDFrequencyTable getSDFreqTable() const; 84 85 85 // get spectrum,mask and tsys for the given row, at the selected 86 86 // cursor - all as stl vectors … … 175 175 176 176 // Return SC, setting only the basic construction state (i.e. 177 // no conversion or velocity or rest frequency state) 177 // no conversion or velocity or rest frequency state). 178 // Specify the index of the FreqID you want 178 179 casa::SpectralCoordinate getSpectralCoordinate(casa::uInt whichIdx) const; 179 180
Note:
See TracChangeset
for help on using the changeset viewer.