PRO IM_ROT,az,el,ra,RA1,RA2,t1,t2,t3
; Gives the image rotation as a function of telescope
; coordinates and observation table at the Swedish Solar
; Observatory, La Palma.
; Looking at the projected primary image the rotation is
; clockwise during the morning up the meridian passage
; and then counterclockwise during the afternoon.
; Input parameters: AZ azimuth of Sun in radians
; EL elevation of Sun in radians
; TC table constant in radians
; a constant depending on which observation
; table is used. TC is about 48 to give
; the angle between the table surface
; and the N-S direction at the first
; observation table.
; Output parameter: RA rotation angle in radians
; Adapted from Goran Hosinsky
LAT=28.758*!dtor ;observatory latitude (La Palma)
TC=318.0*!dtor ;table constant
; According to spherical astronomy the angle between the N-S
; great circle and the vertical great circle in an AZ-EL
; telescope varies as:
t1=((EL-LAT)/2.0)
t2=((!pi-EL-LAT)/2.0)
t3=tan(0.5*(!pi-AZ))
t3=t3<1.E20
ra1=atan(cos(t1)/cos(t2),t3)+atan(sin(t1)/sin(t2),t3)
; In the image plane the angle of the movement in Elevation
; varies as:
ra2=AZ+(atan(cos(EL),sin(EL)))+TC
RA=ra2-ra1
END