      subroutine ReimtoHg(xx,x1)
!将同相/异相幅值转换为振幅/迟角
	  integer::nn,i,j
	  real*8::xx(2),x1(2),pi,RAD
!---------------------------------------------------------------------
      pi=datan(1.d0)*4.d0;RAD=pi/180.d0
      x1(1)=dsqrt(xx(1)**2+xx(2)**2)
      if(x1(1)<1.d-16)then
        x1(2)=0.d0;goto 901
      endif
      x1(1)=dsqrt(xx(2)**2+xx(1)**2)
      x1(2)=datan(xx(2)/xx(1))/RAD
      if(xx(1)>0.and.xx(2)<0)x1(2)=x1(2)+360.d0
      if(xx(1)<0)x1(2)=x1(2)+180.d0
901   return
      end
