Changeset 1684 for branches/alma/python
- Timestamp:
- 02/04/10 20:42:12 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/alma/python/scantable.py
r1681 r1684 12 12 """ 13 13 14 def __init__(self, filename, average=None, unit=None, getpt=None ):14 def __init__(self, filename, average=None, unit=None, getpt=None, antenna=None): 15 15 """ 16 16 Create a scantable from a saved one or make a reference … … 39 39 if getpt is None: 40 40 getpt = True 41 if antenna is None: 42 antenna = '' 43 elif type(antenna) == int: 44 antenna = '%s'%antenna 45 elif type(antenna) == list: 46 tmpstr = '' 47 for i in range( len(antenna) ): 48 if type(antenna[i]) == int: 49 tmpstr = tmpstr + ('%s,'%(antenna[i])) 50 elif type(antenna[i]) == str: 51 tmpstr=tmpstr+antenna[i]+',' 52 else: 53 asaplog.push('Bad antenna selection.') 54 print_log('ERROR') 55 return 56 antenna = tmpstr.rstrip(',') 41 57 varlist = vars() 42 58 from asap._asap import stmath … … 80 96 raise IOError(msg) 81 97 else: 82 self._fill([filename], unit, average, getpt )98 self._fill([filename], unit, average, getpt, antenna) 83 99 elif (isinstance(filename, list) or isinstance(filename, tuple)) \ 84 100 and isinstance(filename[-1], str): 85 self._fill(filename, unit, average, getpt )101 self._fill(filename, unit, average, getpt, antenna) 86 102 self._add_history("scantable", varlist) 87 103 print_log() … … 2164 2180 return (sum(nchans)/len(nchans) == nchans[0]) 2165 2181 2166 def _fill(self, names, unit, average, getpt ):2182 def _fill(self, names, unit, average, getpt, antenna): 2167 2183 import os 2168 2184 from asap._asap import stfiller … … 2192 2208 asaplog.push(msg, False) 2193 2209 print_log() 2194 r._open(name, -1, -1, getpt)2210 r._open(name, antenna, -1, -1, getpt) 2195 2211 r._read() 2196 2212 if average:
Note:
See TracChangeset
for help on using the changeset viewer.