Changeset 1684
- Timestamp:
- 02/04/10 20:42:12 (15 years ago)
- Location:
- branches/alma
- Files:
-
- 3 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: -
branches/alma/src/STFiller.cpp
r1683 r1684 75 75 nreader_(0) 76 76 { 77 open(filename, whichIF, whichBeam);77 open(filename, "", whichIF, whichBeam); 78 78 } 79 79 … … 82 82 close(); 83 83 } 84 85 void STFiller::open( const std::string& filename, int whichIF, int whichBeam, casa::Bool getPt )84 85 void STFiller::open( const std::string& filename, const std::string& antenna, int whichIF, int whichBeam, casa::Bool getPt ) 86 86 { 87 87 if (table_.null()) { … … 122 122 // 123 123 124 if ( (reader_ = getPKSreader(inName, 0, 0, format, beams, ifs,124 if ( (reader_ = getPKSreader(inName, antenna, 0, 0, format, beams, ifs, 125 125 nchans, npols, haveXPol_,haveBase, haveSpectra 126 126 )) == 0 ) { -
branches/alma/src/STFiller.h
r1603 r1684 76 76 * @exception AipsError Creation of PKSreader failed 77 77 */ 78 void open( const std::string& filename, int whichIF=-1, int whichBeam=-1, casa::Bool getPt=casa::False );78 void open( const std::string& filename, const std::string& antenna, int whichIF=-1, int whichBeam=-1, casa::Bool getPt=casa::False ); 79 79 80 80 /**
Note:
See TracChangeset
for help on using the changeset viewer.