- Timestamp:
- 01/31/13 13:14:27 (12 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/MSFiller.cpp
r2746 r2754 257 257 MSFillerVisitor(const Table &from, Scantable &to) 258 258 : BaseMSFillerVisitor(from), 259 scantable( to ) 259 scantable(to), 260 freqToLsr_(False) 260 261 { 261 262 antennaId = 0 ; … … 712 713 sysCalTsysCol.attach( sctab, tsysCol ) ; 713 714 } 715 void setFreqToLsr(Bool b) { freqToLsr_ = b; } 714 716 STHeader getHeader() { return header ; } 715 717 uInt getNumBeam() { return nbeam ; } … … 816 818 MFrequency::Types freqRef = MFrequency::castType( measFreqRef ) ; 817 819 //freqref = MFrequency::showType( freqRef ) ; 818 freqref = "LSRK" ; 820 //freqref = "LSRK" ; 821 freqref = "TOPO"; 819 822 Quantum<Double> q ; 820 823 getScalarQuant( "TOTAL_BANDWIDTH", spwId, spwtab, q ) ; … … 842 845 if ( even ) 843 846 refval = 0.5 * ( refval + qa[refchan+1].getValue( "Hz" ) ) ; 844 if ( freqRef != MFrequency::LSRK ) { 847 if ( freqToLsr_ && freqRef != MFrequency::LSRK ) { 848 //cout << "do conversion to LSRK" << endl; 845 849 MeasFrame mframe( me, mp, md ) ; 846 850 MFrequency::Convert tolsr( freqRef, MFrequency::Ref( MFrequency::LSRK, mframe ) ) ; … … 1314 1318 //String tsysCol; 1315 1319 //String tcalCol; 1320 Bool freqToLsr_; 1316 1321 1317 1322 // MS subtables … … 1585 1590 antennaStr_(""), 1586 1591 getPt_( True ), 1592 freqToLsr_( False ), 1587 1593 isFloatData_( False ), 1588 1594 isData_( False ), … … 1631 1637 antenna_ = 0 ; 1632 1638 } 1639 if ( msrec.isDefined( "freq_tolsr" ) ) { 1640 freqToLsr_ = msrec.asBool( "freq_tolsr" ) ; 1641 } 1633 1642 } 1634 1643 … … 1649 1658 1650 1659 os_ << "Parsing MS options" << endl ; 1651 os_ << " getPt = " << getPt_<< endl ;1660 os_ << " getPt = " << (getPt_ ? "True" : "False") << endl ; 1652 1661 os_ << " antenna = " << antenna_ << endl ; 1653 os_ << " antennaStr = " << antennaStr_ << LogIO::POST ; 1662 os_ << " antennaStr = " << antennaStr_ << endl ; 1663 os_ << " freqToLsr = " << (freqToLsr_ ? "True" : "False") << LogIO::POST; 1654 1664 1655 1665 mstable_ = MeasurementSet( (*tmpMS)( tmpMS->col("ANTENNA1") == antenna_ … … 1745 1755 string freqFrame = "LSRK" ; 1746 1756 table_->frequencies().setFrame( freqFrame ) ; 1747 table_->frequencies().setFrame( freqFrame, True ) ; 1757 if ( freqToLsr_ ) { 1758 table_->frequencies().setFrame( freqFrame, True ) ; 1759 } 1760 else { 1761 string baseFrame = frameFromSpwTable() ; 1762 table_->frequencies().setFrame( baseFrame, True ) ; 1763 } 1748 1764 1749 1765 // SUBTABLES: WEATHER … … 1791 1807 if ( isSysCal_ ) 1792 1808 myVisitor.setSysCalRecord( tcalrec_ ) ; 1809 myVisitor.setFreqToLsr( freqToLsr_ ) ; 1793 1810 1794 1811 //double t2 = mathutil::gettimeofday_sec() ; … … 2159 2176 } 2160 2177 2178 string MSFiller::frameFromSpwTable() 2179 { 2180 string frameString; 2181 Table tab = mstable_.spectralWindow(); 2182 ROScalarColumn<Int> mfrCol(tab, "MEAS_FREQ_REF"); 2183 Vector<Int> mfr = mfrCol.getColumn(); 2184 if (allEQ(mfr,mfr[0])) { 2185 frameString = MFrequency::showType(mfr[0]); 2186 //cout << "all rows have same frame: " << frameString << endl; 2187 } 2188 else { 2189 mfrCol.attach(tab, "NUM_CHAN"); 2190 for (uInt i = 0; i < tab.nrow(); i++) { 2191 if (mfrCol(i) != 4) { 2192 frameString = MFrequency::showType(mfr[i]); 2193 break; 2194 } 2195 } 2196 if (frameString.size() == 0) { 2197 frameString = "TOPO"; 2198 } 2199 } 2200 2201 //cout << "frameString = " << frameString << endl; 2202 2203 return frameString; 2204 } 2205 2161 2206 }; -
trunk/src/MSFiller.h
r2744 r2754 156 156 void initHeader( STHeader &header ) ; 157 157 158 // get base frame from SPECTRAL_WINDOW table 159 std::string frameFromSpwTable(); 160 158 161 CountedPtr<Scantable> table_ ; 159 162 MeasurementSet mstable_ ; … … 162 165 String antennaStr_ ; 163 166 Bool getPt_ ; 167 Bool freqToLsr_ ; 164 168 165 169 Bool isFloatData_ ;
Note:
See TracChangeset
for help on using the changeset viewer.