- Timestamp:
- 08/30/10 19:13:04 (14 years ago)
- Location:
- trunk
- Files:
-
- 2 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() -
trunk/src/PKSFiller.cpp
r1904 r1916 20 20 #include <casa/Arrays/ArrayLogical.h> 21 21 #include <casa/Utilities/Regex.h> 22 #include <casa/Utilities/DataType.h> 22 23 #include <casa/Logging/LogIO.h> 23 24 … … 35 36 36 37 #include <time.h> 38 #include <sstream> 37 39 38 40 #include "STDefs.h" … … 76 78 77 79 String antenna(""); 80 Bool getPt = False; 81 82 // parsing MS options 83 if ( rec.isDefined( "ms" ) ) { 84 Record msrec = rec.asRecord( "ms" ) ; 85 //msrec.print( cout ) ; 86 if ( msrec.isDefined( "getpt" ) ) { 87 getPt = msrec.asBool( "getpt" ) ; 88 } 89 if ( msrec.isDefined( "antenna" ) ) { 90 if ( msrec.type( msrec.fieldNumber( "antenna" ) ) == TpInt ) { 91 Int antInt = msrec.asInt( "antenna" ) ; 92 ostringstream oss ; 93 oss << antInt ; 94 antenna = String( oss ) ; 95 } 96 else { 97 antenna = msrec.asString( "antenna" ) ; 98 } 99 } 100 } 78 101 79 102 reader_ = getPKSreader(inName, antenna, 0, 0, format, beams, ifs, … … 147 170 Vector<Int> start(nIF_, 1); 148 171 Vector<Int> end(nIF_, 0); 149 Bool getPt = False;150 172 reader_->select(beams, ifs, start, end, ref, True, haveXPol_[0], False, getPt); 151 173 setHeader(header);
Note:
See TracChangeset
for help on using the changeset viewer.