Changeset 2952 for trunk/python
- Timestamp:
- 06/24/14 19:59:46 (11 years ago)
- Location:
- trunk/python
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/asapmath.py
r2904 r2952 1025 1025 1026 1026 @asaplog_post_dec 1027 def _array2dOp( scan, value, mode="ADD", tsys=False, insitu=None ):1027 def _array2dOp( scan, value, mode="ADD", tsys=False, insitu=None, skip_flaggedrow=False): 1028 1028 """ 1029 1029 This function is workaround on the basic operation of scantable … … 1036 1036 insitu: if False, a new scantable is returned. 1037 1037 Otherwise, the array operation is done in-sitsu. 1038 skip_flaggedrow: skip operation for row-flagged spectra. 1038 1039 """ 1039 1040 if insitu is None: insitu = rcParams['insitu'] … … 1044 1045 stm._setinsitu(insitu) 1045 1046 if len( value ) == 1: 1046 s = scantable( stm._arrayop( scan, value[0], mode, tsys ) )1047 s = scantable( stm._arrayop( scan, value[0], mode, tsys, skip_flaggedrow ) ) 1047 1048 elif len( value ) != nrow: 1048 1049 raise ValueError( 'len(value) must be 1 or conform to scan.nrow()' ) … … 1062 1063 s.set_selection( sel ) 1063 1064 if len( value[irow] ) == 1: 1064 stm._unaryop( s, value[irow][0], mode, tsys )1065 stm._unaryop( s, value[irow][0], mode, tsys, skip_flaggedrow ) 1065 1066 else: 1066 1067 #stm._arrayop( s, value[irow], mode, tsys, 'channel' ) 1067 stm._arrayop( s, value[irow], mode, tsys )1068 stm._arrayop( s, value[irow], mode, tsys, skip_flaggedrow ) 1068 1069 s.set_selection(basesel) 1069 1070 return s -
trunk/python/scantable.py
r2937 r2952 4797 4797 4798 4798 @asaplog_post_dec 4799 def scale(self, factor, tsys=True, insitu=None ):4799 def scale(self, factor, tsys=True, insitu=None, skip_flaggedrow=False): 4800 4800 """\ 4801 4801 … … 4813 4813 as well as the data 4814 4814 4815 skip_flaggedrow: if True, scaling is NOT executed for 4816 row-flagged spectra. default is False. 4815 4817 """ 4816 4818 if insitu is None: insitu = rcParams['insitu'] … … 4823 4825 numpy.ndarray): 4824 4826 from asapmath import _array2dOp 4825 s = _array2dOp( self, factor, "MUL", tsys, insitu )4827 s = _array2dOp( self, factor, "MUL", tsys, insitu, skip_flaggedrow ) 4826 4828 else: 4827 4829 s = scantable( self._math._arrayop( self, factor, 4828 "MUL", tsys ) )4830 "MUL", tsys, skip_flaggedrow ) ) 4829 4831 else: 4830 s = scantable(self._math._unaryop(self, factor, "MUL", tsys ))4832 s = scantable(self._math._unaryop(self, factor, "MUL", tsys, skip_flaggedrow)) 4831 4833 s._add_history("scale", varlist) 4832 4834 if insitu:
Note:
See TracChangeset
for help on using the changeset viewer.