C+ C NAME: C smei_skyd_checkpix C PURPOSE: C Check location of pixel against reference camera frame C defining a great circle on the sky defining at the seam C between start and end of orbit C CATEGORY: C camera/for/sky C CALLING SEQUENCE: logical function smei_skyd_checkpix(pfov,runit,qq_cam2cam_edge) C INPUTS: C pfov integer linear array index into CCD frame C runit(*) double precision C unit vector in current camera frame C qq_cam2cam_edge(*) C double precision C quaternion that rotates vectors from C current camera frame to reference frame C OUTPUTS: C smei_skyd_checkpix C logical see Procedure C CALLS: C quaternion_rotate_xyz C PROCEDURE: C The camera frame has z-axis along the optical axis, x-axis C along the long dimension of the fov, and y-axis along the C narrow dimension such that y increases with decreasing radius C on the CCD. Stars travel in the direction of decreasing y; C frames sweep the sky in the direction of increasing y. C C The reference camera frame is defined by the nominal viewing C direction of camera 2 at the start of an orbit. The long C dimension of camera 2 defines a reference circle that is used C separate start and end of orbit. C C If a pixel in any frame near start or end of the orbit has C a negative y than it is traveling towards the reference C circle; if it has positive y it is traveling away from it. C C For frames near the start of an orbit negative y C (smei_skyd_checkpix=.FALSE.) means the pixel is part of the C previous orbit; positive y (smei_skyd_checkpix=.TRUE.) C means the pixel is part of the current orbit. C C For frames near the end of an orbit negative y C (smei_skyd_checkpix=.FALSE.) means the pixel is still in the C current orbit; positive y (smei_skyd_checkpix=.TRUE.) C means the pixel is part of the next orbit. C MODIFICATION HISTORY: C OCT-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu) C- integer pfov double precision runit(*) double precision qq_cam2cam_edge(*) double precision rx double precision ry double precision rz ! Unit vector in camera frame rx = runit(1) ry = runit(2) rz = runit(3) !dval = dsqrt(rx*rx+ry*ry+rz*rz) !rx = rx/dval !ry = ry/dval !rz = rz/dval ! Rotate to camera 2 frame at start of orbit. call quaternion_rotate_xyz(qq_cam2cam_edge,rx,ry,rz) smei_skyd_checkpix = ry .ge. 0.0d0 return end