Changeset 2435 for trunk/python
- Timestamp:
- 03/15/12 15:25:45 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/scantable.py
r2431 r2435 2309 2309 2310 2310 @asaplog_post_dec 2311 def regrid_channel(self, width=5, plot=False, insitu=None): 2312 """\ 2313 Regrid the spectra by the specified channel width 2314 2315 Parameters: 2316 2317 width: The channel width (float) of regridded spectra 2318 in the current spectral unit. 2319 2320 plot: [NOT IMPLEMENTED YET] 2321 plot the original and the regridded spectra. 2322 In this each indivual fit has to be approved, by 2323 typing 'y' or 'n' 2324 2325 insitu: if False a new scantable is returned. 2326 Otherwise, the scaling is done in-situ 2327 The default is taken from .asaprc (False) 2328 2329 """ 2330 if insitu is None: insitu = rcParams['insitu'] 2331 varlist = vars() 2332 2333 if plot: 2334 asaplog.post() 2335 asaplog.push("Verification plot is not implemtnetd yet.") 2336 asaplog.post("WARN") 2337 2338 s = self.copy() 2339 s._regrid_specchan(width) 2340 2341 s._add_history("regrid_channel", varlist) 2342 2343 # if plot: 2344 # from asap.asapplotter import new_asaplot 2345 # theplot = new_asaplot(rcParams['plotter.gui']) 2346 # theplot.set_panels() 2347 # ylab=s._get_ordinate_label() 2348 # #theplot.palette(0,["#777777","red"]) 2349 # for r in xrange(s.nrow()): 2350 # xsm=s._getabcissa(r) 2351 # ysm=s._getspectrum(r) 2352 # xorg=orgscan._getabcissa(r) 2353 # yorg=orgscan._getspectrum(r) 2354 # theplot.clear() 2355 # theplot.hold() 2356 # theplot.set_axes('ylabel',ylab) 2357 # theplot.set_axes('xlabel',s._getabcissalabel(r)) 2358 # theplot.set_axes('title',s._getsourcename(r)) 2359 # theplot.set_line(label='Original',color="#777777") 2360 # theplot.plot(xorg,yorg) 2361 # theplot.set_line(label='Smoothed',color="red") 2362 # theplot.plot(xsm,ysm) 2363 # ### Ugly part for legend 2364 # for i in [0,1]: 2365 # theplot.subplots[0]['lines'].append( 2366 # [theplot.subplots[0]['axes'].lines[i]] 2367 # ) 2368 # theplot.release() 2369 # ### Ugly part for legend 2370 # theplot.subplots[0]['lines']=[] 2371 # res = raw_input("Accept smoothing ([y]/n): ") 2372 # if res.upper() == 'N': 2373 # s._setspectrum(yorg, r) 2374 # theplot.quit() 2375 # del theplot 2376 # del orgscan 2377 2378 if insitu: self._assign(s) 2379 else: return s 2380 2381 @asaplog_post_dec 2311 2382 def _parse_wn(self, wn): 2312 2383 if isinstance(wn, list) or isinstance(wn, tuple):
Note:
See TracChangeset
for help on using the changeset viewer.