; pro dump ;Jan 29,90 KES, in=input unit ; fil=' ' read,'Supply file name',fil close,1 & close,3 openr,1,fil a=assoc(1,bytarr(1200)) ;EUV data format b=assoc(1,intarr(600)) ;Hdr data f/t openw,3,'dump.lis' printf,3,'This is a dump from data file',fil print,' Output is on file DUMP.LIS' ; read,'Want raw dump (=1), or only legit values (=0)',iwant if iwant eq 0 then goto,legit legit: m=0 ;only save non-filler values to print num_pts=fltarr(16000) ;store counting rates (= #cnts/rim) for i=4,16000,5 do begin ;one data between four AACS recs t=a(i) & tt=b(i) ;recal: t=byte, tt=integer printf,3,' Rec #',m print,' Rec #',m printf,3,'$(12i4,f10.1)',tt(0:11),(tt(12)*256.+tt(13)) ; printf,3,'$(24(2x,z2))',t(80:1199) ; print,'$(24(2x,z2))',t(80:1199) hold=bytarr(1105) ;for non-filler data from t(80:1171) ngood=0 ;non-filler index ibeg=80 & iend=1171 & j=ibeg ;check each byte loop: if j gt iend then goto,finis if t(j) eq 0 then goto,nextj ;skip zero (= gap) if t(j) eq 'FF'XB then goto,nextj ;filler, go around if t(j) eq '7E'XB then begin ;?start Rim packet if t(j+1) eq '7E'XB then goto,hkeep ; therefore H.Keeping end ;no,just another data if t(j) eq 'FE'XB then goto,spnpac ;Spin Packet if t(j) eq '7F'XB then goto,secros ;Sector Crossing hold(ngood)=t(j) ;save a data byte ngood=ngood+1 if t(j) .and. '80'XB then begin ;sector xing bit set num_sects=sum_sects+1 print,'sector Xing at j=',j end if ngood gt 1105 then begin ;exceeds array size print,'ngood error' stop end ; print,j,ngood,t(j) goto,nextj hkeep: print,'# sects last Rim=',num_sects ;how many last RIM num_sects=0 ;re-zero Rim=(t(j+3)*65536.)+(t(j+4)*256.)+t(j+5) ;Rim time Num_scan_sec=t(j+5) Num_sectors=t(j+6) print,'Rim, scans/sect, num_sects',rim,num_scan_sec,num_sectors iold=index_next_sib index_next_sib=t(j+7) if iold ne t(j+7)+1 print,'SIB index error:old,new',$ iold,index_next_sib sec_int_buf(index_next_sib)=(t(j+8)*256.)+t(j+9) print,'SIB at sector',sec_int_buf(index_next_sib),index_next_sib iold=index_next_wib index_next_wib=t(j+10) if iold ne t(j+10)+1 print,'WIB index error:old,new',$ iold,index_next_wib j=j+10 & goto,loop spnpac: wav_int_buf(index_next_wib)=(t(j+2)*256.)+t(j+1) ;stored backwd index_next_wib=index_next_buf+1 ;increm for next Mod91=t(j+3) & print,'Mod 91=',mod91 Mod10=t(j+4) & print,'Mod 10=',mod10 j=j+4 goto,loop secros: num_sects=num_sects+1 ;sect xing w/o data nextj: j=j+1 goto,loop ;ready for next byte num_pts(m)=ngood print,'ngood for rec',ngood,m if ngood gt 0 then printf,3,'$(25(2x,z2))',hold(0:ngood-1) goto,nextm nextm: m=m+1 ;end this rec end ;next rec close,3 stop end