Changeset 2252 for trunk/external-alma
- Timestamp:
- 07/28/11 16:20:38 (13 years ago)
- Location:
- trunk/external-alma/asdm2ASAP
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/external-alma/asdm2ASAP/ASDMReader.cc
r2251 r2252 9 9 #include <measures/Measures/MeasConvert.h> 10 10 #include <casa/Logging/LogMessage.h> 11 #include <casa/BasicSL/Constants.h> 11 12 12 13 #include "ASDMReader.h" … … 1011 1012 SourceRow *srow = asdm_->getSource().getRowByKey( sid, tint, spwtag ) ; 1012 1013 vector<Angle> srcdir = srow->getDirection() ; 1014 dir[0] = limitedAngle( srcdir[0].get() ) ; 1015 dir[1] = limitedAngle( srcdir[1].get() ) ; 1013 1016 if ( srow->isDirectionCodeExists() ) { 1014 1017 DirectionReferenceCode dircode = srow->getDirectionCode() ; 1018 //logsink_->postLocally( LogMessage("dircode="+CDirectionReferenceCode::toString(dircode),LogOrigin(className_,funcName,WHERE)) ) ; 1015 1019 if ( dircode != J2000 ) { 1016 1020 // if not J2000, need direction conversion 1017 } 1018 } 1019 dir[0] = srcdir[0].get() ; 1020 dir[1] = srcdir[1].get() ; 1021 string ref = CDirectionReferenceCode::toString( dircode ) ; 1022 double mjd = vmsData_->v_time[index] * s2d ; 1023 Tag atag( antennaId_, TagType::Antenna ) ; 1024 AntennaRow *arow = asdm_->getAntenna().getRowByKey( atag ) ; 1025 StationRow *srow = arow->getStationUsingStationId() ; 1026 vector<Length> antposL = srow->getPosition() ; 1027 casa::Vector<casa::Double> antpos( 3 ) ; 1028 for ( int i = 0 ; i < 3 ; i++ ) 1029 antpos[i] = antposL[i].get() ; 1030 dir = toJ2000( dir, ref, mjd, antpos ) ; 1031 } 1032 } 1021 1033 } 1022 1034 return dir ; … … 1048 1060 ref = CDirectionReferenceCode::toString( srow->getDirectionCode() ) ; 1049 1061 } 1050 dir[0] = srcdir[0].get() ;1051 dir[1] = srcdir[1].get() ;1062 dir[0] = limitedAngle( srcdir[0].get() ) ; 1063 dir[1] = limitedAngle( srcdir[1].get() ) ; 1052 1064 } 1053 1065 } … … 1739 1751 String funcName = "toJ2000" ; 1740 1752 1741 // casa::Vector<casa::Double> azel( 2 ) ;1742 // azel[0] = az ;1743 // azel[1] = el ;1744 // casa::MEpoch me( casa::Quantity( (casa::Double)mjd, "d" ), casa::MEpoch::UTC ) ;1745 // casa::Vector<casa::Quantity> qantpos( 3 ) ;1746 // qantpos[0] = casa::Quantity( antpos[0], "m" ) ;1747 // qantpos[1] = casa::Quantity( antpos[1], "m" ) ;1748 // qantpos[2] = casa::Quantity( antpos[2], "m" ) ;1749 // casa::MPosition mp( casa::MVPosition( qantpos ),1750 // casa::MPosition::ITRF ) ;1751 // //ostringstream oss ;1752 // //mp.print( oss ) ;1753 // //logsink_->postLocally( LogMessage(oss.str(),LogOrigin(className_,funcName,WHERE)) ) ;1754 1755 // casa::MeasFrame mf( me, mp ) ;1756 // casa::MDirection::Convert toj2000( casa::MDirection::AZELGEO,1757 // casa::MDirection::Ref( casa::MDirection::J2000, mf ) ) ;1758 // casa::Vector<casa::Double> cdir = toj2000( azel ).getAngle( "rad" ).getValue() ;1759 // //logsink_->postLocally( LogMessage("cdir = "+String::toString(cdir),LogOrigin(className_,funcName,WHERE)) ) ;1760 // dir.resize(2) ;1761 // dir[0] = (double)(cdir[0]) ;1762 // dir[1] = (double)(cdir[1]) ;1763 1753 vector<double> azel( 2 ) ; 1764 1754 azel[0] = az ; … … 1924 1914 return row ; 1925 1915 } 1916 1917 double ASDMReader::limitedAngle( double angle ) 1918 { 1919 if ( angle > C::pi ) 1920 while ( angle > C::pi ) angle -= C::_2pi ; 1921 else if ( angle < -C::pi ) 1922 while ( angle < -C::pi ) angle += C::_2pi ; 1923 return angle ; 1924 } -
trunk/external-alma/asdm2ASAP/ASDMReader.h
r2251 r2252 548 548 **/ 549 549 asdm::SysCalRow *getSysCalRow( unsigned int idx ) ; 550 551 /** 552 * limit angule in radian within [-pi,pi] 553 * 554 * @param any angule in radian 555 * @return equivalent angle that satisfies [-pi,pi] 556 **/ 557 double limitedAngle( double angle ) ; 550 558 551 559 asdm::ASDM *asdm_ ; // pointer to ASDM object
Note:
See TracChangeset
for help on using the changeset viewer.