;;;;; Annotates both disk and limb pics gif files close,1 MyU = 13 filenm=' ' ftype=' ' 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 !order=0 xdim=1024 ydim=1024 set_plot,'z' device,set_resolution=[xdim,ydim],set_colors=256,z_buffering=0 print,' ' print,' ' print,'Routine: AnnoPicsGif.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) foundit=strpos(filenm,'alr') isdisk=0 islimb=0 if(foundit gt 0) then begin ;{ islimb=1 ccol = 20 endif else begin ;}{ isdisk=1 ccol = 255 endelse ;} time=hr+':'+mn +' UT' ;; No seconds for PICS 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 = montab(m) + ' ' + cday +', '+year $ ;else date = montab(m) + cday +', '+year 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)) erase,0 tv,gif if(doanno eq 1) then begin ;{ if(isdisk) then begin ;{ ;; Get rid of saturated pixels around the edges that result from ;; pangle correction. if(gif(256,40) eq 255) then begin ;{ CLOUDS ccol = 0 endif else begin ;}{ bgif=gif & bgif(*,*)=255 & bgif(60:511-60,60:511-60)=0 bad = where( (gif eq 255) and (bgif eq 255) ) if(bad(0) ne -1 ) then gif(bad)=0 endelse ;} erase,0 tv,gif endif;} Bsz=1.4 Lsz=1.15 Dsz=1.0 if(isdisk)then MyLab='Halpha disk -- raw data' if(islimb)then MyLab='Halpha limb -- raw data' xyouts, 5, 5,MyLab, 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