Changes in trunk/src/PKSFiller.cpp [1832:1916]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/PKSFiller.cpp
r1832 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 25 #include <casa/Containers/Record.h> 24 26 #include <measures/Measures/MDirection.h> 25 27 #include <measures/Measures/MeasConvert.h> … … 34 36 35 37 #include <time.h> 38 #include <sstream> 36 39 37 40 #include "STDefs.h" … … 58 61 } 59 62 60 bool PKSFiller::open( const std::string& filename )63 bool PKSFiller::open( const std::string& filename, const Record& rec) 61 64 { 62 65 Bool haveBase, haveSpectra; … … 74 77 Vector<uInt> nchans,npols; 75 78 76 String antenna("0"); 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 } 77 101 78 102 reader_ = getPKSreader(inName, antenna, 0, 0, format, beams, ifs, … … 146 170 Vector<Int> start(nIF_, 1); 147 171 Vector<Int> end(nIF_, 0); 148 Bool getPt = False;149 172 reader_->select(beams, ifs, start, end, ref, True, haveXPol_[0], False, getPt); 150 173 setHeader(header); … … 263 286 Int match = pksrec.srcName.matches(rx); 264 287 std::string srcname; 288 Int srctype = Int(SrcType::NOTYPE); 265 289 if (match) { 266 290 srcname = pksrec.srcName; 291 srctype = Int(SrcType::PSOFF); 267 292 } else { 268 293 srcname = pksrec.srcName.before(rx2); 269 }270 Int srctype = match;271 if ( pksrec.srcType != -1) {294 srctype = Int(SrcType::PSON); 295 } 296 if ( pksrec.srcType != Int(SrcType::NOTYPE)) { 272 297 srctype = pksrec.srcType ; 273 298 }
Note:
See TracChangeset
for help on using the changeset viewer.