- Timestamp:
- 03/16/12 17:53:28 (13 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/STMath.cpp
r2429 r2437 1930 1930 ArrayColumn<Float> specCol(tout, "SPECTRA"); 1931 1931 ArrayColumn<uChar> flagCol(tout, "FLAGTRA"); 1932 ArrayColumn<Float> tsysCol(tout, "TSYS"); 1933 1932 1934 for (uInt i=0; i < tout.nrow(); ++i ) { 1933 1935 MaskedArray<Float> main = maskedArray(specCol(i), flagCol(i)); 1934 1936 MaskedArray<Float> maout; 1935 1937 LatticeUtilities::bin(maout, main, 0, Int(width)); 1936 /// @todo implement channel based tsys binning1937 1938 specCol.put(i, maout.getArray()); 1938 1939 flagCol.put(i, flagsFromMA(maout)); 1940 if (tsysCol(i).nelements() == specCol(i).nelements()) { 1941 MaskedArray<Float> matsysin = maskedArray(tsysCol(i), flagCol(i)); 1942 MaskedArray<Float> matsysout; 1943 LatticeUtilities::bin(matsysout, matsysin, 0, Int(width)); 1944 tsysCol.put(i, matsysout.getArray()); 1945 } 1939 1946 // take only the first binned spectrum's length for the deprecated 1940 1947 // global header item nChan -
trunk/src/Scantable.cpp
r2435 r2437 1917 1917 * need to shift refpix to 0 1918 1918 ***/ 1919 refval = refval - ( refpix + 0.5 * (1 - factor) ) * increment ;1920 refpix = 0;1919 //refval = refval - ( refpix + 0.5 * (1 - factor) ) * increment ; 1920 refpix = (refpix + 0.5)/factor - 0.5; 1921 1921 freqTable_.setEntry( refpix, refval, increment*factor, currId ) ; 1922 1922 os << "ID" << currId << ": channel width (Orig) = " << oldincr << " [" << freqTable_.getUnitString() << "], scale factor = " << factor << LogIO::POST ; … … 1974 1974 Vector<Float> oldtsys = tsysCol_( irow ) ; 1975 1975 Vector<Float> newspec( nChan, 0 ) ; 1976 //Vector<uChar> newflag( nChan, false ) ;1977 1976 Vector<uChar> newflag( nChan, true ) ; 1978 1977 Vector<Float> newtsys ; … … 1988 1987 int oldsize = abcissa.size() ; 1989 1988 double olddnu = abcissa[1] - abcissa[0] ; 1990 //int refChan = 0 ;1991 //double frac = 0.0 ;1992 //double wedge = 0.0 ;1993 //double pile = 0.0 ;1994 1989 int ichan = 0 ; 1995 1990 double wsum = 0.0 ; … … 1997 1992 Vector<double> yi( oldsize + 1 ) ; 1998 1993 zi[0] = abcissa[0] - 0.5 * olddnu ; 1999 //zi[1] = zi[1] + dnu ;2000 1994 for ( int ii = 1 ; ii < nChan ; ii++ ) 2001 1995 zi[ii] = zi[0] + dnu * ii ; 2002 1996 zi[nChan] = zi[nChan-1] + dnu ; 2003 1997 yi[0] = abcissa[0] - 0.5 * olddnu ; 2004 //yi[1] = abcissa[1] + 0.5 * olddnu ;2005 1998 for ( int ii = 1 ; ii < oldsize ; ii++ ) 2006 //yi[ii] = abcissa[ii-1] + olddnu ;2007 1999 yi[ii] = 0.5* (abcissa[ii-1] + abcissa[ii]) ; 2008 2000 yi[oldsize] = abcissa[oldsize-1] \ … … 2025 2017 wsum += ( yr - zl ) ; 2026 2018 } 2027 //newflag[ii] = newflag[ii] || oldflag[j] ;2028 2019 newflag[ii] = newflag[ii] && oldflag[j] ; 2029 2020 } … … 2034 2025 wsum += dnu ; 2035 2026 } 2036 //newflag[ii] = newflag[ii] || oldflag[j] ;2037 2027 newflag[ii] = newflag[ii] && oldflag[j] ; 2038 2028 ichan = j ; … … 2047 2037 wsum += ( yr - yl ) ; 2048 2038 } 2049 //newflag[ii] = newflag[ii] || oldflag[j] ;2050 2039 newflag[ii] = newflag[ii] && oldflag[j] ; 2051 2040 } … … 2056 2045 wsum += ( zr - yl ) ; 2057 2046 } 2058 //newflag[ii] = newflag[ii] || oldflag[j] ;2059 2047 newflag[ii] = newflag[ii] && oldflag[j] ; 2060 2048 ichan = j ; … … 2091 2079 wsum += abs( yr - zl ) ; 2092 2080 } 2093 //newflag[ii] = newflag[ii] || oldflag[j] ;2094 2081 newflag[ii] = newflag[ii] && oldflag[j] ; 2095 2082 } … … 2100 2087 wsum += abs( dnu ) ; 2101 2088 } 2102 //newflag[ii] = newflag[ii] || oldflag[j] ;2103 2089 newflag[ii] = newflag[ii] && oldflag[j] ; 2104 2090 ichan = j ; … … 2113 2099 wsum += abs( yr - yl ) ; 2114 2100 } 2115 //newflag[ii] = newflag[ii] || oldflag[j] ;2116 2101 newflag[ii] = newflag[ii] && oldflag[j] ; 2117 2102 } … … 2122 2107 wsum += abs( zr - yl ) ; 2123 2108 } 2124 //newflag[ii] = newflag[ii] || oldflag[j] ;2125 2109 newflag[ii] = newflag[ii] && oldflag[j] ; 2126 2110 ichan = j ; … … 2140 2124 } 2141 2125 } 2142 // * ichan = 02143 // ***/2144 2126 // //ofs << "olddnu = " << olddnu << ", dnu = " << dnu << endl ; 2145 2127 // pile += dnu ;
Note:
See TracChangeset
for help on using the changeset viewer.