; ; Plots two dimension data for a quick visual check. ; Plots surfaces and images of raw and processed data ; pro plot_2D_data.pro ; ; Surface plots to check if the ; processed data represents the raw data ; surface_plots='no' ;Flag this yes if you want surface plots, no if you don't if surface_plots eq 'yes' then begin ; ; Surface plot of the processed data ; if dataname eq 'ReflectivityBestEstimate' then begin miv=-5000 mav=max(pro_data) endif else begin mav=max(pro_data) miv=0 endelse window,0,title='processed '+dataname surface,pro_data,newtimes,newheights,min_value=miv,max_value=mav,/horizontal ; ; Surface plot of the raw data ; window,1,title='raw '+dataname n1=0 while time_offset[n1] lt newtimes[0] do n1=n1+1 n2=n1 while time_offset[n2] lt newtimes[numtimes-1] do begin n2=n2+1 if n2 eq num_times then begin n2=n2-1 goto, enough endif endwhile enough: raw_data=data[n1:n2,*] raw_time_offset=time_offset[n1:n2] zoomsize=size(raw_data) if zoomsize[1] ge 2 then surface,raw_data,raw_time_offset,height,min_value=miv,max_value=mav,/horizontal endif ;if you want surface plots ; ; Image plots as another check of the data ; image_plots='no' ;flag this yes if you want image plots, no if you don't if image_plots eq 'yes' then begin ; ; Find the data range of the raw data and set the null values to 1e6 ; dmax=max(sub_data) ;max data value dmin=min(sub_data) ;null value result=where(sub_data eq dmin,count) if count ne 0 then sub_data[result]=1e6 dmin=min(sub_data) ;min data value print, 'sub_data min', dmin, 'data max', dmax ; ; Scale the raw data vales and insert then into image ; image=bytarr(num_times,num_heights) ;initialized to 0 image=bytscl(sub_data,max=dmax,min=dmin,top=255) ; ; Plot the raw data image ; window,2,xsize=600,ysize=600 loadct,5 contour, sub_data, sub_time_offset, height, /nodata,$ xstyle=1,ystyle=1 px=!x.window*!d.x_vsize py=!y.window*!d.y_vsize sx=px[1]-px[0]+1 sy=py[1]-py[0]+1 tv,congrid(image,sx,sy),px[0],py[0] ; ; Next plot the regridded and interpolated data ; ; ; Find the interpolated data range and set the null values to 1e6 ; This is commented out so that the raw data dmin and dmax ; is used for scaling ; ;dmin=min(inter_data) ;null value ;result=where(inter_data eq dmin,count) ;if count ne 0 then inter_data[result]=1e6 ;dmin=min(inter_data) ;min data value ;print, 'inter_data min', dmin, 'newdata max', dmax ; ; Scale the data vales and insert then into image ; newimage=bytarr(numtimes,numheights) ;initialized to 0 newimage=bytscl(inter_data,max=dmax,min=dmin,top=255) ; ; Plot the new data image ; window,3,xsize=600,ysize=600 loadct,5 contour, inter_data, newtimes, newheights, /nodata,$ xstyle=1,ystyle=1 px=!x.window*!d.x_vsize py=!y.window*!d.y_vsize sx=px[1]-px[0]+1 sy=py[1]-py[0]+1 tv, congrid(newimage,sx,sy),px[0],py[0] endif ;if you want image plots