コード例 #1
0
from read_data import ReadClass

rc('text', usetex=True)
rc('font', family='serif')

setting_name = "setting"
figure_dir = './figure/'

reader = ReadClass()
remote_data = reader.data_PID(setting_name)
reader.set_ssh(remote_data=remote_data)
reader.read_setting(setting_name)
reader.read_file_number(ssh_flag=True)

K_axis, L_axis = reader.set_axis()

c_level = 64

for time in range(0, 11):
    it = time * reader.interval_write_variable
    str_it = '{0:04d}'.format(it)
    spec = reader.read_E_ave(it)

    energy_all = np.sum(spec)
    spec[spec <= 0.0] = np.nan
    spec_log10 = np.log10(spec / energy_all)
    max_spec = np.nanmax(spec_log10)
    min_spec = np.nanmin(spec_log10)
    #
    print(it, max_spec, min_spec, energy_all)
コード例 #2
0
rc('text', usetex=True)
rc('font', family='serif')

setting_name = "setting"
figure_dir = './figure/'

reader = ReadClass()
remote_data = reader.data_PID(setting_name)
reader.set_ssh(remote_data=remote_data)
reader.read_setting(setting_name)
reader.read_file_number(ssh_flag=True)
aspect = reader.read_aspect_ratio(ssh_flag=True)

X, Y = reader.set_XY_axis()
K0, L0 = reader.set_axis()
K, L = np.meshgrid(K0, L0)

c_level = 64
var_dict = {'E': 'Energy spectrum', 'P': 'Stream function', 'Q': 'Vorticity'}

var = 'P'
# print(X, Y)

ip = 1
str_ip = '{0:04d}'.format(ip)

Q0 = reader.read_real(0, ip, 'Q')
mu = np.pi**2 * (K[:, :]**2 / aspect[0] + L[:, :]**2 * aspect[0])
P = np.zeros((reader.NK, reader.NL))
P[:reader.NK_truncate - 1, :reader.NK_truncate - 1] = Q0[:, :] / mu[:, :]