Changeset 2320 for trunk/python/asapmath.py
- Timestamp:
- 10/04/11 13:40:03 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/asapmath.py
r2150 r2320 1012 1012 1013 1013 @asaplog_post_dec 1014 def _array2dOp( scan, value, mode="ADD", tsys=False 1014 def _array2dOp( scan, value, mode="ADD", tsys=False, insitu=None): 1015 1015 """ 1016 1016 This function is workaround on the basic operation of scantable … … 1024 1024 nrow = scan.nrow() 1025 1025 s = None 1026 from asap._asap import stmath 1027 stm = stmath() 1028 stm._setinsitu(insitu) 1026 1029 if len( value ) == 1: 1027 from asap._asap import stmath 1028 stm = stmath() 1029 s = scantable( stm._arrayop( scan.copy(), value[0], mode, tsys ) ) 1030 del stm 1030 s = scantable( stm._arrayop( scan, value[0], mode, tsys ) ) 1031 1031 elif len( value ) != nrow: 1032 1032 raise ValueError( 'len(value) must be 1 or conform to scan.nrow()' ) 1033 1033 else: 1034 1034 from asap._asap import stmath 1035 stm = stmath() 1036 # insitu must be True 1035 if not insitu: 1036 s = scan.copy() 1037 else: 1038 s = scan 1039 # insitu must be True as we go row by row on the same data 1037 1040 stm._setinsitu( True ) 1038 s = scan.copy()1039 sel = selector() 1041 basesel = s.get_selection() 1042 sel = selector()+basesel 1040 1043 for irow in range( nrow ): 1041 1044 sel.set_rows( irow ) … … 1046 1049 #stm._arrayop( s, value[irow], mode, tsys, 'channel' ) 1047 1050 stm._arrayop( s, value[irow], mode, tsys ) 1048 s.set_selection() 1049 sel.reset() 1050 del sel 1051 del stm 1051 s.set_selection(basesel) 1052 1052 return s
Note: See TracChangeset
for help on using the changeset viewer.