- Timestamp:
- 09/13/13 16:03:36 (11 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/STGrid.cpp
r2803 r2851 661 661 data_.resize( gshape ) ; 662 662 data_ = 0.0 ; 663 flag_.resize( gshape ) ; 664 flag_ = (uChar)0; 663 665 STCommonData common = STCommonData(gshape, data_); 664 666 common.gnx = gnx ; … … 809 811 data_.resize( gshape ) ; 810 812 data_ = 0.0 ; 813 flag_.resize( gshape ) ; 814 flag_ = (uChar)0; 811 815 STCommonDataWithClipping common = STCommonDataWithClipping( gshape, 812 816 pshape, … … 1019 1023 const Complex *w1_p ; 1020 1024 Float *w2_p ; 1021 Bool b1, b2 ;1025 Bool b1, b2, b3 ; 1022 1026 const Complex *gdata_p = gdata.getStorage( b1 ) ; 1023 1027 Float *gwgt_p = data_.getStorage( b2 ) ; 1024 w1_p = gdata_p ; 1025 w2_p = gwgt_p ; 1028 uChar *gflg_p = flag_.getStorage( b3 ) ; 1026 1029 for ( uInt i = 0 ; i < len ; i++ ) { 1027 if ( *w2_p > 0.0 ) *w2_p = (*w1_p).real() / *w2_p ; 1028 w1_p++ ; 1029 w2_p++ ; 1030 if (gwgt_p[i] > 0.0) { 1031 gwgt_p[i] = (gdata_p[i]).real() / gwgt_p[i]; 1032 gflg_p[i] = (uChar)0; 1033 } 1034 else { 1035 gflg_p[i] = (uChar)1; 1036 } 1030 1037 } 1031 1038 gdata.freeStorage( gdata_p, b1 ) ; 1032 1039 data_.putStorage( gwgt_p, b2 ) ; 1040 flag_.putStorage( gflg_p, b3 ) ; 1033 1041 t1 = mathutil::gettimeofday_sec() ; 1034 1042 os << LogIO::DEBUGGING << "setData: elapsed time is " << t1-t0 << " sec." << LogIO::POST ; … … 1973 1981 Int irow = 0 ; 1974 1982 Vector<Float> sp( nchan_ ) ; 1975 Vector<uChar> flag( nchan_, (uChar)1 ) ; 1976 Vector<uChar> unflag( nchan_, (uChar)0 ) ; 1977 Bool bsp, bdata ; 1983 Vector<uChar> flag( nchan_ ) ; 1984 Bool bsp, bdata, bflag ; 1978 1985 const Float *data_p = data_.getStorage( bdata ) ; 1986 const uChar *flag_p = flag_.getStorage( bflag ) ; 1979 1987 Float *wsp_p, *sp_p ; 1980 1988 const Float *wdata_p = data_p ; 1989 const uChar *wflag_p = flag_p ; 1981 1990 long step = nx_ * ny_ * npol_ ; 1982 1991 long offset ; … … 1994 2003 wsp_p = sp_p ; 1995 2004 wdata_p = data_p + offset ; 2005 wflag_p = flag_p + offset ; 1996 2006 for ( Int ichan = 0 ; ichan < nchan_ ; ichan++ ) { 1997 2007 *wsp_p = *wdata_p ; 1998 2008 wsp_p++ ; 1999 2009 wdata_p += step ; 2010 flag[ichan] = *wflag_p; 2011 wflag_p += step ; 2000 2012 } 2001 2013 sp.putStorage( sp_p, bsp ) ; 2002 2014 spectraCol.put( irow, sp ) ; 2003 if ( allEQ( sp, (Float)0.0 ) ) { 2004 flagtraCol.put( irow, flag ) ; 2005 } 2006 else { 2007 flagtraCol.put( irow, unflag ) ; 2008 } 2015 flagtraCol.put( irow, flag ) ; 2009 2016 directionCol.put( irow, dir ) ; 2010 2017 polnoCol.put( irow, pollist_[ipol] ) ; … … 2016 2023 } 2017 2024 data_.freeStorage( data_p, bdata ) ; 2025 flag_.freeStorage( flag_p, bflag ) ; 2018 2026 2019 2027 fillMainColumns( tab ) ; -
trunk/src/STGrid.h
r2686 r2851 262 262 Int nrow_ ; 263 263 Array<Float> data_ ; 264 Array<uChar> flag_ ; 264 265 265 266 Table tab_ ;
Note:
See TracChangeset
for help on using the changeset viewer.