Changeset 2262 for branches/parallel/external-alma/atnf/PKSIO/NROReader.cc
- Timestamp:
- 08/04/11 12:58:21 (13 years ago)
- Location:
- branches/parallel
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/parallel
- Property svn:mergeinfo changed
/trunk merged: 2154,2156,2198-2203,2212,2261
- Property svn:mergeinfo changed
-
branches/parallel/external-alma
- Property svn:mergeinfo changed
/trunk/external-alma merged: 2154,2156,2198,2200-2203,2212,2261
- Property svn:mergeinfo changed
-
branches/parallel/external-alma/atnf/PKSIO/NROReader.cc
r1868 r2262 39 39 #include <atnf/PKSIO/ASTEDataset.h> 40 40 41 #include <measures/Measures/MEpoch.h> 42 #include <measures/Measures/MPosition.h> 41 43 #include <measures/Measures/MDirection.h> 42 44 #include <measures/Measures/MCDirection.h> 45 #include <measures/Measures/MeasFrame.h> 43 46 #include <measures/Measures/MeasConvert.h> 44 47 … … 314 317 //<< srcra << "," << srcdec << ") B1950 to (" 315 318 //<< v( 0 ) << ","<< v( 1 ) << ") J2000" << endl ; 316 os << LogIO::NORMAL << "SRCDIRECTION convert from ("317 << srcra << "," << srcdec << ") B1950 to ("318 << v( 0 ) << ","<< v( 1 ) << ") J2000" << LogIO::POST ;319 //os << LogIO::NORMAL << "SRCDIRECTION convert from (" 320 // << srcra << "," << srcdec << ") B1950 to (" 321 // << v( 0 ) << ","<< v( 1 ) << ") J2000" << LogIO::POST ; 319 322 } 320 323 else if ( strncmp( epoch, "J2000", 5 ) == 0 ) { … … 353 356 //<< dirx << "," << diry << ") LB to (" 354 357 //<< v( 0 ) << ","<< v( 1 ) << ") RADEC" << endl ; 355 os << LogIO::NORMAL << "DIRECTION convert from ("356 << dirx << "," << diry << ") LB to ("357 << v( 0 ) << ","<< v( 1 ) << ") RADEC" << LogIO::POST ;358 //os << LogIO::NORMAL << "DIRECTION convert from (" 359 // << dirx << "," << diry << ") LB to (" 360 // << v( 0 ) << ","<< v( 1 ) << ") RADEC" << LogIO::POST ; 358 361 } 359 362 else if ( icoord == 2 ) { 360 363 // convert from AZEL to RADEC 364 vector<double> antpos = getAntennaPosition() ; 365 Vector<Quantity> qantpos( 3 ) ; 366 for ( int ip = 0 ; ip < 3 ; ip++ ) 367 qantpos[ip] = Quantity( antpos[ip], "m" ) ; 368 Double scantime = Double( dataset_->getScanTime( i ) ) ; 369 MEpoch me( Quantity( scantime, "d" ), MEpoch::UTC ) ; 370 MPosition mp( MVPosition( qantpos ), MPosition::ITRF ) ; 371 MeasFrame mf( me, mp ) ; 361 372 MDirection result = 362 373 MDirection::Convert( MDirection( Quantity( dirx, "rad" ), 363 374 Quantity( diry, "rad" ), 364 375 MDirection::Ref( MDirection::AZEL ) ), 365 MDirection::Ref( MDirection::J2000 ) ) () ;376 MDirection::Ref( MDirection::J2000, mf ) ) () ; 366 377 v = result.getAngle().getValue() ; 367 378 //cout << "NROReader::getDirection() DIRECTION convert from (" 368 379 //<< dirx << "," << diry << ") AZEL to (" 369 380 //<< v( 0 ) << ","<< v( 1 ) << ") RADEC" << endl ; 370 os << LogIO::NORMAL << "DIRECTION convert from ("371 << dirx << "," << diry << ") AZEL to ("372 << v( 0 ) << ","<< v( 1 ) << ") RADEC" << LogIO::POST ;381 //os << LogIO::NORMAL << "DIRECTION convert from (" 382 // << dirx << "," << diry << ") AZEL to (" 383 // << v( 0 ) << ","<< v( 1 ) << ") RADEC" << LogIO::POST ; 373 384 } 374 385 else if ( icoord == 0 ) { … … 387 398 //<< dirx << "," << diry << ") B1950 to (" 388 399 //<< v( 0 ) << ","<< v( 1 ) << ") J2000" << endl ; 389 os << LogIO::NORMAL << "DIRECTION convert from ("390 << dirx << "," << diry << ") B1950 to ("391 << v( 0 ) << ","<< v( 1 ) << ") J2000" << LogIO::POST ;400 //os << LogIO::NORMAL << "DIRECTION convert from (" 401 // << dirx << "," << diry << ") B1950 to (" 402 // << v( 0 ) << ","<< v( 1 ) << ") J2000" << LogIO::POST ; 392 403 } 393 404 else if ( strncmp( epoch, "J2000", 5 ) == 0 ) { … … 441 452 //cout << "antpos = " << antpos << endl ; 442 453 string eq = dataset_->getEPOCH() ; 443 if ( eq.compare( 0, 5, "B1950" ) == 0 ) 444 equinox = 1950.0 ; 445 else if ( eq.compare( 0, 5, "J2000" ) == 0 ) 446 equinox = 2000.0 ; 454 // if ( eq.compare( 0, 5, "B1950" ) == 0 ) 455 // equinox = 1950.0 ; 456 // else if ( eq.compare( 0, 5, "J2000" ) == 0 ) 457 // equinox = 2000.0 ; 458 // equinox is always 2000.0 459 equinox = 2000.0 ; 447 460 //cout << "equinox = " << equinox << endl ; 448 461 string vref = dataset_->getVREF() ; … … 456 469 } 457 470 //freqref = vref ; 458 freqref = "LSRK" ; 471 //freqref = "LSRK" ; 472 freqref = "REST" ; 459 473 //cout << "freqref = " << freqref << endl ; 460 474 NRODataRecord *record = dataset_->getRecord( 0 ) ; … … 483 497 //cout << "poltype = " << poltype << endl ; 484 498 485 vector<Bool> ifs = getIFs() ; 486 nif = ifs.size() ; 499 //vector<Bool> ifs = getIFs() ; 500 //nif = ifs.size() ; 501 nif = getNumIF() ; 487 502 //cout << "nif = " << nif << endl ; 488 503 489 vector<Bool> beams = getBeams() ; 490 nbeam = beams.size() ; 504 //vector<Bool> beams = getBeams() ; 505 //nbeam = beams.size() ; 506 nbeam = getNumBeam() ; 491 507 //cout << "nbeam = " << nbeam << endl ; 492 508 … … 505 521 uInt &scanno, 506 522 uInt &cycleno, 523 uInt &ifno, 507 524 uInt &beamno, 508 525 uInt &polno, … … 548 565 //cout << "cycleno = " << cycleno << endl ; 549 566 550 // beamno 551 string arryt = string( record->ARRYT ) ; 552 string sbeamno = arryt.substr( 1, arryt.size()-1 ) ; 553 uInt ibeamno = atoi( sbeamno.c_str() ) ; 554 beamno = ibeamno - 1 ; 567 // beamno and ifno 568 string rxname = dataset_->getRX()[0] ; 569 if ( rxname.find("MULT2") != string::npos ) { 570 string arryt = string( record->ARRYT ) ; 571 beamno = dataset_->getArrayId( arryt ) ; 572 ifno = 0 ; 573 } 574 else { 575 beamno = 0 ; 576 string arryt = string( record->ARRYT ) ; 577 ifno = dataset_->getArrayId( arryt ) ; 578 } 555 579 //cout << "beamno = " << beamno << endl ; 556 580 … … 575 599 576 600 // scantime 577 scantime = Double( dataset_->getStartIntTime( irow ) ) ; 601 //scantime = Double( dataset_->getStartIntTime( irow ) ) ; 602 scantime = Double( dataset_->getScanTime( irow ) ) ; 578 603 //cout << "scantime = " << scantime << endl ; 579 604
Note: See TracChangeset
for help on using the changeset viewer.