- Timestamp:
- 01/29/10 14:02:29 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/alma/python/asapmath.py
r1673 r1679 1047 1047 os.system('rm -rf '+tmpms) 1048 1048 return outfiles 1049 1050 def _array2dOp( scan, value, mode="ADD", tsys=False ): 1051 """ 1052 This function is workaround on the basic operation of scantable 1053 with 2 dimensional float list. 1054 1055 scan: scantable operand 1056 value: float list operand 1057 mode: operation mode (ADD, SUB, MUL, DIV) 1058 tsys: if True, operate tsys as well 1059 """ 1060 nrow = scan.nrow() 1061 s = None 1062 if len( value ) != nrow: 1063 asaplog.push( 'len(value) must conform to scan.nrow()' ) 1064 print_log( 'ERROR' ) 1065 else: 1066 from asap._asap import stmath 1067 stm = stmath() 1068 # insitu must be True 1069 stm._setinsitu( True ) 1070 s = scan.copy() 1071 sel = selector() 1072 for irow in range( nrow ): 1073 sel.set_rows( irow ) 1074 s.set_selection( sel ) 1075 if len( value[irow] ) == 1: 1076 stm._unaryop( s, value[irow][0], mode, tsys ) 1077 else: 1078 stm._arrayop( s, value[irow], mode, tsys, 'channel' ) 1079 s.set_selection() 1080 sel.reset() 1081 del sel 1082 del stm 1083 return s 1084 1085 1086
Note:
See TracChangeset
for help on using the changeset viewer.