;docformat = 'rst' ;+ ;This function returns a quaternion which tranforms a vector in camera ;coordinates into abn equivalent vector in S/C coordinates. ; ; :Author: ; Chris Jeppesen: 06-29-2005 ; ; :Examples: ; IDL> print,quat_vect_mult(CAM2SC(pxcaminfo),[0,0,1]) ;Calculate boresight vector of camera 0 in S/C coordinates ; ; 0.62932038 0.00000000 0.77714594 ;- ;+ ; :Params: ; caminfo : in , required, type=caminfo structure ; Camera information structure for the correct camera. ; ; :Returns: ; Returns a quaternion to transform the vector. ;- function cam_to_sc,caminfo ;Always apply barrel twist first result=QuatX(3,caminfo.angle3) ;Then apply the smaller of the two other rotations, then the larger if caminfo.angle1 lt caminfo.angle2 then begin result=combine_rotation(result,quatx(1,caminfo.angle1)) result=combine_rotation(result,quatx(2,caminfo.angle2)) end else begin result=combine_rotation(result,quatx(2,caminfo.angle2)) result=combine_rotation(result,quatx(1,caminfo.angle1)) end return,result end