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

📄 plot_temperature.pro

📁 pic 模拟程序!面向对象
💻 PRO
📖 第 1 页 / 共 3 页
字号:
  endelse  y_label = '<v_y> [m/s]'  plot,  x_grid, v_y_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 (ylineout_i eq 0) then begin    ylineout_i = 1    set_plot, 'PS', /copy    device, filename = ylineout_file, /color, bits_per_pixel=8, xsize=12.0, ysize=10.0    goto, ylineout_jump    endif; here rendering to file is done.  set back to screen defaults  if (ylineout_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  y2lineout_i = 0  y2lineout_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 ' + y2lineout_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_y_rms [m/s]'  plot,  x_grid, v_y_rms_line, thick=2, /xs, xtitle=x_label, ytitle=y_label, $         YRANGE=[0.,3.0e+07]; rendering to screen is done.  here we render to ps file  if (y2lineout_i eq 0) then begin    y2lineout_i = 1    set_plot, 'PS', /copy    device, filename = y2lineout_file, /color, bits_per_pixel=8, xsize=12.0, ysize=10.0    goto, y2lineout_jump    endif; here rendering to file is done.  set back to screen defaults  if (y2lineout_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  tylineout_i = 0  tylineout_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 ' + tylineout_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_y [eV]'  plot,  x_grid, T_y_line, thick=2, /xs, xtitle=x_label, ytitle=y_label, $         YRANGE=[0.,5000.]; rendering to screen is done.  here we render to ps file  if (tylineout_i eq 0) then begin    tylineout_i = 1    set_plot, 'PS', /copy    device, filename = tylineout_file, /color, bits_per_pixel=8, xsize=12.0, ysize=10.0    goto, tylineout_jump    endif; here rendering to file is done.  set back to screen defaults  if (tylineout_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 (doTContour eq 1) then begin ; calculate gridded temperature for the 1st velocity component  print, ' '  print, 'Now calculating the total rms velocity and temperature...'  temp  = T_x + T_y  v_rms = 2.998e+08 * sqrt(temp/0.511e+06); sometimes it's helpful to have a log scale to see what is going on  temp_log = alog10( temp + 1.0e-10 * max(temp) ); 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  vcontour_i = 0  vcontour_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 ' + vcontour_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_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_rms, x_grid, y_grid, thick=2, /xs, /ys, nlevels=40, $           xtitle=x_label, ytitle=y_label, /fill, /NoErase, /NoData  xyout_str = 'v_total_rms [m/s]'  xyouts, 0.25, 0.85, xyout_str, /NORMAL; rendering to screen is done.  here we render to ps file  if (vcontour_i eq 0) then begin    vcontour_i = 1    set_plot, 'PS', /copy    device, filename = vcontour_file, /color, bits_per_pixel=8, $            xsize=x_device, ysize=ywin_device, /LANDSCAPE    goto, vcontour_jump    endif; here rendering to file is done.  set back to screen defaults  if (vcontour_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)  temp_line  = temp(*,  r_row)  v_rms_line = v_rms(*, r_row) temp_line  = smooth(temp_line,  3, /EDGE_TRUNCATE) v_rms_line = smooth(v_rms_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  vlineout_i = 0  vlineout_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 ' + vlineout_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_total_rms [m/s]'  plot,  x_grid, v_rms_line, thick=2, /xs, xtitle=x_label, ytitle=y_label, $         YRANGE=[0.,3.0e+07]; rendering to screen is done.  here we render to ps file  if (vlineout_i eq 0) then begin    vlineout_i = 1    set_plot, 'PS', /copy    device, filename = vlineout_file, /color, bits_per_pixel=8, xsize=12.0, ysize=10.0    goto, vlineout_jump    endif; here rendering to file is done.  set back to screen defaults  if (vlineout_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  tlineout_i = 0  tlineout_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 ' + tlineout_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 = 'Temperature [eV]'  plot,  x_grid, temp_line, thick=2, /xs, xtitle=x_label, ytitle=y_label, $         YRANGE=[0.,5000.]; rendering to screen is done.  here we render to ps file  if (tlineout_i eq 0) then begin    tlineout_i = 1    set_plot, 'PS', /copy    device, filename = tlineout_file, /color, bits_per_pixel=8, xsize=12.0, ysize=10.0    goto, tlineout_jump    endif; here rendering to file is done.  set back to screen defaults  if (tlineout_i eq 1) then begin    device, /close    set_plot, 'X'    !p.font=-1    !p.charsize=2.0    device,decomposed=0  endifendif; *****************************************************************; Final clean-up; *****************************************************************; Stop here so that all variables will still be in scope. stop; All done.end

⌨️ 快捷键说明

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