function oc_x2f_rotmat, ra, dec ;+ ; NAME: ; oc_x2f_rotmat ; PURPOSE: (one line) ; Return the matrix for rotating XYZ to FGH ; DESCRIPTION: ; Return the matrix for rotating XYZ to FGH ; CATEGORY: ; Occultations ; CALLING SEQUENCE: ; R = oc_x2f_rotmat(ra, dec) ; INPUTS: ; ra - right ascension of occultation star in radians ; dec - declination of occultation star in radians ; OPTIONAL INPUT PARAMETERS: ; none ; KEYWORD INPUT PARAMETERS: ; none ; KEYWORD OUTPUT PARAMETERS: ; none ; OUTPUTS: ; R - rotation matrix for rotating an XYZ vector to FGH ; XYZ are defined in the usual manner ; X = cos(ra_s) cos(dec_s) ; Y = sin(ra_s) cos(dec_s) ; Z = sin(dec_s) ; ; FGH are defined as in Elliot et al. 1993. Astron. J. 106, 2544-2572 ; H is toward the occultation star ; F is perpendicular to H and Z (Z x H) ; G completes the right hand system ; COMMON BLOCKS: ; None ; SIDE EFFECTS: ; RESTRICTIONS: ; None ; PROCEDURE: ; The function returns the matrix ; -sin(ra) cos(ra) 0 ; -cos(ra) sin(dec) -sin(ra) sin(dec) cos(dec) ; cos(ra) cos(dec) sin(ra) cos(dec) sin(dec) ; ; USE: ; The matrix is defined so that ; fgh = R ## xyz ; fgh, xyz column vectors ; where fgh and xyz are column vectors (Array[1,3]) and ## is the ; IDL operator for ordinary matrix multiplication (inner product). ; It is usually more convenient to use xyz and fgh as row vectors ; (Array[3]). In this case we have ; fgh = transpose(R) # xyz ; fgh, xyz row vectors ; ; MODIFICATION HISTORY: ; 2005 Aug 19 Leslie A Young SwRI ; 2005 Dec 28, LAY. ; Added documentation, added function to $layoung/oc/. ;- sa = sin(double(ra)) ca = cos(double(ra)) sd = sin(double(dec)) cd = cos(double(dec)) rotmat = [ [-sa, ca, 0], [-ca*sd, -sa*sd, cd], [ca*cd, sa*cd, sd] ] return, rotmat end