def pp_gvmus_video(file_in,outname,ext): infile=file_in ncfile=netcdf.netcdf_file(infile,'r') # |g|^2 averaged over kx, ky, and z gvmus, gvmus_present \ = read_stella_float(infile,'gvmus') # parallel velocity grid vpa, vpa_present = \ read_stella_float(infile,'vpa') # mu grid mu, mu_present = \ read_stella_float(infile,'mu') # get time grid time = np.copy(ncfile.variables['t'][:]) ntime = time.size gmax = np.arange(ntime,dtype=float) gmin = np.arange(ntime,dtype=float) movie_file = outname+ '_gvmus'+ext for i in range(ntime): gmax[i] = np.absolute(gvmus[i,0,:,:].max()) gmin[:] = 0.0 xlabel = '$v_{\parallel}$' ylabel = '$\mu$' title = '$\int d^3 \mathbf{R} g^2$' movie_2d(gvmus[:,0,:,:],vpa,mu,gmin,gmax,ntime-1,movie_file,xlabel,ylabel,title,cmp='YlGnBu')
def pp_gzvs_video(file_in,outname,ext): infile=file_in ncfile=netcdf.netcdf_file(infile,'r') # |g|^2 averaged over kx, ky, and mu gzvs, gzvs_present \ = read_stella_float(infile,'gzvs') # parallel velocity grid vpa, vpa_present = \ read_stella_float(infile,'vpa') # get zed grid zed = np.copy(ncfile.variables['zed'][:]) nzed = zed.size iz0 = nzed//2+1 # get time grid time = np.copy(ncfile.variables['t'][:]) ntime = time.size gmax = np.arange(ntime,dtype=float) gmin = np.arange(ntime,dtype=float) #movie_file = outname+ '_gvmus'+ext for i in range(ntime): gmax[i] = np.absolute(gzvs[i,0,:,:].max()) gmin[:] = 0.0 ylabel = '$v_{\parallel}$' xlabel = '$z$' title = '$\int d\mu \int d^2 \mathbf{R} g^2$' movie_file = outname+'_gzvs'+ext movie_2d(gzvs[:,0,:,:],zed,vpa,gmin,gmax,ntime-1,movie_file,xlabel,ylabel,title,cmp='YlGnBu')
def kspectra_movie(case, ): from stella_plots import movie_2d phi2_vs_kx_ky, k_x, k_y, n_time =\ phi2_vs_kxky(case), kx(case)[0], ky(case)[0], time(case)[1] phi2max = np.arange(n_time,dtype=float) phi2min = np.arange(n_time,dtype=float) for i in range(n_time): phi2max[i] = np.absolute(phi2_vs_kx_ky[i,:,:].max())*rescale phi2min[:] = 0.0 ylabel = '$k_x$' xlabel = '$k_y$' title = '$|\\varphi(k_x, k_y)|^2$' movie_file = outdir(case) + '/phi2_vs_kxky.mp4' movie_2d(phi2_vs_kx_ky, k_y, k_x, phi2min,\ phi2max, n_time-1, movie_file, xlabel, ylabel, title,cmp='YlGnBu')
import numpy as np from stella_plots import movie_2d from stella_data import phi2_vs_kxky, kx, ky, ntime phi2max = np.arange(ntime,dtype=float) phi2min = np.arange(ntime,dtype=float) for i in range(ntime): phi2max[i] = np.absolute(phi2_vs_kxky[i,:,:].max()) phi2min[:] = 0.0 ylabel = '$k_x$' xlabel = '$k_y$' title = '$\left|\varphi(k_x,k_y)\right|^2$' movie_file = 'phi2_vs_kxky.mp4' movie_2d(phi2_vs_kxky,ky,kx,phi2min,phi2max,ntime-1,movie_file,xlabel,ylabel,title,cmp='YlGnBu')
import numpy as np from stella_plots import movie_2d from stella_data import gvmus, vpa, mu, ntime gmax = np.arange(ntime, dtype=float) gmin = np.arange(ntime, dtype=float) for i in range(ntime): gmax[i] = np.absolute(gvmus[i, 0, :, :].max()) gmin[:] = 0.0 xlabel = '$v_{\parallel}$' ylabel = '$\mu$' title = '$\int d^3 \mathbf{R} g^2$' movie_file = 'gvmus.mp4' movie_2d(gvmus[:, 0, :, :], vpa, mu, gmin, gmax, ntime - 1, movie_file, xlabel, ylabel, title, cmp='YlGnBu')
import numpy as np from stella_plots import movie_2d from stella_data import gzvs, vpa, zed, ntime gmax = np.arange(ntime, dtype=float) gmin = np.arange(ntime, dtype=float) for i in range(ntime): gmax[i] = np.absolute(gzvs[i, 0, :, :].max()) gmin[:] = 0.0 ylabel = '$v_{\parallel}$' xlabel = '$z$' title = '$\int d\mu \int d^2 \mathbf{R} g^2$' movie_file = 'gzvs.mp4' movie_2d(gzvs[:, 0, :, :], zed, vpa, gmin, gmax, ntime - 1, movie_file, xlabel, ylabel, title, cmp='YlGnBu')