;;;;; Annotates chip gif files close,1 MyU = 14 filenm=' ' ftype=' ' doColor=1 ;; Dont use red color table if ==0 doanno=1 ;; Dont write out the annotation if ==0 wrtgif=1 ;; Dont write out the gif file if ==0 seegif=0 ;; See the gif file if ==1 adjgif=1 ;; Adjust gif image levels if ==1 !order=0 xdim=1024 ydim=1024 set_plot,'z' device,set_resolution=[xdim,ydim],set_colors=256,z_buffering=0 print,' ' print,' ' print,'Routine: AnnoChipGif.pro ',systime() if( n_elements(listfile) eq 0) then begin ;{ listfile=' ' print,$ 'Enter in a filename that contains a list of images to annotate.' print,'The list should include the entire path to the images.' read,listfile endif $ else begin ;}{ print,' ' print,'Your present listfile is: ',listfile print,'To change it, enter the idl command: listfile=''newone''' print,'Where ''newone'' is an example new list file. ' print,' ' endelse;} print,' ' print,'The images listed in file: ',listfile,' will now be converted.' print,' ' print,' ' daytab=intarr(13,2) daytab=[[0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ], $ [0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ]] montab=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'] imontb=['01_','02_','03_','04_','05_','06_','07_','08_','09_','10_','11_','12_'] close,MyU & openr,MyU,listfile while ( not eof(MyU) ) do begin ;{ readf,MyU,filenm read_gif,filenm,gif,_a,_b,_c tvlct,_a,_b,_c print,'Image presently displayed is: ',filenm year=fix(strmid(filenm,0,2)) if ( year gt 50 ) then year = year + 1900 else year = year + 2000 year = strcompress(string(year),/remove_all) iyr=fix(year) hr=strmid(filenm,9,2) & mn =strmid(filenm,12,2) & sec=strmid(filenm,15,2) time=hr+':'+mn +':'+sec +' UT' ccol = 255 leap=long((iyr mod 4 eq 0) and (iyr mod 100 ne 0) or (iyr mod 400 eq 0)) m=fix(strmid(filenm,3,2)) m=m-1 & if(m lt 0) then m=0 month=strlowcase(montab(m)) imonth=imontb(m) iday=fix(strmid(filenm,6,2)) doy = iday for ii=0,m do doy = doy + daytab(ii,leap) cday = strcompress(string(iday),/remove_all) if( iday lt 10) then $ date = '0' + cday +' '+montab(m)+' '+year $ else date = cday +' '+montab(m)+' '+year if ( doy lt 10 ) then Fdoy = '00'+ strcompress(string(doy)) $ else if( doy lt 100 ) then Fdoy = '0' + strcompress(string(doy)) $ else Fdoy = '' + strcompress(string(doy)) Fdoy=strcompress(Fdoy,/remove_all) if ( doy lt 10 ) then doy = 'DOY '+ strcompress(string(doy)) $ else if( doy lt 100 ) then doy = 'DOY ' + strcompress(string(doy)) $ else doy = 'DOY' + strcompress(string(doy)) if(adjgif eq 1) then begin ;{ old = gif llm = 60 & ulm = 70 & uulm = 240 aa=where(old gt uulm) if(aa(0) ne -1)then old(aa) = 0 aa=0 aa=where((old gt llm) and (old lt ulm)) if(aa(0) ne -1)then old(aa) = llm aa=0 aa=where (old ge ulm) if(aa(0) ne -1)then old(aa) = old(aa)-(ulm-llm) aa=0 gif=old endif ;} if(doColor eq 1) then begin;{ openr,11,'/project/mlso/idl/chipres.rgb' _a=bytarr(256) & _b=bytarr(256) & _c=bytarr(256) readu,11,_a & readu,11,_b & readu,11,_c & close,11 tvlct,_a,_b,_c endif;} erase,0 tv,gif if(doanno eq 1) then begin ;{ Bsz=1.4 Lsz=1.15 Dsz=1.0 xyouts, 5, 5,'Helium I -- raw data', size=Lsz,/dev,color=ccol xstrt=xdim-2*xdim/512 strt= ydim-10*ydim/512 del = 17 xyouts, 5, strt-del*0,'MLSO/HAO/PICS' , size=Bsz,/dev,color=ccol xyouts,xstrt,strt-del*0,date,size=Lsz,/dev,color=ccol,align=1.0 xyouts,xstrt,strt-del*1,doy, size=Lsz,/dev,color=ccol,align=1.0 xyouts,xstrt,strt-del*2,time,size=Lsz,/dev,color=ccol,align=1.0 xyouts,xdim/2-1,ydim-7*ydim/512,'North', size=Dsz,/dev,color=ccol,align=0.5 xyouts, 10,ydim/2-1,'East', size=Dsz,/dev,color=ccol,align=0.5,orien=90 xyouts,xstrt,ydim/2-1,'West', size=Dsz,/dev,color=ccol,align=0.5,orien=90 endif;} zzz=tvrd() if(wrtgif eq 1)then write_gif,filenm,zzz,_a,_b,_c if(seegif eq 1) then begin;{ set_plot,'x' tvlct,_a,_b,_c tv,zzz cursor,_x,_y print,min(zzz),max(zzz) set_plot,'z' device,set_resolution=[xdim,ydim],set_colors=256,z_buffering=0 endif;} endwhile ;} close,MyU end