Changeset 720 for trunk/python
- Timestamp:
- 11/18/05 11:16:23 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/asapmath.py
r710 r720 1 1 from scantable import scantable 2 2 from asap import rcParams 3 from asap import print_log 3 4 4 5 def average_time(*args, **kwargs): … … 11 12 scanav: True averages each scan separately. 12 13 False (default) averages all scans together, 13 weight: Weighting scheme. 'none, 'var' (1/var(spec) 14 weight: Weighting scheme. 'none, 'var' (1/var(spec) 14 15 weighted), 'tsys' (1/Tsys**2 weighted), 'tint' 15 (integration time weighted) or 'tintsys' (Tsys 16 (integration time weighted) or 'tintsys' (Tsys 16 17 and tint). The default is 'tint' 17 18 Example: … … 39 40 else: 40 41 lst = tuple(args) 41 42 42 43 del varlist["kwargs"] 43 44 varlist["args"] = "%d scantables" % len(lst) 44 45 # need special formatting her for history... 45 46 46 47 from asap._asap import average as _av 47 48 for s in lst: 48 49 if not isinstance(s,scantable): 49 print "Please give a list of scantables" 50 return 50 msg = "Please give a list of scantables" 51 if rcParams['verbose']: 52 print msg 53 return 54 else: 55 raise TypeError(msg) 51 56 s = scantable(_av(lst, mask, scanAv, weight)) 52 57 s._add_history("average_time",varlist) 58 print_log() 53 59 return s 54 60 … … 62 68 source: the 'on' scan 63 69 reference: the 'off' scan 64 preserve: you can preserve (default) the continuum or 65 remove it. The equations used are 66 67 70 preserve: you can preserve (default) the continuum or 71 remove it. The equations used are 72 preserve: Output = Toff * (on/off) - Toff 73 remove: Output = Toff * (on/off) - Ton 68 74 """ 69 75 varlist = vars() … … 71 77 s = scantable(_quot(source, reference, preserve)) 72 78 s._add_history("quotient",varlist) 79 print_log() 73 80 return s 74 81 75 82 def simple_math(left, right, op='add', tsys=True): 76 83 """ 77 Apply simple mathematical binary operations to two 84 Apply simple mathematical binary operations to two 78 85 scan tables, returning the result in a new scan table. 79 86 The operation is applied to both the correlations and the TSys data … … 88 95 varlist = vars() 89 96 if not isinstance(left,scantable) and not isinstance(right,scantable): 90 print "Please provide two scantables as input" 91 return 97 msg = "Please provide two scantables as input" 98 if rcParams['verbose']: 99 print msg 100 return 101 else: 102 raise TypeError(msg) 92 103 from asap._asap import b_operate as _bop 93 104 s = scantable(_bop(left, right, op, tsys)) 94 105 s._add_history("simple_math", varlist) 106 print_log() 95 107 return s 96 97
Note:
See TracChangeset
for help on using the changeset viewer.