Changeset 1779 for branches/mergetest/src/STWriter.cpp
- Timestamp:
- 07/29/10 19:13:46 (14 years ago)
- Location:
- branches/mergetest
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/mergetest
- Property svn:mergeinfo changed
-
branches/mergetest/src/STWriter.cpp
r1688 r1779 42 42 #include <atnf/PKSIO/PKSMS2writer.h> 43 43 #include <atnf/PKSIO/PKSSDwriter.h> 44 #include <atnf/PKSIO/SrcType.h> 44 45 45 46 #include <tables/Tables/Table.h> … … 154 155 havexpol(ifs[i]) = nPol(ifs[i]) > 2; 155 156 } 156 Vector<String> obstypes(2);157 obstypes(0) = "TR";//on158 obstypes(1) = "RF TR";//off157 // Vector<String> obstypes(2); 158 // obstypes(0) = "TR";//on 159 // obstypes(1) = "RF TR";//off 159 160 const Table table = inst->table(); 160 161 … … 182 183 while (!beamit.pastEnd() ) { 183 184 Table btable = beamit.table(); 185 //MDirection::ScalarColumn dirCol(btable, "DIRECTION"); 186 //pksrec.direction = dirCol(0).getAngle("rad").getValue(); 184 187 TableIterator cycit(btable, "CYCLENO"); 185 188 ROArrayColumn<Double> srateCol(btable, "SCANRATE"); … … 188 191 Vector<Float> srateflt(sratedbl.nelements()); 189 192 convertArray(srateflt, sratedbl); 190 pksrec.scanRate = srateflt; 193 //pksrec.scanRate = srateflt; 194 pksrec.scanRate = sratedbl; 191 195 ROArrayColumn<Double> spmCol(btable, "SRCPROPERMOTION"); 192 196 spmCol.get(0, pksrec.srcPM); … … 200 204 while (!cycit.pastEnd() ) { 201 205 Table ctable = cycit.table(); 202 TableIterator ifit(ctable, "IFNO" );206 TableIterator ifit(ctable, "IFNO", TableIterator::Ascending, TableIterator::HeapSort); 203 207 MDirection::ScalarColumn dirCol(ctable, "DIRECTION"); 204 208 pksrec.direction = dirCol(0).getAngle("rad").getValue(); … … 213 217 uInt nchan = specCol(0).nelements(); 214 218 Double crval,crpix; 219 //Vector<Double> restfreq; 215 220 Float tmp0,tmp1,tmp2,tmp3,tmp4; 216 String stmp0,stmp1; 221 String tcalt; 222 Vector<String> stmp0, stmp1; 217 223 inst->frequencies().getEntry(crpix,crval, pksrec.freqInc, 218 224 rec.asuInt("FREQ_ID")); … … 239 245 pksrec.fieldName = rec.asString("FIELDNAME"); 240 246 pksrec.srcName = rec.asString("SRCNAME"); 241 pksrec.obsType = obstypes[rec.asInt("SRCTYPE")]; 247 //pksrec.obsType = obstypes[rec.asInt("SRCTYPE")]; 248 pksrec.obsType = getObsTypes( rec.asInt("SRCTYPE") ) ; 242 249 pksrec.bandwidth = nchan * abs(pksrec.freqInc); 243 250 pksrec.azimuth = rec.asFloat("AZIMUTH"); … … 253 260 pksrec.baseSub = 0.0f; 254 261 pksrec.xCalFctr = 0.0; 262 pksrec.flagrow = rec.asuInt("FLAGROW"); 255 263 256 264 status = writer_->write(pksrec); … … 348 356 } 349 357 350 } 358 // get obsType string from SRCTYPE value 359 String STWriter::getObsTypes( Int srctype ) 360 { 361 String obsType ; 362 switch( srctype ) { 363 case Int(SrcType::PSON): 364 obsType = "PSON" ; 365 break ; 366 case Int(SrcType::PSOFF): 367 obsType = "PSOFF" ; 368 break ; 369 case Int(SrcType::NOD): 370 obsType = "NOD" ; 371 break ; 372 case Int(SrcType::FSON): 373 obsType = "FSON" ; 374 break ; 375 case Int(SrcType::FSOFF): 376 obsType = "FSOFF" ; 377 break ; 378 case Int(SrcType::SKY): 379 obsType = "SKY" ; 380 break ; 381 case Int(SrcType::HOT): 382 obsType = "HOT" ; 383 break ; 384 case Int(SrcType::WARM): 385 obsType = "WARM" ; 386 break ; 387 case Int(SrcType::COLD): 388 obsType = "COLD" ; 389 break ; 390 case Int(SrcType::PONCAL): 391 obsType = "PSON:CALON" ; 392 break ; 393 case Int(SrcType::POFFCAL): 394 obsType = "PSOFF:CALON" ; 395 break ; 396 case Int(SrcType::NODCAL): 397 obsType = "NOD:CALON" ; 398 break ; 399 case Int(SrcType::FONCAL): 400 obsType = "FSON:CALON" ; 401 break ; 402 case Int(SrcType::FOFFCAL): 403 obsType = "FSOFF:CALOFF" ; 404 break ; 405 case Int(SrcType::FSLO): 406 obsType = "FSLO" ; 407 break ; 408 case Int(SrcType::FLOOFF): 409 obsType = "FS:LOWER:OFF" ; 410 break ; 411 case Int(SrcType::FLOSKY): 412 obsType = "FS:LOWER:SKY" ; 413 break ; 414 case Int(SrcType::FLOHOT): 415 obsType = "FS:LOWER:HOT" ; 416 break ; 417 case Int(SrcType::FLOWARM): 418 obsType = "FS:LOWER:WARM" ; 419 break ; 420 case Int(SrcType::FLOCOLD): 421 obsType = "FS:LOWER:COLD" ; 422 break ; 423 case Int(SrcType::FSHI): 424 obsType = "FSHI" ; 425 break ; 426 case Int(SrcType::FHIOFF): 427 obsType = "FS:HIGHER:OFF" ; 428 break ; 429 case Int(SrcType::FHISKY): 430 obsType = "FS:HIGHER:SKY" ; 431 break ; 432 case Int(SrcType::FHIHOT): 433 obsType = "FS:HIGHER:HOT" ; 434 break ; 435 case Int(SrcType::FHIWARM): 436 obsType = "FS:HIGHER:WARM" ; 437 break ; 438 case Int(SrcType::FHICOLD): 439 obsType = "FS:HIGHER:COLD" ; 440 break ; 441 default: 442 obsType = "NOTYPE" ; 443 } 444 445 return obsType ; 446 } 447 448 }
Note:
See TracChangeset
for help on using the changeset viewer.