Changeset 1916 for trunk/python
- Timestamp:
- 08/30/10 19:13:04 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/scantable.py
r1909 r1916 82 82 83 83 @asaplog_post_dec 84 def __init__(self, filename, average=None, unit=None, getpt=None, 85 antenna=None, parallactify=None): 84 #def __init__(self, filename, average=None, unit=None, getpt=None, 85 # antenna=None, parallactify=None): 86 def __init__(self, filename, average=None, unit=None, parallactify=None, **args): 86 87 """\ 87 88 Create a scantable from a saved one or make a reference … … 117 118 if average is None: 118 119 average = rcParams['scantable.autoaverage'] 119 if getpt is None:120 getpt = True121 if antenna is not None:122 asaplog.push("Antenna selection currently unsupported."123 "Using ''")124 asaplog.post('WARN')125 if antenna is None:126 antenna = ''127 elif type(antenna) == int:128 antenna = '%s' % antenna129 elif type(antenna) == list:130 tmpstr = ''131 for i in range( len(antenna) ):132 if type(antenna[i]) == int:133 tmpstr = tmpstr + ('%s,'%(antenna[i]))134 elif type(antenna[i]) == str:135 tmpstr=tmpstr+antenna[i]+','136 else:137 raise TypeError('Bad antenna selection.')138 antenna = tmpstr.rstrip(',')120 #if getpt is None: 121 # getpt = True 122 #if antenna is not None: 123 # asaplog.push("Antenna selection currently unsupported." 124 # "Using ''") 125 # asaplog.post('WARN') 126 #if antenna is None: 127 # antenna = '' 128 #elif type(antenna) == int: 129 # antenna = '%s' % antenna 130 #elif type(antenna) == list: 131 # tmpstr = '' 132 # for i in range( len(antenna) ): 133 # if type(antenna[i]) == int: 134 # tmpstr = tmpstr + ('%s,'%(antenna[i])) 135 # elif type(antenna[i]) == str: 136 # tmpstr=tmpstr+antenna[i]+',' 137 # else: 138 # raise TypeError('Bad antenna selection.') 139 # antenna = tmpstr.rstrip(',') 139 140 parallactify = parallactify or rcParams['scantable.parallactify'] 140 141 varlist = vars() … … 160 161 # and not os.path.exists(filename+'/table.f1'): 161 162 elif is_ms(filename): 162 self._fill([filename], unit, average, getpt, antenna) 163 # Measurement Set 164 opts={'ms': {}} 165 mskeys=['getpt','antenna'] 166 for key in mskeys: 167 if key in args.keys(): 168 opts['ms'][key] = args[key] 169 #self._fill([filename], unit, average, getpt, antenna) 170 self._fill([filename], unit, average, opts) 163 171 elif os.path.isfile(filename): 164 self._fill([filename], unit, average, getpt, antenna) 172 #self._fill([filename], unit, average, getpt, antenna) 173 self._fill([filename], unit, average) 165 174 else: 166 175 msg = "The given file '%s'is not a valid " \ … … 169 178 elif (isinstance(filename, list) or isinstance(filename, tuple)) \ 170 179 and isinstance(filename[-1], str): 171 self._fill(filename, unit, average, getpt, antenna) 180 #self._fill(filename, unit, average, getpt, antenna) 181 self._fill(filename, unit, average) 172 182 self.parallactify(parallactify) 173 183 self._add_history("scantable", varlist) … … 2663 2673 2664 2674 @asaplog_post_dec 2665 def _fill(self, names, unit, average, getpt, antenna): 2675 #def _fill(self, names, unit, average, getpt, antenna): 2676 def _fill(self, names, unit, average, opts={}): 2666 2677 first = True 2667 2678 fullnames = [] … … 2683 2694 msg = "Importing %s..." % (name) 2684 2695 asaplog.push(msg, False) 2685 opts = {'ms': {'antenna' : antenna, 'getpt': getpt} }2696 #opts = {'ms': {'antenna' : antenna, 'getpt': getpt} } 2686 2697 r.open(name, opts)# antenna, -1, -1, getpt) 2687 2698 r.fill()
Note:
See TracChangeset
for help on using the changeset viewer.