C+ C NAME: C smei_frm_fts_eph C PURPOSE: C Process ephemeris related entries in SMEI header C CALLING SEQUENCE: subroutine smei_frm_fts_eph(iU,hdr) C INPUTS: C iU integer logical unit number of open Fits file C hdr(*) double precision SMEI header array C OUTPUTS: C C hdr(SMEI__HDR_ECLIPSE) C hdr(SMEI__HDR_SHADOW) C filled by calls to smei_eclipse C (but still need to be written to Fits file by C a subsequent call to smei_frm_fts_base C (where they are incorporated into the C SMEI__HDR_FLAGS entry). C INCLUDE: include 'smei_frm_hdr.h' C CALLS: C smei_hdr_eph, smei_eclipse, FTUKYD, say_fts C smei_hdr_time C PROCEDURE: C Unit vectors for Sun, Moon, and Venus in the UCSD camera frame C are calculated and written into the open Fits file. C The Fits update functions FTUK* are used because this routine is C used both to create the original Fits file and to update them. C (there do not seem to be update routines for arrays of C parameter values, so we use the update function TPUK* for C each individual element). C MODIFICATION HISTORY: C MAR-2005, Paul Hick (UCSD/CASS; pphick@ucsd.edu) C- integer iU double precision hdr(*) character cSay*16 /'smei_frm_fts_eph'/ character cSeverity /'E'/ integer tt(2) double precision rx double precision ry double precision rz double precision rr(3) equivalence (rx,rr(1)) equivalence (ry,rr(2)) equivalence (rz,rr(3)) logical smei_hdr_eph logical smei_eclipse istat = 0 ! The directions to Sun, Moon and Venus are topocentric, i.e. the spacecraft ! location is taken into account using the closest (in time) available ! Coriolis orbital elements. ! Unit vector for Sun in UCSD camera frame ! Replaces SMEI__HDR_SUN, SMEI__HDR_SUN+1, SMEI__HDR_SUN+2 if (.not. smei_hdr_eph(hdr,2,0,rx,ry,rz)) & call Say(cSay,'E','Sun','ephemeris error') call FTUKYD(iU,'SUN1',rx,7,'Sun, unit vector in UCSD cam frame', istat) if (istat .ne. 0) call say_fts(cSay,cSeverity,istat) call FTUKYD(iU,'SUN2',ry,7,'Sun, unit vector in UCSD cam frame', istat) if (istat .ne. 0) call say_fts(cSay,cSeverity,istat) call FTUKYD(iU,'SUN3',rz,7,'Sun, unit vector in UCSD cam frame', istat) if (istat .ne. 0) call say_fts(cSay,cSeverity,istat) !call FTPKND(iU,'SUN',1,3,rr,7,'Sun, unit vector in UCSD cam frame&', istat) !if (istat .ne. 0) call say_fts(cSay,cSeverity,istat) ! Unit vector for Moon in UCSD camera frame ! Replaces SMEI__HDR_MOON, SMEI__HDR_MOON+1, SMEI__HDR_MOON+2 if (.not. smei_hdr_eph(hdr,2,10,rx,ry,rz)) & call Say(cSay,'E','Moon','ephemeris error') call FTUKYD(iU,'MOON1',rx,7,'Moon, unit vector in UCSD cam frame', istat) if (istat .ne. 0) call say_fts(cSay,cSeverity,istat) call FTUKYD(iU,'MOON2',ry,7,'Moon, unit vector in UCSD cam frame', istat) if (istat .ne. 0) call say_fts(cSay,cSeverity,istat) call FTUKYD(iU,'MOON3',rz,7,'Moon, unit vector in UCSD cam frame', istat) if (istat .ne. 0) call say_fts(cSay,cSeverity,istat) !call FTPKND(iU,'MOON',1,3,rr,7,'Moon, unit vector in UCSD cam frame&', istat) !if (istat .ne. 0) call say_fts(cSay,cSeverity,istat) ! Unit vector for Venus in UCSD camera frame if (.not. smei_hdr_eph(hdr,2,2,rx,ry,rz)) & call Say(cSay,'E','Venus','ephemeris error') call FTUKYD(iU,'VENUS1',rx,7,'Venus, unit vector in UCSD cam frame', istat) if (istat .ne. 0) call say_fts(cSay,cSeverity,istat) call FTUKYD(iU,'VENUS2',ry,7,'Venus, unit vector in UCSD cam frame', istat) if (istat .ne. 0) call say_fts(cSay,cSeverity,istat) call FTUKYD(iU,'VENUS3',rz,7,'Venus, unit vector in UCSD cam frame', istat) if (istat .ne. 0) call say_fts(cSay,cSeverity,istat) !call FTPKND(iU,'VENUS',1,3,rr,7,'Venus, unit vector in UCSD cam frame&', istat) !if (istat .ne. 0) call say_fts(cSay,cSeverity,istat) call smei_hdr_time(hdr, tt) if (smei_eclipse(tt,10,fraction)) then hdr(SMEI__HDR_ECLIPSE) = 1 ! Eclipse by Moon else hdr(SMEI__HDR_ECLIPSE) = 0 end if if (smei_eclipse(tt, 3,fraction)) then hdr(SMEI__HDR_SHADOW) = 1 ! Eclipse by Earth? else hdr(SMEI__HDR_SHADOW) = 0 end if return end