- Timestamp:
- 08/01/06 12:31:39 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/scantable.py
r1093 r1099 794 794 scanav: True averages each scan separately 795 795 False (default) averages all scans together, 796 weight: Weighting scheme. 'none', 'var' (1/var(spec) 797 weighted), 'tsys' (1/Tsys**2 weighted), 'tint' 798 (integration time weighted) or 'tintsys' (Tint/Tsys**2). 796 weight: Weighting scheme. 797 'none' (mean no weight) 798 'var' (1/var(spec) weighted) 799 'tsys' (1/Tsys**2 weighted) 800 'tint' (integration time weighted) 801 'tintsys' (Tint/Tsys**2) 802 'median' ( median averaging) 799 803 The default is 'tint' 800 804 align: align the spectra in velocity before averaging. It takes … … 807 811 if weight is None: weight = 'TINT' 808 812 if mask is None: mask = () 809 if scanav: 810 scanav = "SCAN" 811 else: 812 scanav = "NONE" 813 if scanav: scanav = "SCAN" 814 else: scanav = "NONE" 813 815 scan = (self,) 814 816 try: 815 817 if align: 816 818 scan = (self.freq_align(insitu=False),) 817 s = scantable(self._math._average(scan, mask, weight.upper(), 819 s = None 820 if weight.upper() == 'MEDIAN': 821 s = scantable(self._math._averagechannel(scan[0], 'MEDIAN', scanav)) 822 else: 823 s = scantable(self._math._average(scan, mask, weight.upper(), 818 824 scanav)) 819 825 except RuntimeError,msg: … … 822 828 return 823 829 else: raise 824 s._add_history("average_time",varlist) 825 print_log() 826 return s 827 828 def average_channel(self, mode="MEDIAN", scanav=False, align=False): 829 """ 830 Return the (median) average of a scan. 831 Note: 832 in channels only - align if necessary 833 the median Tsys is computed. 834 Parameters: 835 one scan or comma separated scans 836 mode: type of average, default "MEDIAN" 837 scanav: True averages each scan separately 838 False (default) averages all scans together, 839 align: align the spectra in velocity before averaging. It takes 840 the time of the first spectrum as reference time. 841 Example: 842 # median average the scan 843 newscan = scan.average_channel() 844 """ 845 varlist = vars() 846 if mode is None: mode = 'MEDIAN' 847 scanav = "NONE" 848 if scanav: scanav = "SCAN" 849 scan = self 850 try: 851 if align: 852 scan = self.freq_align(insitu=False) 853 s = scantable(self._math._averagechannel(scan, mode, scanav)) 854 except RuntimeError,msg: 855 if rcParams['verbose']: 856 print msg 857 return 858 else: raise 859 s._add_history("average_channel",varlist) 830 s._add_history("average_time", varlist) 860 831 print_log() 861 832 return s
Note:
See TracChangeset
for help on using the changeset viewer.