Changeset 180
- Timestamp:
- 01/07/05 11:20:21 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/asapmath.py
r174 r180 127 127 return 128 128 129 def hanning(scan, insitu=False, all=True):129 def smooth(scan, kernel="hanning", width=5.0, insitu=False, all=True): 130 130 """ 131 Hanning smooth the channels.131 Smooth the spectrum by the specified kernel (conserving flux). 132 132 Parameters: 133 133 scan: The input scan 134 kernel: The type of smoothing kernel. Select from 135 'hanning' (default), 'gaussian' and 'boxcar'. 136 The first three characters are sufficient. 137 width: The width of the kernel in pixels. For hanning this is 138 ignored otherwise it defauls to 5 pixels. 139 For 'gaussian' it is the Full Width Half 140 Maximum. For 'boxcar' it is the full width. 134 141 insitu: If False (default) a new scantable is returned. 135 142 Otherwise, the scaling is done in-situ 136 all: if True (default) apply to all spectra. Otherwise137 143 all: If True (default) apply to all spectra. Otherwise 144 apply only to the selected (beam/pol/if)spectra only 138 145 Example: 139 146 none 140 147 """ 141 148 if not insitu: 142 from asap._asap import hanning as _hann143 return scantable(_ hann(scan,all))149 from asap._asap import smooth as _smooth 150 return scantable(_smooth(scan,kernel,width,all)) 144 151 else: 145 from asap._asap import hanning_insitu as _hann146 _ hann(scan,all)152 from asap._asap import smooth_insitu as _smooth 153 _smooth(scan,kernel,width,all) 147 154 return 148 155
Note:
See TracChangeset
for help on using the changeset viewer.