Changeset 2019
- Timestamp:
- 03/01/11 17:13:36 (14 years ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/MSFiller.cpp
r2017 r2019 849 849 *polnoRF = polnos[ipol] ; 850 850 851 *spRF = sp.row( ipol ) ; 852 *ucarrRF = fl.row( ipol ) ; 853 *tsysRF = tsys.row( ipol ) ; 851 //*spRF = sp.row( ipol ) ; 852 //*ucarrRF = fl.row( ipol ) ; 853 //*tsysRF = tsys.row( ipol ) ; 854 spRF.define( sp.row( ipol ) ) ; 855 ucarrRF.define( fl.row( ipol ) ) ; 856 tsysRF.define( tsys.row( ipol ) ) ; 854 857 *tcalidRF = tcalids[ipol] ; 855 858 … … 1288 1291 for ( uInt ipol = 0 ; ipol < npol ; ipol++ ) { 1289 1292 *idRF = idx++ ; 1290 *tcalRF = subtcal.row( ipol ) ; 1293 //*tcalRF = subtcal.row( ipol ) ; 1294 tcalRF.define( subtcal.row( ipol ) ) ; 1291 1295 1292 1296 // commit row … … 1319 1323 // os_ << "start MSFiller::getWeatherId() startSec=" << startSec << LogIO::POST ; 1320 1324 uInt nrow = mwTime_.size() ; 1321 if ( nrow == 0)1325 if ( nrow < 2 ) 1322 1326 return 0 ; 1323 1327 uInt wid = nrow ; … … 1362 1366 if ( scTime.nelements() == 0 ) 1363 1367 return ; 1368 else if ( scTime.nelements() == 1 ) { 1369 tidx[0] = 0 ; 1370 return ; 1371 } 1364 1372 uInt scnrow = scTime.nelements() ; 1365 1373 uInt idx = 0 ; -
trunk/src/MSWriter.cpp
r2018 r2019 58 58 MSWriter::MSWriter(CountedPtr<Scantable> stable) 59 59 : table_(stable), 60 isTcal_(False), 61 isWeather_(False), 62 tcalSpec_(False), 63 tsysSpec_(False), 60 64 ptTabName_("") 61 65 { … … 134 138 135 139 // WEATHER 136 fillWeather() ; 140 if ( isWeather_ ) 141 fillWeather() ; 137 142 138 143 // MAIN … … 304 309 TableIterator iter5( t4, cols ) ; 305 310 while( !iter5.pastEnd() ) { 306 Table t5 = iter5.table() 311 Table t5 = iter5.table().sort("POLNO") ; 307 312 //sharedCol.attach( t5, "CYCLENO" ) ; 308 313 //uInt cycleNo = sharedCol.asuInt( 0 ) ; … … 324 329 Matrix<Float> dataArr( cellshape ) ; 325 330 Matrix<Bool> flagArr( cellshape ) ; 326 Vector<uChar> tmpUC ;327 331 Vector<Bool> tmpB ; 328 332 for ( Int ipol = 0 ; ipol < nrow ; ipol++ ) { 329 333 dataArr.row( ipol ) = specCol( ipol ) ; 330 tmpUC = flagCol( ipol ) ; 331 tmpB = flagArr.row( ipol ) ; 332 convertArray( tmpB, tmpUC ) ; 334 tmpB.reference( flagArr.row( ipol ) ) ; 335 convertArray( tmpB, flagCol( ipol ) ) ; 333 336 } 334 *(*((RecordFieldPtr< Array<Float> > *)dataRF)) = dataArr ; 337 //*(*((RecordFieldPtr< Array<Float> > *)dataRF)) = dataArr ; 338 ((RecordFieldPtr< Array<Float> > *)dataRF)->define( dataArr ) ; 335 339 336 340 // FLAG 337 *flagRF = flagArr ; 341 //*flagRF = flagArr ; 342 flagRF.define( flagArr ) ; 338 343 } 339 344 else if ( useData_ ) { … … 352 357 dataArr.row( 1 ) = RealToComplex( dummy ) ; 353 358 dataArr.row( 2 ) = conj( dataArr.row( 1 ) ) ; 354 *(*((RecordFieldPtr< Array<Complex> > *)dataRF)) = dataArr ; 359 //*(*((RecordFieldPtr< Array<Complex> > *)dataRF)) = dataArr ; 360 ((RecordFieldPtr< Array<Complex> > *)dataRF)->define( dataArr ) ; 355 361 356 362 357 363 // FLAG 358 364 Matrix<Bool> flagArr( cellshape ) ; 359 Matrix<uChar> tmpUC = flagCol( 0 ) ; 360 Matrix<Bool> tmpB = flagArr.row( 0 ) ; 361 convertArray( tmpB, tmpUC ) ; 362 tmpUC = flagCol( 3 ) ; 363 tmpB = flagArr.row( 3 ) ; 364 convertArray( tmpB, tmpUC ) ; 365 tmpUC = flagCol( 2 ) | flagCol( 3 ) ; 366 tmpB = flagArr.row( 1 ) ; 367 convertArray( tmpB, tmpUC ) ; 368 tmpB = flagArr.row( 2 ) ; 369 convertArray( tmpB, tmpUC ) ; 370 *flagRF = flagArr ; 365 Vector<Bool> tmpB ; 366 tmpB.reference( flagArr.row( 0 ) ) ; 367 convertArray( tmpB, flagCol( 0 ) ) ; 368 tmpB.reference( flagArr.row( 3 ) ) ; 369 convertArray( tmpB, flagCol( 3 ) ) ; 370 tmpB.reference( flagArr.row( 1 ) ) ; 371 convertArray( tmpB, ( flagCol( 2 ) | flagCol( 3 ) ) ) ; 372 flagArr.row( 2 ) = flagArr.row( 1 ) ; 373 //*flagRF = flagArr ; 374 flagRF.define( flagArr ) ; 371 375 } 372 376 373 377 // FLAG_ROW 374 378 // tcol = tpoolr->construct( t5, "FLAGROW" ) ; … … 380 384 // tpoolr->destroy( tcol ) ; 381 385 *flagrowRF = anyNE( flagRowArr, (uInt)0 ) ; 382 386 383 387 // TIME and TIME_CENTROID 384 388 // tcol = tpoolr->construct( t5, "TIME" ) ; … … 389 393 *timeRF = mTimeV ; 390 394 *timecRF = mTimeV ; 391 395 392 396 // INTERVAL and EXPOSURE 393 397 // tcol = tpoolr->construct( t5, "INTERVAL" ) ; … … 452 456 // FLAG_CATEGORY is tentatively set 453 457 RecordFieldPtr< Array<Bool> > flagcatRF( trec, "FLAG_CATEGORY" ) ; 454 *flagcatRF = Cube<Bool>( nrow, nchan, 1, False ) ; 458 //*flagcatRF = Cube<Bool>( nrow, nchan, 1, False ) ; 459 flagcatRF.define( Cube<Bool>( nrow, nchan, 1, False ) ) ; 455 460 456 461 // add row … … 494 499 495 500 // SYSCAL 496 fillSysCal() ; 501 if ( isTcal_ ) 502 fillSysCal() ; 497 503 498 504 // replace POINTING table with original one if exists … … 544 550 polType_ = "notype" ; 545 551 552 // Check if some subtables are exists 553 if ( table_->tcal().table().nrow() != 0 ) { 554 ROTableColumn col( table_->tcal().table(), "TCAL" ) ; 555 if ( col.isDefined( 0 ) ) { 556 os_ << "nrow=" << table_->tcal().table().nrow() << ": TCAL table exists" << LogIO::POST ; 557 isTcal_ = True ; 558 } 559 else { 560 os_ << "no TCAL rows" << LogIO::POST ; 561 } 562 } 563 else { 564 os_ << "no TCAL rows" << LogIO::POST ; 565 } 566 if ( table_->weather().table().nrow() != 0 ) { 567 ROTableColumn col( table_->weather().table(), "TEMPERATURE" ) ; 568 if ( col.isDefined( 0 ) ) { 569 os_ << "nrow=" << table_->weather().table().nrow() << ": WEATHER table exists" << LogIO::POST ; 570 isWeather_ =True ; 571 } 572 else { 573 os_ << "no WEATHER rows" << LogIO::POST ; 574 } 575 } 576 else { 577 os_ << "no WEATHER rows" << LogIO::POST ; 578 } 579 546 580 // Are TCAL_SPECTRUM and TSYS_SPECTRUM necessary? 547 tcalSpec_ = False ; 548 tsysSpec_ = False ; 549 if ( header_.nchan != 1 ) { 581 if ( isTcal_ && header_.nchan != 1 ) { 550 582 // examine TCAL subtable 551 583 Table tcaltab = table_->tcal().table() ; … … 859 891 860 892 // TRANSITION 861 *transitionRF = fMolName ; 893 //*transitionRF = fMolName ; 894 Vector<String> transition ; 895 if ( fMolName.size() != 0 ) { 896 transition = fMolName ; 897 } 898 else if ( molName.size() != 0 ) { 899 transition = molName ; 900 } 901 else { 902 transition.resize( numFreq ) ; 903 transition = "" ; 904 } 905 *transitionRF = transition ; 862 906 863 907 // SYSVEL … … 1129 1173 if ( tcalSpec_ ) { 1130 1174 // put TCAL_SPECTRUM 1131 *tcalspRF = tcal ; 1175 //*tcalspRF = tcal ; 1176 tcalspRF.define( tcal ) ; 1132 1177 // set TCAL (mean of TCAL_SPECTRUM) 1133 1178 Matrix<Float> tcalMean( npol, 1 ) ; … … 1145 1190 if ( tsysSpec_ ) { 1146 1191 // put TSYS_SPECTRUM 1147 *tsysspRF = tsys ; 1192 //*tsysspRF = tsys ; 1193 tsysspRF.define( tsys ) ; 1148 1194 // set TSYS (mean of TSYS_SPECTRUM) 1149 1195 Matrix<Float> tsysMean( npol, 1 ) ; … … 1342 1388 // only 1 POLARIZATION row for 1 scantable 1343 1389 if ( nrow > 0 ) 1344 return 1;1390 return 0 ; 1345 1391 1346 1392 Vector<Int> corrType = toCorrType( polnos ) ; -
trunk/src/MSWriter.h
r2018 r2019 91 91 casa::MeasurementSet *mstable_ ; 92 92 93 casa::Bool isTcal_ ; 94 casa::Bool isWeather_ ; 95 93 96 casa::Bool useFloatData_ ; 94 97 casa::Bool useData_ ; -
trunk/src/NROFiller.cpp
r1904 r2019 21 21 #include "STHeader.h" 22 22 #include <casa/Containers/Record.h> 23 #include <casa/Quanta/MVTime.h> 23 24 #include <atnf/PKSIO/SrcType.h> 24 25 … … 122 123 STHeader header = table_->getHeader() ; 123 124 String obsType = header.obstype.substr( 0, 3 ) ; 125 Vector<Float> defaultTcal( 1, 1.0 ) ; 126 String tcalTime = MVTime( header.utc ).string( MVTime::YMD ) ; 124 127 for ( Int irow = 0 ; irow < (Int)nRow ; irow++ ) { 125 128 // check scan intent … … 198 201 // TCAL subtable row 199 202 // use default since NRO input is calibrated data 200 setTcal( ) ;203 setTcal( tcalTime, defaultTcal ) ; 201 204 202 205
Note:
See TracChangeset
for help on using the changeset viewer.