⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 plot_temperature.pro

📁 pic 模拟程序!面向对象
💻 PRO
📖 第 1 页 / 共 3 页
字号:
  contour, v_x_rms, x_grid, y_grid, thick=2, /xs, /ys, nlevels=40, $           xtitle=x_label, ytitle=y_label, /fill; Load in the B-W LINEAR color table  loadct, 0   contour, v_x_rms, x_grid, y_grid, thick=2, /xs, /ys, nlevels=40, $           xtitle=x_label, ytitle=y_label, /fill, /NoErase, /NoData  xyout_str = 'v_x_rms [m/s]'  xyouts, 0.25, 0.85, xyout_str, /NORMAL; rendering to screen is done.  here we render to ps file  if (xcontour_i eq 0) then begin    xcontour_i = 1    set_plot, 'PS', /copy    device, filename = xcontour_file, /color, bits_per_pixel=8, $            xsize=x_device, ysize=ywin_device, /LANDSCAPE    goto, xcontour_jump    endif; here rendering to file is done.  set back to screen defaults  if (xcontour_i eq 1) then begin    device, /close    set_plot, 'X'    !p.font=-1    !p.charsize=2.0    device,decomposed=0  endif; *****************************************************************; Now for the corresponding lineout; Grab the desired row of data (here it is along the r=0 axis); Specify which row (fixed value of r) of grid points you will;   want to use for the lineout plot  r_row = fix(numGridsY*r_factor*.9)  T_x_line     = T_x(*,     r_row)  v_x_rms_line = v_x_rms(*, r_row)  v_x_avg_line = v_x_avg(*, r_row)  T_x_line     = smooth(T_x_line,     3, /EDGE_TRUNCATE)  v_x_rms_line = smooth(v_x_rms_line, 3, /EDGE_TRUNCATE);  v_x_avg_line = smooth(v_x_avg_line, 3, /EDGE_TRUNCATE); Put the plot into a new window  window_number = !d.window + 1  print, ' '  print, 'Line plot will appear in window ', window_number  window, window_number, RETAIN=2  xlineout_i = 0  xlineout_jump:; Specify a font that looks great for printing (crappy on screen),;   or else one that looks OK on the screen (also OK for printing).  if (!d.name eq 'PS') then begin    !p.font=1    !p.charsize=1.6    !p.charthick=1.5    if ( ScaleFlag eq 1 ) then begin      x_label = q_label + ' (c/!9w!3!d0!N)'    endif else if ( ScaleFlag eq 2 ) then begin      x_label = q_label + ' (c/!9w!3!dp!N)'    endif     print, ' '    print, 'Writing the 2D lineout plot to file ' + xlineout_file  endif else begin    !p.font=-1    !p.charsize=2.0    if ( ScaleFlag eq 1 ) then begin      x_label = q_label + ' (c/!4x!3!d0!N)'    endif else if ( ScaleFlag eq 2 ) then begin      x_label = q_label + ' (c/!4x!3!dp!N)'    endif     device,decomposed=0    print, ' '    print, 'Rendering the 2D lineout plot for the screen...'  endelse  y_label = '<v_x> [m/s]'  plot,  x_grid, v_x_avg_line, thick=2, /xs, xtitle=x_label, ytitle=y_label, $         YRANGE=[-1.0e+08,1.0e+08]; rendering to screen is done.  here we render to ps file  if (xlineout_i eq 0) then begin    xlineout_i = 1    set_plot, 'PS', /copy    device, filename = xlineout_file, /color, bits_per_pixel=8, xsize=12.0, ysize=10.0    goto, xlineout_jump    endif; here rendering to file is done.  set back to screen defaults  if (xlineout_i eq 1) then begin    device, /close    set_plot, 'X'    !p.font=-1    !p.charsize=2.0    device,decomposed=0  endif;****************************************************************************; Put the plot into a new window  window_number = !d.window + 1  print, ' '  print, 'Line plot will appear in window ', window_number  window, window_number, RETAIN=2  x2lineout_i = 0  x2lineout_jump:; Specify a font that looks great for printing (crappy on screen),;   or else one that looks OK on the screen (also OK for printing).  if (!d.name eq 'PS') then begin    !p.font=1    !p.charsize=1.6    !p.charthick=1.5    if ( ScaleFlag eq 1 ) then begin      x_label = q_label + ' (c/!9w!3!d0!N)'    endif else if ( ScaleFlag eq 2 ) then begin      x_label = q_label + ' (c/!9w!3!dp!N)'    endif     print, ' '    print, 'Writing the 2D lineout plot to file ' + x2lineout_file  endif else begin    !p.font=-1    !p.charsize=2.0    if ( ScaleFlag eq 1 ) then begin      x_label = q_label + ' (c/!4x!3!d0!N)'    endif else if ( ScaleFlag eq 2 ) then begin      x_label = q_label + ' (c/!4x!3!dp!N)'    endif     device,decomposed=0    print, ' '    print, 'Rendering the 2D lineout plot for the screen...'  endelse  y_label = 'v_x_rms [m/s]'  plot,  x_grid, v_x_rms_line, thick=2, /xs, xtitle=x_label, ytitle=y_label, $         YRANGE=[0.,1e+07]; rendering to screen is done.  here we render to ps file  if (x2lineout_i eq 0) then begin    x2lineout_i = 1    set_plot, 'PS', /copy    device, filename = x2lineout_file, /color, bits_per_pixel=8, xsize=12.0, ysize=10.0    goto, x2lineout_jump    endif; here rendering to file is done.  set back to screen defaults  if (x2lineout_i eq 1) then begin    device, /close    set_plot, 'X'    !p.font=-1    !p.charsize=2.0    device,decomposed=0  endif;****************************************************************************; Put the plot into a new window  window_number = !d.window + 1  print, ' '  print, 'Line plot will appear in window ', window_number  window, window_number, RETAIN=2  txlineout_i = 0  txlineout_jump:; Specify a font that looks great for printing (crappy on screen),;   or else one that looks OK on the screen (also OK for printing).  if (!d.name eq 'PS') then begin    !p.font=1    !p.charsize=1.6    !p.charthick=1.5    if ( ScaleFlag eq 1 ) then begin      x_label = q_label + ' (c/!9w!3!d0!N)'    endif else if ( ScaleFlag eq 2 ) then begin      x_label = q_label + ' (c/!9w!3!dp!N)'    endif     print, ' '    print, 'Writing the 2D lineout plot to file ' + txlineout_file  endif else begin    !p.font=-1    !p.charsize=2.0    if ( ScaleFlag eq 1 ) then begin      x_label = q_label + ' (c/!4x!3!d0!N)'    endif else if ( ScaleFlag eq 2 ) then begin      x_label = q_label + ' (c/!4x!3!dp!N)'    endif     device,decomposed=0    print, ' '    print, 'Rendering the 2D lineout plot for the screen...'  endelse  y_label = 'T_x [eV]'  plot,  x_grid, T_x_line, thick=2, /xs, xtitle=x_label, ytitle=y_label, $         YRANGE=[0.,500.]; rendering to screen is done.  here we render to ps file  if (txlineout_i eq 0) then begin    txlineout_i = 1    set_plot, 'PS', /copy    device, filename = txlineout_file, /color, bits_per_pixel=8, xsize=12.0, ysize=10.0    goto, txlineout_jump    endif; here rendering to file is done.  set back to screen defaults  if (txlineout_i eq 1) then begin    device, /close    set_plot, 'X'    !p.font=-1    !p.charsize=2.0    device,decomposed=0  endifendif; *****************************************************************; Loop for rendering 2-D color contour plot on screen and to a file; *****************************************************************if (doTyContour eq 1) then begin ; calculate gridded temperature for the 1st velocity component  print, ' '  print, 'Now gridding up the temperature to load rms velocity v_y_rms...'  v_y_rms = temperature_2d(x, y, vy, wt, numGridsX, numGridsY, $                           XAXIS=xax, YAXIS=yax,               $                           VMEAN=v_y_avg, DV_MAX=dv_y_max,     $                           N_MACRO=n_macro); Now rotate by 180 degrees to compare with Brad Shadwick's results  v_y_rms = reverse(v_y_rms, 1)  v_y_avg = reverse(v_y_avg, 1); let's smooth the results a little;  v_y_rms = smooth(v_y_rms, 3, /EDGE_TRUNCATE);  v_y_avg = smooth(v_y_avg, 3, /EDGE_TRUNCATE); Calculate the corresponding temperature  T_y  = 0.511e+06 * (v_y_rms/2.998e+08)^2;  T_y  = smooth(T_y,     3, /EDGE_TRUNCATE); sometimes it's helpful to have a log scale to see what is going on  T_y_log = alog10( T_y + 1.0e-10 * max(T_y) ); Get a new window  window_number = !d.window + 1  print, ' '  print, 'Color contour plot will appear in window ', window_number  window, window_number, xsize=x_win_ccon, ysize=ywin_ccon, RETAIN=2  ycontour_i = 0  ycontour_jump:; Specify a font that looks great for printing (crappy on screen),;   or else one that looks OK on the screen (also OK for printing).  if (!d.name eq 'PS') then begin    !p.font=1    !p.charsize=1.6    !p.charthick=1.5    if ( ScaleFlag eq 1 ) then begin      x_label = q_label  + ' (c/!9w!3!d0!N)'      y_label = q_label2 + ' (c/!9w!3!d0!N)'    endif else if ( ScaleFlag eq 2 ) then begin      x_label = q_label  + ' (c/!9w!3!dp!N)'      y_label = q_label2 + ' (c/!9w!3!dp!N)'    endif     print, ' '    print, 'Writing the 2D color contour plot to file ' + ycontour_file  endif else begin    !p.font=-1    !p.charsize=2.0    if ( ScaleFlag eq 1 ) then begin      x_label = q_label  + ' (c/!4x!3!d0!N)'      y_label = q_label2 + ' (c/!4x!3!d0!N)'    endif else if ( ScaleFlag eq 2 ) then begin      x_label = q_label  + ' (c/!4x!3!dp!N)'      y_label = q_label2 + ' (c/!4x!3!dp!N)'    endif     device,decomposed=0    print, ' '    print, 'Rendering the 2D color contour plot to the screen...'  endelse; Load in the RAINBOW color table  loadct, 13  contour, v_y_rms, x_grid, y_grid, thick=2, /xs, /ys, nlevels=40, $           xtitle=x_label, ytitle=y_label, /fill; Load in the B-W LINEAR color table  loadct, 0   contour, v_y_rms, x_grid, y_grid, thick=2, /xs, /ys, nlevels=40, $           xtitle=x_label, ytitle=y_label, /fill, /NoErase, /NoData  xyout_str = 'v_y_rms [m/s]'  xyouts, 0.25, 0.85, xyout_str, /NORMAL; rendering to screen is done.  here we render to ps file  if (ycontour_i eq 0) then begin    ycontour_i = 1    set_plot, 'PS', /copy    device, filename = ycontour_file, /color, bits_per_pixel=8, $            xsize=x_device, ysize=ywin_device, /LANDSCAPE    goto, ycontour_jump    endif; here rendering to file is done.  set back to screen defaults  if (ycontour_i eq 1) then begin    device, /close    set_plot, 'X'    !p.font=-1    !p.charsize=2.0    device,decomposed=0  endif; *****************************************************************; Now for the corresponding lineout; Grab the desired row of data (here it is along the r=0 axis); Specify which row (fixed value of r) of grid points you will;   want to use for the lineout plot  r_row = fix(numGridsY*r_factor)  T_y_line     = T_y(*,     r_row)  v_y_rms_line = v_y_rms(*, r_row)  v_y_avg_line = v_y_avg(*, r_row)  T_y_line     = smooth(T_y_line,     3, /EDGE_TRUNCATE)  v_y_rms_line = smooth(v_y_rms_line, 3, /EDGE_TRUNCATE);  v_y_avg_line = smooth(v_y_avg_line, 3, /EDGE_TRUNCATE); Put the plot into a new window  window_number = !d.window + 1  print, ' '  print, 'Line plot will appear in window ', window_number  window, window_number, RETAIN=2  ylineout_i = 0  ylineout_jump:; Specify a font that looks great for printing (crappy on screen),;   or else one that looks OK on the screen (also OK for printing).  if (!d.name eq 'PS') then begin    !p.font=1    !p.charsize=1.6    !p.charthick=1.5    if ( ScaleFlag eq 1 ) then begin      x_label = q_label + ' (c/!9w!3!d0!N)'    endif else if ( ScaleFlag eq 2 ) then begin      x_label = q_label + ' (c/!9w!3!dp!N)'    endif     print, ' '    print, 'Writing the 2D lineout plot to file ' + ylineout_file  endif else begin    !p.font=-1    !p.charsize=2.0    if ( ScaleFlag eq 1 ) then begin      x_label = q_label + ' (c/!4x!3!d0!N)'    endif else if ( ScaleFlag eq 2 ) then begin      x_label = q_label + ' (c/!4x!3!dp!N)'    endif     device,decomposed=0    print, ' '    print, 'Rendering the 2D lineout plot for the screen...'

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -