; A procedure to re-merge Saturn merge data file M236.V2 with new ; C_smithed geometry from FP2144_SAT_CS.FOT. Assumes files open ; already with 1=M236 and 2=FOT while ASSOC is assigned as 1=A,2=B. ; Sept 11, 1990 ; edited Sept 12,90 to include input file info and make Non-smithed version < ; edited Sept 17,90 to correct record # =mbeg for start of N/S Map ;<< ; MBEG & MEND are M236 beg/end recs; FBEG & FEND are for .FOT C=2.^16. ;adjust .FOT FDS value CLOSE,1 & OPENR,1,'DISKG:[MERGES]M236.V2' ;< A=ASSOC(1,FLTARR(650)) ;< MBEG=21 & MEND=789 ;< PRINT,'M236 file Beg, End=',A(8,MBEG),A(9,MBEG),A(8,MEND),A(9,MEND) ;< read,'Want C_Smithed (=0) or Non-Smithed (=1)',choose ;<< CLOSE,2 if choose eq 0 then OPENR,2,'diskg:[GEOM]FP2144_SAT_CS.FOT' ;<< if choose eq 1 then OPENR,2,'diskg:[GEOM]FP2140_SAT_NONCS.FOT';<< B=ASSOC(2,FLTARR(160)) ;< FBEG=0 & FEND=3076 ;< PRINT,'FOT file Beg,End=',B(6,FBEG)+C,B(7,FBEG),B(6,FEND)+C,B(7,FEND) ;< ;the new merge file CLOSE,3 if choose eq 0 then OPENW,3,'M236_NEW_CS.V2',650*4 ;<< if choose eq 1 then OPENW,3,'M236_NON_CS.V2',650*4 ;<< NEW_NS=ASSOC(3,FLTARR(650)) M=0 ;count output recs ;<< FOR m=0,mbeg-1 DO new_ns(m)=fltarr(650) ;zero fill early recs J=FBEG ;first Foot rec (=:001) LOOP: FOR I=MBEG,MEND DO BEGIN OLD=A(I) ;orig merge array if I eq 654 then j=j-4 ;repeat rec time RETRY: FOOT=B(J) ;get next .FOT set print,'old,fot=',i,j,old(8),foot(6)+c,old(9),foot(7) IF(OLD(8) EQ FOOT(6)+C) AND (OLD(9) EQ FOOT(7)) THEN BEGIN ;timematch NEW=FLTARR(650) ;ZERO FILL NEW(0)=OLD(0:399) ;orig data, PV,NAV ;; NEW(600)=OLD(600:649) ;orig analysis params ;;EMPTY FOR JJ=0,3 DO BEGIN ;accum @12s Foot set FOOT=B(J+JJ) TEMP=FLTARR(50) ;temp holding TEMP(0)=FOOT(0:7) ;times Y,D,H,M,S,MSEC,FDS1,FDS2 TEMP(8)=OLD(400+49+(JJ*50));was ID; now=orig Chi TEMP(9)=FOOT(65) ;motion TEMP(10)=FOOT(40:43) ;sub-solar lat,lon; sub-s/c lat,lon TEMP(14)=FOOT(59) ;optic axis cone TEMP(15)=FOOT(66) ;clock TEMP(16)=FOOT(68) ;slant range TEMP(17)=FOOT(69:72) ;optic axis lat,lon,incid,emiss TEMP(21)=FOOT(75:76) ;az in plane tang to surf... TEMP(23)=FOOT(80) ;pt of Closest approach TEMP(24)=FOOT(73) ;pict.bod interc.phase TEMP(25)=FOOT(79) ;pict.bod interc.local hr ang TEMP(26)=FOOT(37) ;rang, s/c to central bod TEMP(27)=FOOT(11:14) ;time to/from peri,cart pos s/c-c.bod TEMP(31)=FOOT(46:54) ;transform matrix TEMP(40)=FOOT(21:23) ;cart.vec earth, s/c cent TEMP(46)=FOOT(33) ;rang, cent.bod to sun TEMP(47)=FOOT(82) ;rang, cent.bod cent to ring interc TEMP(48)=FOOT(85) ;ring interc pt emission ang TEMP(49)=FOOT(92) ;ring interc pt local hr ang NEW(400+(JJ*50))=TEMP ;new FOOT values for :001+(200*JJ) END ;12s*4 loop NEW_NS(M)=NEW & M=M+1 ;write it out J=J+4 ;pt to next .FOT rec IF J GE FEND THEN GOTO,FINIS GOTO,NEXT ;ready for next orig rec END ;matched time loop J=J+1 ;if no time match, inc .FOT to skip data gap GOTO,RETRY ;try time match again NEXT: DUM=0 END ;main loop on merge recs FINIS: PRINT,'FINISHED, RECORDS OUTPUT=',M-1 ;all done STOP END