- Timestamp:
- 03/15/12 15:25:45 (13 years ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/Scantable.cpp
r2433 r2435 1885 1885 } 1886 1886 1887 void asap::Scantable::regridSpecChannel( double dnu, int nChan ) 1888 { 1889 LogIO os( LogOrigin( "Scantable", "regridChannel()", WHERE ) ) ; 1890 os << "Regrid abcissa with spectral resoultion " << dnu << " " << freqTable_.getUnitString() << " with channel number " << ((nChan>0)? String(nChan) : "covering band width")<< LogIO::POST ; 1891 int freqnrow = freqTable_.table().nrow() ; 1892 Vector<bool> firstTime( freqnrow, true ) ; 1893 double oldincr, factor; 1894 uInt currId; 1895 Double refpix ; 1896 Double refval ; 1897 Double increment ; 1898 for ( int irow = 0 ; irow < nrow() ; irow++ ) { 1899 currId = mfreqidCol_(irow); 1900 vector<double> abcissa = getAbcissa( irow ) ; 1901 if (nChan < 0) { 1902 int oldsize = abcissa.size() ; 1903 double bw = (abcissa[oldsize-1]-abcissa[0]) + \ 1904 0.5 * (abcissa[1]-abcissa[0] + abcissa[oldsize-1]-abcissa[oldsize-2]) ; 1905 nChan = int( ceil( abs(bw/dnu) ) ) ; 1906 } 1907 // actual regridding 1908 regridChannel( nChan, dnu, irow ) ; 1909 1910 // update FREQUENCIES subtable 1911 if (firstTime[currId]) { 1912 oldincr = abcissa[1]-abcissa[0] ; 1913 factor = dnu/oldincr ; 1914 firstTime[currId] = false ; 1915 freqTable_.getEntry( refpix, refval, increment, currId ) ; 1916 /*** 1917 * need to shift refpix to 0 1918 ***/ 1919 refval = refval - ( refpix + 0.5 * (1 - factor) ) * increment ; 1920 refpix = 0 ; 1921 freqTable_.setEntry( refpix, refval, increment*factor, currId ) ; 1922 os << "ID" << currId << ": channel width (Orig) = " << oldincr << " [" << freqTable_.getUnitString() << "], scale factor = " << factor << LogIO::POST ; 1923 os << " frequency increment (Orig) = " << increment << "-> (New) " << increment*factor << LogIO::POST ; 1924 } 1925 } 1926 } 1887 1927 1888 1928 void asap::Scantable::regridChannel( int nChan, double dnu ) -
trunk/src/Scantable.h
r2411 r2435 501 501 void regridChannel( int nchan, double dnu ) ; 502 502 void regridChannel( int nchan, double dnu, int irow ) ; 503 504 void regridSpecChannel( double dnu, int nchan=-1 ) ; 503 505 504 506 bool getFlagtraFast(casa::uInt whichrow); -
trunk/src/ScantableWrapper.h
r2290 r2435 268 268 { table_->reshapeSpectrum( nmin, nmax ); } 269 269 270 void regridSpecChannel( double dnu, int nchan ) 271 { table_->regridSpecChannel( dnu, nchan ); } 272 270 273 void polyBaseline(const std::vector<bool>& mask, int order, bool getresidual=true, const std::string& showprogress="true,1000", const bool outlog=false, const std::string& blfile="") 271 274 { table_->polyBaseline(mask, order, getresidual, showprogress, outlog, blfile); } -
trunk/src/python_Scantable.cpp
r2286 r2435 145 145 (boost::python::arg("nmin")=-1, 146 146 boost::python::arg("nmax")=-1) ) 147 .def("_regrid_specchan", &ScantableWrapper::regridSpecChannel, 148 (boost::python::arg("nchan")=-1) ) 147 149 .def("_poly_baseline", &ScantableWrapper::polyBaseline) 148 150 .def("_auto_poly_baseline", &ScantableWrapper::autoPolyBaseline)
Note:
See TracChangeset
for help on using the changeset viewer.