Changeset 1862
- Timestamp:
- 08/05/10 16:10:15 (14 years ago)
- Location:
- trunk/python
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/asapfitter.py
r1861 r1862 1 1 import _asap 2 2 from asap.parameters import rcParams 3 from asap.logging import asaplog, print_log_dec3 from asap.logging import asaplog, asaplog_post_dec 4 4 from asap.utils import _n_bools, mask_and 5 5 … … 48 48 return 49 49 50 @ print_log_dec50 @asaplog_post_dec 51 51 def set_scan(self, thescan=None, mask=None): 52 52 """ … … 68 68 return 69 69 70 @ print_log_dec70 @asaplog_post_dec 71 71 def set_function(self, **kwargs): 72 72 """ … … 115 115 return 116 116 117 @ print_log_dec117 @asaplog_post_dec 118 118 def fit(self, row=0, estimate=False): 119 119 """ … … 194 194 self.data._addfit(fit,self._fittedrow) 195 195 196 @ print_log_dec196 @asaplog_post_dec 197 197 def set_parameters(self,*args,**kwargs): 198 198 """ … … 235 235 return 236 236 237 @ print_log_dec237 @asaplog_post_dec 238 238 def set_gauss_parameters(self, peak, centre, fwhm, 239 239 peakfixed=0, centrefixed=0, … … 264 264 raise ValueError(msg) 265 265 266 @ print_log_dec266 @asaplog_post_dec 267 267 def set_lorentz_parameters(self, peak, centre, fwhm, 268 268 peakfixed=0, centrefixed=0, … … 322 322 return sum(areas) 323 323 324 @ print_log_dec324 @asaplog_post_dec 325 325 def get_errors(self, component=None): 326 326 """ … … 343 343 344 344 345 @ print_log_dec345 @asaplog_post_dec 346 346 def get_parameters(self, component=None, errors=False): 347 347 """ … … 414 414 415 415 416 @ print_log_dec416 @asaplog_post_dec 417 417 def get_estimate(self): 418 418 """ … … 424 424 return pars 425 425 426 @ print_log_dec426 @asaplog_post_dec 427 427 def get_residual(self): 428 428 """ … … 434 434 return self.fitter.getresidual() 435 435 436 @ print_log_dec436 @asaplog_post_dec 437 437 def get_chi2(self): 438 438 """ … … 446 446 return ch2 447 447 448 @ print_log_dec448 @asaplog_post_dec 449 449 def get_fit(self): 450 450 """ … … 456 456 return self.fitter.getfit() 457 457 458 @ print_log_dec458 @asaplog_post_dec 459 459 def commit(self): 460 460 """ … … 472 472 return scan 473 473 474 @ print_log_dec474 @asaplog_post_dec 475 475 def plot(self, residual=False, components=None, plotparms=False, 476 476 filename=None): … … 572 572 self._p.save(filename) 573 573 574 @ print_log_dec574 @asaplog_post_dec 575 575 def auto_fit(self, insitu=None, plot=False): 576 576 """ -
trunk/python/asapmath.py
r1861 r1862 1 1 from asap.scantable import scantable 2 2 from asap.parameters import rcParams 3 from asap.logging import asaplog, print_log_dec3 from asap.logging import asaplog, asaplog_post_dec 4 4 from asap.selector import selector 5 5 from asap import asaplotgui 6 6 7 @ print_log_dec7 @asaplog_post_dec 8 8 def average_time(*args, **kwargs): 9 9 """ … … 93 93 return s 94 94 95 @ print_log_dec95 @asaplog_post_dec 96 96 def quotient(source, reference, preserve=True): 97 97 """ … … 116 116 return s 117 117 118 @ print_log_dec118 @asaplog_post_dec 119 119 def dototalpower(calon, caloff, tcalval=0.0): 120 120 """ … … 134 134 return s 135 135 136 @ print_log_dec136 @asaplog_post_dec 137 137 def dosigref(sig, ref, smooth, tsysval=0.0, tauval=0.0): 138 138 """ … … 154 154 return s 155 155 156 @ print_log_dec156 @asaplog_post_dec 157 157 def calps(scantab, scannos, smooth=1, tsysval=0.0, tauval=0.0, tcalval=0.0, verify=False): 158 158 """ … … 396 396 return ress 397 397 398 @ print_log_dec398 @asaplog_post_dec 399 399 def calnod(scantab, scannos=[], smooth=1, tsysval=0.0, tauval=0.0, tcalval=0.0, verify=False): 400 400 """ … … 614 614 return resspec 615 615 616 @ print_log_dec616 @asaplog_post_dec 617 617 def calfs(scantab, scannos=[], smooth=1, tsysval=0.0, tauval=0.0, tcalval=0.0, verify=False): 618 618 """ … … 817 817 return resspec 818 818 819 @ print_log_dec819 @asaplog_post_dec 820 820 def merge(*args): 821 821 """ … … 849 849 return s 850 850 851 @ print_log_dec851 @asaplog_post_dec 852 852 def calibrate( scantab, scannos=[], calmode='none', verify=None ): 853 853 """ … … 927 927 return scal 928 928 929 @ print_log_dec929 @asaplog_post_dec 930 930 def splitant(filename, outprefix='',overwrite=False): 931 931 """ … … 991 991 return outfiles 992 992 993 @ print_log_dec993 @asaplog_post_dec 994 994 def _array2dOp( scan, value, mode="ADD", tsys=False ): 995 995 """ -
trunk/python/asapplotter.py
r1861 r1862 2 2 from asap.selector import selector 3 3 from asap.scantable import scantable 4 from asap.logging import asaplog, print_log_dec4 from asap.logging import asaplog, asaplog_post_dec 5 5 import matplotlib.axes 6 6 from matplotlib.font_manager import FontProperties … … 81 81 else: return None 82 82 83 @ print_log_dec83 @asaplog_post_dec 84 84 def plot(self, scan=None): 85 85 """ … … 272 272 # end matplotlib.axes fowarding functions 273 273 274 @ print_log_dec274 @asaplog_post_dec 275 275 def set_data(self, scan, refresh=True): 276 276 """ … … 310 310 if refresh: self.plot() 311 311 312 @ print_log_dec312 @asaplog_post_dec 313 313 def set_mode(self, stacking=None, panelling=None, refresh=True): 314 314 """ … … 729 729 return 730 730 731 @ print_log_dec731 @asaplog_post_dec 732 732 def set_mask(self, mask=None, selection=None, refresh=True): 733 733 """ … … 1149 1149 # plot total power data 1150 1150 # plotting in time is not yet implemented.. 1151 @ print_log_dec1151 @asaplog_post_dec 1152 1152 def plottp(self, scan=None, outfile=None): 1153 1153 if self._plotter.is_dead: … … 1250 1250 1251 1251 # printing header information 1252 @ print_log_dec1252 @asaplog_post_dec 1253 1253 def print_header(self, plot=True, fontsize=9, logger=False, selstr='', extrastr=''): 1254 1254 """ -
trunk/python/logging.py
r1861 r1862 1 1 """This module presents a logging abstraction layer on top of casa. 2 2 """ 3 __all__ = ["asaplog", " print_log_dec", "AsapLogger"]3 __all__ = ["asaplog", "asaplog_post_dec", "AsapLogger"] 4 4 5 5 import inspect … … 85 85 """Default asap logger""" 86 86 87 def print_log_dec(f):87 def asaplog_post_dec(f): 88 88 """Decorator which posts log at completion of the wrapped method. 89 89 90 90 Example:: 91 91 92 @ print_log_dec92 @asaplog_post_dec 93 93 def test(self): 94 94 do_stuff() -
trunk/python/scantable.py
r1861 r1862 11 11 from asap._asap import filler 12 12 from asap.parameters import rcParams 13 from asap.logging import asaplog, print_log_dec13 from asap.logging import asaplog, asaplog_post_dec 14 14 from asap.selector import selector 15 15 from asap.linecatalog import linecatalog … … 47 47 """ 48 48 49 @ print_log_dec49 @asaplog_post_dec 50 50 def __init__(self, filename, average=None, unit=None, getpt=None, 51 51 antenna=None, parallactify=None): … … 136 136 self._add_history("scantable", varlist) 137 137 138 @ print_log_dec138 @asaplog_post_dec 139 139 def save(self, name=None, format=None, overwrite=False): 140 140 """\ … … 449 449 return workscan 450 450 451 @ print_log_dec451 @asaplog_post_dec 452 452 def stats(self, stat='stddev', mask=None, form='3.3f'): 453 453 """\ … … 780 780 return self._get_column(self._getdirectionvec, row) 781 781 782 @ print_log_dec782 @asaplog_post_dec 783 783 def set_unit(self, unit='channel'): 784 784 """\ … … 799 799 self._add_history("set_unit", varlist) 800 800 801 @ print_log_dec801 @asaplog_post_dec 802 802 def set_instrument(self, instr): 803 803 """\ … … 813 813 self._add_history("set_instument", vars()) 814 814 815 @ print_log_dec815 @asaplog_post_dec 816 816 def set_feedtype(self, feedtype): 817 817 """\ … … 826 826 self._add_history("set_feedtype", vars()) 827 827 828 @ print_log_dec828 @asaplog_post_dec 829 829 def set_doppler(self, doppler='RADIO'): 830 830 """\ … … 842 842 self._add_history("set_doppler", vars()) 843 843 844 @ print_log_dec844 @asaplog_post_dec 845 845 def set_freqframe(self, frame=None): 846 846 """\ … … 875 875 raise TypeError(msg) 876 876 877 @ print_log_dec877 @asaplog_post_dec 878 878 def set_dirframe(self, frame=""): 879 879 """\ … … 908 908 return unit 909 909 910 @ print_log_dec910 @asaplog_post_dec 911 911 def get_abcissa(self, rowno=0): 912 912 """\ … … 928 928 return abc, lbl 929 929 930 @ print_log_dec930 @asaplog_post_dec 931 931 def flag(self, mask=None, unflag=False): 932 932 """\ … … 946 946 self._add_history("flag", varlist) 947 947 948 @ print_log_dec948 @asaplog_post_dec 949 949 def flag_row(self, rows=[], unflag=False): 950 950 """\ … … 963 963 self._add_history("flag_row", varlist) 964 964 965 @ print_log_dec965 @asaplog_post_dec 966 966 def clip(self, uthres=None, dthres=None, clipoutside=True, unflag=False): 967 967 """\ … … 984 984 self._add_history("clip", varlist) 985 985 986 @ print_log_dec986 @asaplog_post_dec 987 987 def lag_flag(self, start, end, unit="MHz", insitu=None): 988 988 """\ … … 1024 1024 return s 1025 1025 1026 @ print_log_dec1026 @asaplog_post_dec 1027 1027 def create_mask(self, *args, **kwargs): 1028 1028 """\ … … 1348 1348 Scantable.shift_refpix(self, delta) 1349 1349 1350 @ print_log_dec1350 @asaplog_post_dec 1351 1351 def history(self, filename=None): 1352 1352 """\ … … 1390 1390 # Maths business 1391 1391 # 1392 @ print_log_dec1392 @asaplog_post_dec 1393 1393 def average_time(self, mask=None, scanav=False, weight='tint', align=False): 1394 1394 """\ … … 1443 1443 return s 1444 1444 1445 @ print_log_dec1445 @asaplog_post_dec 1446 1446 def convert_flux(self, jyperk=None, eta=None, d=None, insitu=None): 1447 1447 """\ … … 1477 1477 else: return s 1478 1478 1479 @ print_log_dec1479 @asaplog_post_dec 1480 1480 def gain_el(self, poly=None, filename="", method="linear", insitu=None): 1481 1481 """\ … … 1537 1537 return s 1538 1538 1539 @ print_log_dec1539 @asaplog_post_dec 1540 1540 def freq_align(self, reftime=None, method='cubic', insitu=None): 1541 1541 """\ … … 1567 1567 else: return s 1568 1568 1569 @ print_log_dec1569 @asaplog_post_dec 1570 1570 def opacity(self, tau=None, insitu=None): 1571 1571 """\ … … 1599 1599 else: return s 1600 1600 1601 @ print_log_dec1601 @asaplog_post_dec 1602 1602 def bin(self, width=5, insitu=None): 1603 1603 """\ … … 1623 1623 return s 1624 1624 1625 @ print_log_dec1625 @asaplog_post_dec 1626 1626 def resample(self, width=5, method='cubic', insitu=None): 1627 1627 """\ … … 1649 1649 else: return s 1650 1650 1651 @ print_log_dec1651 @asaplog_post_dec 1652 1652 def average_pol(self, mask=None, weight='none'): 1653 1653 """\ … … 1670 1670 return s 1671 1671 1672 @ print_log_dec1672 @asaplog_post_dec 1673 1673 def average_beam(self, mask=None, weight='none'): 1674 1674 """\ … … 1705 1705 self._add_history("parallactify", varlist) 1706 1706 1707 @ print_log_dec1707 @asaplog_post_dec 1708 1708 def convert_pol(self, poltype=None): 1709 1709 """\ … … 1722 1722 return s 1723 1723 1724 @ print_log_dec1724 @asaplog_post_dec 1725 1725 def smooth(self, kernel="hanning", width=5.0, order=2, plot=False, insitu=None): 1726 1726 """\ … … 1800 1800 else: return s 1801 1801 1802 @ print_log_dec1802 @asaplog_post_dec 1803 1803 def poly_baseline(self, mask=None, order=0, plot=False, uselin=False, 1804 1804 insitu=None): … … 2046 2046 return workscan 2047 2047 2048 @ print_log_dec2048 @asaplog_post_dec 2049 2049 def rotate_linpolphase(self, angle): 2050 2050 """\ … … 2067 2067 return 2068 2068 2069 @ print_log_dec2069 @asaplog_post_dec 2070 2070 def rotate_xyphase(self, angle): 2071 2071 """\ … … 2088 2088 return 2089 2089 2090 @ print_log_dec2090 @asaplog_post_dec 2091 2091 def swap_linears(self): 2092 2092 """\ … … 2099 2099 return 2100 2100 2101 @ print_log_dec2101 @asaplog_post_dec 2102 2102 def invert_phase(self): 2103 2103 """\ … … 2109 2109 return 2110 2110 2111 @ print_log_dec2111 @asaplog_post_dec 2112 2112 def add(self, offset, insitu=None): 2113 2113 """\ … … 2133 2133 return s 2134 2134 2135 @ print_log_dec2135 @asaplog_post_dec 2136 2136 def scale(self, factor, tsys=True, insitu=None): 2137 2137 """\ … … 2211 2211 self._add_history("set_sourcetype", varlist) 2212 2212 2213 @ print_log_dec2213 @asaplog_post_dec 2214 2214 @preserve_selection 2215 2215 def auto_quotient(self, preserve=True, mode='paired', verify=False): … … 2260 2260 return s 2261 2261 2262 @ print_log_dec2262 @asaplog_post_dec 2263 2263 def mx_quotient(self, mask = None, weight='median', preserve=True): 2264 2264 """\ … … 2289 2289 return q 2290 2290 2291 @ print_log_dec2291 @asaplog_post_dec 2292 2292 def freq_switch(self, insitu=None): 2293 2293 """\ … … 2311 2311 return s 2312 2312 2313 @ print_log_dec2313 @asaplog_post_dec 2314 2314 def recalc_azel(self): 2315 2315 """Recalculate the azimuth and elevation for each position.""" … … 2319 2319 return 2320 2320 2321 @ print_log_dec2321 @asaplog_post_dec 2322 2322 def __add__(self, other): 2323 2323 varlist = vars() … … 2332 2332 return s 2333 2333 2334 @ print_log_dec2334 @asaplog_post_dec 2335 2335 def __sub__(self, other): 2336 2336 """ … … 2348 2348 return s 2349 2349 2350 @ print_log_dec2350 @asaplog_post_dec 2351 2351 def __mul__(self, other): 2352 2352 """ … … 2365 2365 2366 2366 2367 @ print_log_dec2367 @asaplog_post_dec 2368 2368 def __div__(self, other): 2369 2369 """ … … 2383 2383 return s 2384 2384 2385 @ print_log_dec2385 @asaplog_post_dec 2386 2386 def get_fit(self, row=0): 2387 2387 """\ … … 2492 2492 return (sum(nchans)/len(nchans) == nchans[0]) 2493 2493 2494 @ print_log_dec2494 @asaplog_post_dec 2495 2495 def _fill(self, names, unit, average, getpt, antenna): 2496 2496 first = True
Note:
See TracChangeset
for help on using the changeset viewer.