; IDL program to animate SHEBA/SAR images. ; NOTE: See below for places where you need to edit file paths. ; Harry Stern / harry@apl.washington.edu / August 2, 2000 pro SARanimate ; This is the directory where the GIF images live base = '/home/username/SHEBA/SAR/images/' ; This is the file path and name of the LIST OF IMAGES image_table = '/home/username/SHEBA/SAR/image_table' ; Open the LIST OF IMAGES openr, lun, image_table, /get_lun ; These are the fields in the LIST OF IMAGES name=' ' & year=0 & dayofyear=0 & month=' ' & dayofmonth=0 & time=' ' lat=0.0 & lon=0.0 & x=0.0 & y=0.0 & inc_angle=0.0 ; Comment out one of these lines ;nframes = 195 ; to animate all frames nframes = 5 ; to animate first 5 frames only - for quicker testing bar = 24 ; size of annotation bar at bottom (pixels) image_size = 800 ; size of each image (pixels) fff = float(bar)/float(image_size+bar) xinteranimate, set=[image_size,image_size+bar,nframes], $ /showload, /track, title='SAR Animation' window, 10, xsize=image_size, ysize=image_size+bar loadct,0 ncolors = !d.table_size white = ncolors-1 black = 0 for i = 0, nframes-1 do begin ; Read one line from the LIST OF IMAGES readf, lun, name, year, dayofyear, month, dayofmonth, time, $ lat, lon, x, y, inc_angle, $ format='(a16,i5,i4,1x,a3,i3,1x,a8,f7.3,f9.3,f8.1,f8.1,f6.2)' read_gif, base+name+'cal_center.gif', a ; read GIF image a = (float(a) - 255.) * 0.1 ; convert to dB a = a + (inc_angle - 32.5) * 0.135 ; adjust to 32.5 inc angle a = bytscl(a, top=ncolors-1) ; scale from 0 to ncolors-1 erase, white ; white background tv, a, 0, bar ; display image ; Establish coordinate system for placing annotation plot,[0,1],[0,1],/normal,/nodata,/noerase,$ xmargin=[0,0],xrange=[0,1],xstyle=1+4+8,$ ymargin=[0,0],yrange=[0,1],ystyle=1+4+8,$ position=[0,fff,1,1] ; Date and time - lower left corner s = string(year, month, dayofmonth, time, format='(i4,2x,a,1x,i2,2x,a)') xyouts, 0.01, 0.006, s, /normal, charsize=2.0, color=black ; Copyright notice - lower right corner s = string('Copyright CSA', year, format='(a,1x,i4)') xyouts, 0.99, 0.01, s, /normal, align=1, charsize=1.2, color=black xinteranimate, frame=i, window=10 endfor free_lun, lun xinteranimate, 5 ; 0 slowest, 100 fastest, can also adjust with slider end