PRO PLOT_HIRESWND line='' top=4.5 speed1 = fltarr(120317.) min_color=16 num_colors=48 fname = findfile('915_20070806_hrw.dat') if fname(0) ne -1 then begin for j=0,n_elements(fname)-1 do begin ;plot_fname = strmid(fname(j),0,strlen(fname(j))-4)+'srel.ps' plot_start = var_to_dt(strmid(fname(j),strlen(fname(j))-16,4),strmid(fname(j),strlen(fname(j))-12,2),$ strmid(fname(j),strlen(fname(j))-10,2),20,00,00) ; plot_stop = dt_add(plot_start,hour=1) plot_stop = var_to_dt(strmid(fname(j),strlen(fname(j))-16,4),strmid(fname(j),strlen(fname(j))-12,2),$ strmid(fname(j),strlen(fname(j))-10,2),23,59,59) ;stop openr,fnum,fname(j),/get_lun set_plot,'ps' ;************** xdim=10. ; in inches ydim=7.5 ; in inches xoffset=0;(8.5-height)/2. yoffset=0;11. ;plot_fname=strmid(fname(j),0,strlen(fname(j))-3)+'ps' plot_fname=strmid(fname(j),0,strlen(fname(j))-4)+'_srelnew.ps' ;**************** print,'Plotting '+plot_fname+'...' set_plot,'ps' set_plot,'ps' tvlct,r,g,b,/get CREATE_COLOR_TABLE,r,g,b rot_barb=0 cnum=15 backnum=0 device,/inches,xoffset=xoffset,yoffset=yoffset,$ xsize=xdim,ysize=ydim,/color,bits_per_pixel=8,$ filename=plot_fname,/portrait,/encapsulated !p.position = [0,0,1,1] plot,[0,1],[0,1],/nodata,xstyle=5,ystyle=5,color=cnum polyfill,[0,0,1,1],[0,1,1,0],color=backnum !P.position=[0,0,0,0] !p.region=[0.05,.15,.95,.95] plot,[plot_start,plot_stop],[0,top],/nodata,color=cnum,$ ;plot,[0630,0700],[0,top],/nodata,color=15,$ ticklen=-.015, charsize=1, charthick=3, ystyle=5,xstyle=5,$ yrange=[0,top], xtitle='Time (UTC)',ytitle='Altitude (km)',$ title='Winds',max_levels=2,start_level=1,$ xticks=4,xminor=5,yticks=6,yticklen=.5,gridstyle=3,/noerase first_time = 1 data=0 w=0 count = -1L while not EOF(fnum) do begin if first_time or string(data(0)) eq '$' then begin count=count+1 readf,fnum,line tmp_date = strsplit(strcompress(line),' ') dt_struc = str_to_dt(tmp_date(0),tmp_date(1),date_fmt=1,time_fmt=-1) for c=0,1 do readf,fnum,line ;south_beam = strpos(line,'183') > strpos(line,'187') > strpos(line,'186') ;east_beam = strpos(line,'93') > strpos(line,'97') > strpos(line,'96') ;if count mod 4 eq 0 then print,tmp_date(1),beam_stuff ;readf,fnum,line az1 = fix(strmid(line,15,3)) az2 = fix(strmid(line,41,3)) ;stop for c=0,3 do readf,fnum,line data=strsplit(strcompress(line),' ') first_time=0 endif else begin bad = where(data eq 'nan') if bad(0) ge 0 then begin data(bad)='-999' endif if az1 eq 271 and data(6) gt -15 and data(7) gt -15 and data(8) gt -15 and data(1) ge 0 and data(2) gt 0 and dt_struc.julian ge plot_start.julian $ and dt_struc.julian le plot_stop.julian and data(0)/1000. le top then begin;and ((az1 eq 333 and az2 eq 243) or (az1 eq 243 and az2 eq 333)) then begin;and count mod 4 eq 0 then begin; and south_beam(0) ne -1 and east_beam(0) ne -1 then begin ucomp = float(data(1))*cos(!dtor*(270.-float(data(2)))) vcomp = float(data(1))*sin(!dtor*(270.-float(data(2)))) env_d = 0. env_s = 0 uenv_s = env_s*cos(!dtor*(270.-env_d)) venv_s = env_s*sin(!dtor*(270.-env_d)) ucomp = ucomp-uenv_s vcomp = vcomp-venv_s speed = sqrt(ucomp^2+vcomp^2) dir = 270.-(atan(vcomp,ucomp))*!radeg mod 360 ;wind_barbs,float(data(1)),float(data(2)),rot_barb ;if ucomp lt 0 then dir = 270 else dir = 90 ;speed = abs(ucomp) wind_barbs,speed,dir,rot_barb usersym,rot_barb(0,*),rot_barb(1,*),thick=2. ;if dt_struc.hour eq 23 and dt_struc.minute gt 10 then stop ;oplot,[dt_struc.julian-!pdt.dt_offset(0),dt_struc.julian-!pdt.dt_offset(0)],[0,top],color=15 ;if speed lt 90. then $ plots,dt_struc.julian-!pdt.dt_offset(0),data(0)/1000.,psym=8,symsize=.2,color=16+nint(speed*1.94/6.) ;else plots,dt_struc.julian-!pdt.dt_offset(0),data(0)/1000.,psym=8,symsize=.2,color=15 ;+nint(data(1)*1.94/4.) endif ;else if (count mod 2) eq 0 then print,data readf,fnum,line data=strsplit(strcompress(line),' ') endelse endwhile print, max(speed1) free_lun,fnum plot,[plot_start,plot_stop],[0,top],/nodata,color=cnum,$ ticklen=-.015, charsize=1, charthick=3, ystyle=1,xstyle=1,$ yrange=[0,top], xtitle='Time (UTC)',ytitle='Altitude (km)',$ title='Winds',max_levels=2,start_level=1,/noerase,$ xticks=4,xminor=5,yticks=6,yticklen=.5,gridstyle=3 ; plot legend underneath ;plot cloud base data ; read_cb,cb_data ; good = where(cb_data.cb1 ge 0.) ; max_cb = cb_data(good).cb1 > cb_data(good).cb2 > cb_data(good).cb3 ; max_cb = smooth(max_cb,21) ; min_cb = smooth(cb_data(good).cb1,21) ; cb_dt = cb_data(good).dt ; oplot,cb_dt,min_cb,color=0,thick=3 ; oplot,cb_dt,max_cb,color=0,thick=3 !p.region=[0.66,.08,.99,.13] plot,[16,41],[0,1],xrange=[16,41],/nodata,/noerase,color=15,$ ticklen=1,charsize=1,xstyle=1,ystyle=1,charthick=1,$ xticks=1,xtickname=[' ',' '], $ yticks=1,ytickname=[' ',' '] for i=16,40 do polyfill,[i,i+1,i+1,i],[0.0,0.0,1,1],color=i plot,[16,40],[0,1],xrange=[16,40],/nodata,/noerase,color=15,$ ticklen=.1,charsize=1,xstyle=1,ystyle=5,charthick=1,$ xticks=1,xtickname=[' ',' '], $ yticks=1,ytickname=[' ',' '] xyouts,(40+16)/2.,2.5,'Wind Speed (kts)',align=.5,$ charsize=1.5,charthick=2,color=15 color_numbers=[16,19.5,23.5,27.5,31.5,35.5,39.5] color_legend =['0','10','20','30','40','50','60'] for i=0,n_elements(color_numbers)-1 do $ xyouts,color_numbers(i),1.5,color_legend(i),align=0.5,charsize=1.5,$ charthick=2,color=15,/data plot,[16,41],[0,1],xrange=[16,41],/nodata,/noerase,color=15,$ ticklen=1,charsize=1,xstyle=1,ystyle=1,charthick=1,$ xticks=1,xtickname=[' ',' '], $ yticks=1,ytickname=[' ',' '] device,/close print,'converting '+plot_fname+' to '+strmid(plot_fname,0,strlen(plot_fname)-2)+'jpg...' spawn,'convert '+plot_fname+' '+strmid(plot_fname,0,strlen(plot_fname)-2)+'jpg' endfor endif stop END ;****************************************************************** PRO WIND_BARBS, speed, theta, rot_barb ;****************************************************************** speed=speed*1.94 CASE 1 OF ;1-2kts (speed lt 2.5): Begin x=[0,0] y=[0,10] END ;3-7kts (speed lt 7.5): Begin x=[0,0,2.5,0, 0] y=[0,8, 8,8,10] END ;8-12 kts (speed lt 12.5): Begin x=[0, 0, 5, 0] y=[0,10,10,10] END ;13-17kts (speed lt 17.5): Begin x=[0,0,2.5,0, 0, 5] y=[0,9, 9,9,10,10] END ;18-22kts (speed lt 22.5): Begin x=[0,0,5,0, 0, 5] y=[0,9,9,9,10,10] END ;23-27kts (speed lt 27.5): Begin x=[0,0,2.5,0,0,5,0, 0, 5] y=[0,8, 8,8,9,9,9,10,10] END ;28-32kts (speed lt 32.5): Begin x=[0,0,5,0,0,5,0, 0, 5] y=[0,8,8,8,9,9,9,10,10] END ;33-37kts (speed lt 37.5): Begin x=[0,0,2.5,0,0,5,0,0,5,0, 0, 5] y=[0,7, 7,7,8,8,8,9,9,9,10,10] END ;38-42kts (speed lt 42.5): Begin x=[0,0,5,0,0,5,0,0,5,0, 0, 5] y=[0,7,7,7,8,8,8,9,9,9,10,10] END ;43-47kts (speed lt 47.5): Begin x=[0,0,2.5,0,0,5,0,0,5,0,0,5,0, 0, 5] y=[0,6, 6,6,7,7,7,8,8,8,9,9,9,10,10] END ;48-52kts (speed lt 52.5): Begin x=[0, 0, 5, 0, 0] y=[0,8.5,10,10,8.5] END ;53-57kts (speed lt 57.5): Begin x=[0,0,2.5,0, 0,5,0, 0] y=[0,8, 8,8,8.5,10,10,8.5] END ;58-62kts (speed lt 62.5): Begin x=[0,0,5,0, 0, 5, 0, 0] y=[0,8,8,8,8.5,10,10,8.5] END ;63-67kts (speed lt 67.5): Begin x=[0,0,2.5,0,0,5,0, 0, 5, 0, 0] y=[0,7, 7,7,8,8,8,8.5,10,10,8.5] END ;68-72kts (speed lt 72.5): Begin x=[0,0,5,0,0,5,0, 0, 5, 0, 0] y=[0,7,7,7,8,8,8,8.5,10,10,8.5] END ;73-77kts (speed lt 77.5): Begin x=[0,0,2.5,0,0,5,0,0,5,0, 0, 5, 0, 0] y=[0,6, 6,6,7,7,7,8,8,8,8.5,10,10,8.5] END ;78-82kts (speed lt 82.5): Begin x=[0,0,5,0,0,5,0,0,5,0, 0, 5, 0, 0] y=[0,6,6,6,7,7,7,8,8,8,8.5,10,10,8.5] END ;83-87kts (speed lt 87.5): Begin x=[0,0,2.5,0,0,5,0,0,5,0,0,5,0, 0, 5, 0, 0] y=[0,5, 5,5,6,6,6,7,7,7,8,8,8,8.5,10,10,8.5] END ;88-92kts (speed lt 92.5): Begin x=[0,0,5,0,0,5,0,0,5,0,0,5,0, 0, 5, 0, 0] y=[0,5,5,5,6,6,6,7,7,7,8,8,8,8.5,10,10,8.5] END ;93-97kts (speed lt 97.5): Begin x=[0,0,2.5,0,0,5,0,0,5,0,0,5,0,0,5,0, 0, 5, 0, 0] y=[0,4, 4,4,5,5,5,6,6,6,7,7,7,8,8,8,8.5,10,10,8.5] END ;98-102kts (speed lt 102.5): Begin x=[0, 0,5,0, 0, 0, 5, 0, 0] y=[0,6.5,8,8,6.5,8.5,10,10,8.5] END ;103-107kts (speed lt 107.5): Begin x=[0,0,2.5,0, 0,5,0, 0, 0, 5, 0, 0] y=[0,6, 6,6,6.5,8,8,6.5,8.5,10,10,8.5] END ;108-112kts (speed lt 112.5): Begin x=[0,0,5,0, 0,5,0, 0, 0, 5, 0, 0] y=[0,6,6,6,6.5,8,8,6.5,8.5,10,10,8.5] END ;113-117kts (speed lt 117.5): Begin x=[0,0,2.5,0,0,5,0, 0,5,0, 0, 0, 5, 0, 0] y=[0,5, 5,5,6,6,6,6.5,8,8,6.5,8.5,10,10,8.5] END ;118-122kts ELSE: Begin x=[0,0,5,0,0,5,0, 0,5,0, 0, 0, 5, 0, 0] y=[0,5,5,5,6,6,6,6.5,8,8,6.5,8.5,10,10,8.5] END ENDCASE rot_factor=[[ cos(theta*!dtor), -sin(theta*!dtor)],$ [ sin(theta*!dtor), cos(theta*!dtor)]] rot_barb = rot_factor # transpose([[x],[y]]) END ;****************************************************************** PRO WIND_BARBS2, speed,theta, rot_barb ;****************************************************************** speed=speed*1.94 CASE 1 OF ;1-2kts (speed lt 2.5): Begin x=[0.,0.] y=[0.,10.] END ;3-7kts (speed lt 4.5): Begin x=[0,0,2.5,0, 0] y=[0.,8, 8,8,10] END ;8-12 kts (speed lt 8.5): Begin x=[0., 0, 5, 0] y=[0.,10,10,10] END ;13-17kts (speed lt 12.5): Begin x=[0.,0,2.5,0, 0, 5] y=[0.,9, 9,9,10,10] END ;18-22kts (speed lt 16.5): Begin x=[0.,0,5,0, 0, 5] y=[0.,9,9,9,10,10] END ;23-27kts (speed lt 20.5): Begin x=[0.,0,2.5,0,0,5,0, 0, 5] y=[0.,8, 8,8,9,9,9,10,10] END ;28-32kts (speed lt 24.5): Begin x=[0.,0,5,0,0,5,0, 0, 5] y=[0.,8,8,8,9,9,9,10,10] END ;33-37kts (speed lt 28.5): Begin x=[0.,0,2.5,0,0,5,0,0,5,0, 0, 5] y=[0.,7, 7,7,8,8,8,9,9,9,10,10] END ;38-42kts (speed lt 32.5): Begin x=[0.,0,5,0,0,5,0,0,5,0, 0, 5] y=[0.,7,7,7,8,8,8,9,9,9,10,10] END ;43-47kts (speed lt 36.5): Begin x=[0.,0,2.5,0,0,5,0,0,5,0,0,5,0, 0, 5] y=[0.,6, 6,6,7,7,7,8,8,8,9,9,9,10,10] END ;48-52kts (speed lt 40.5): Begin x=[0., 0, 5, 0, 0] y=[0.,8.5,10,10,8.5] END ;53-57kts (speed lt 44.5): Begin x=[0.,0,2.5,0, 0,5,0, 0] y=[0.,8, 8,8,8.5,10,10,8.5] END ;58-62kts (speed lt 48.5): Begin x=[0.,0,5,0, 0, 5, 0, 0.] y=[0.,8,8,8,8.5,10,10,8.5] END ;63-67kts (speed lt 52.5): Begin x=[0.,0,2.5,0,0,5,0, 0, 5, 0, 0] y=[0.,7, 7,7,8,8,8,8.5,10,10,8.5] END ;68-72kts (speed lt 56.5): Begin x=[0.,0,5,0,0,5,0, 0, 5, 0, 0] y=[0.,7,7,7,8,8,8,8.5,10,10,8.5] END ;73-77kts (speed lt 60.5): Begin x=[0.,0,2.5,0,0,5,0,0,5,0, 0, 5, 0, 0] y=[0.,6, 6,6,7,7,7,8,8,8,8.5,10,10,8.5] END ;78-82kts (speed lt 64.5): Begin x=[0.,0,5,0,0,5,0,0,5,0, 0, 5, 0, 0] y=[0.,6,6,6,7,7,7,8,8,8,8.5,10,10,8.5] END ;83-87kts (speed lt 68.5): Begin x=[0.,0,2.5,0,0,5,0,0,5,0,0,5,0, 0, 5, 0, 0] y=[0.,5, 5,5,6,6,6,7,7,7,8,8,8,8.5,10,10,8.5] END ;88-92kts (speed lt 72.5): Begin x=[0.,0,5,0,0,5,0,0,5,0,0,5,0, 0, 5, 0, 0] y=[0.,5,5,5,6,6,6,7,7,7,8,8,8,8.5,10,10,8.5] END ;93-97kts (speed lt 76.5): Begin x=[0.,0,2.5,0,0,5,0,0,5,0,0,5,0,0,5,0, 0, 5, 0, 0] y=[0.,4, 4,4,5,5,5,6,6,6,7,7,7,8,8,8,8.5,10,10,8.5] END ;98-102kts (speed lt 80.5): Begin x=[0., 0,5,0, 0, 0, 5, 0, 0] y=[0.,6.5,8,8,6.5,8.5,10,10,8.5] END ;103-107kts (speed lt 107.5): Begin x=[0.,0,2.5,0, 0,5,0, 0, 0, 5, 0, 0] y=[0.,6, 6,6,6.5,8,8,6.5,8.5,10,10,8.5] END ;108-112kts (speed lt 112.5): Begin x=[0.,0,5,0, 0,5,0, 0, 0, 5, 0, 0] y=[0.,6,6,6,6.5,8,8,6.5,8.5,10,10,8.5] END ;113-117kts (speed lt 117.5): Begin x=[0.,0,2.5,0,0,5,0, 0,5,0, 0, 0, 5, 0, 0] y=[0.,5, 5,5,6,6,6,6.5,8,8,6.5,8.5,10,10,8.5] END ;118-122kts ELSE: Begin x=[0.,0,5,0,0,5,0, 0,5,0, 0, 0, 5, 0, 0] y=[0.,5,5,5,6,6,6,6.5,8,8,6.5,8.5,10,10,8.5] END ENDCASE rot_factor=[[ cos(theta*!dtor), -sin(theta*!dtor)],$ [ sin(theta*!dtor), cos(theta*!dtor)]] rot_barb = rot_factor # transpose([[x],[y]]) END ;------------------------------------------------------------------------ PRO CREATE_COLOR_TABLE,r,g,b ;------------------------------------------------------------------------ ; create a color table where ; color 0 is white ; color 15 is black ; colors 1 - 15 are shades of gray ; colors 16 - 40 are different colors r(0:40)=[255,238,221,204,187,170,153,136,119,102,85,68,51,34,17,0,54,27,0,$ 28,56,85,141,198,255,255,255,255,255,255,255,255,255,255,255,255,255,255,$ 255,255,255] g(0:40)=[255,238,221,204,187,170,153,136,119,102,85,68,51,34,17,0,182,91,0,$ 73,146,220,194,168,143,128,114,99,85,63,42,21,0,12,24,36,48,60,72,84,97] b(0:40)=[255,238,221,204,187,170,153,136,119,102,85,68,51,34,17,0,255,234,213,$ 166,119,73,48,24,0,18,36,54,73,54,36,18,0,31,63,95,127,159,191,223,255] n_colors=25 tvlct,r,g,b END ;------------------------------------------------------------------------ PRO CREATE_COLOR_TABLE2 ;------------------------------------------------------------------------ ; create a color table where ; color 0 is white ; color 15 is black ; colors 1 - 15 are shades of gray ; colors 16 - 40 are different colors tvlct,r,g,b,/get r(0:63)=[255,238,221,204,187,170,153,136,119,102,85,68,51,34,17,0,198,177,163,$ 136,105,88,56,0,7,15,23,31,38,46,54,62,86,110,134,158,182,206,$ 230,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,$ 255,255,255,255,255,255,255,255,255,255] g(0:63)=[255,238,221,204,187,170,153,136,119,102,85,68,51,34,17,0,255,245,225,$ 204,166,143,116,0,28,56,84,112,140,168,196,224,227,231,235,239,243,247,$ 251,255,249,243,237,232,226,220,214,209,182,156,130,104,78,52,$ 26,0,0,0,0,0,0,0,0,0] b(0:63)=[255,238,221,204,187,170,153,136,119,102,85,68,51,34,17,0,255,255,$ 255,255,255,255,255,255,223,191,159,127,95,63,31,0,0,0,0,0,0,0,$ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,63,95,127,159,191,223,255] n_colors=25 r(0) = 0 g(0) = 0 b(0) = 0 r(15) = 255 g(15) = 255 b(15) = 255 tvlct,r,g,b END