def plotmaxKE_everystep(self, maxlabel, x_variable_name_list, y_variable_name_list): cd.dumptofile(self.fromtraceorall).dump_custom_max(maxlabel) debug_fig_max_path = dp.debug_fig_path + 'max_' + maxlabel + '/' os.makedirs(debug_fig_max_path, exist_ok=True) df = pd.read_hdf(dp.put_maxlabel_on_file(maxlabel, dp.f_custom)) df_step = cs.extract_dataframe(df, self.step1, self.step2) def redefine_variable_name(variable_name_list): if variable_name_list == 'all': new_variable_name_list = df_step.columns.values.tolist() else: new_variable_name_list = variable_name_list return new_variable_name_list new_x_variable_name_list = redefine_variable_name(x_variable_name_list) new_y_variable_name_list = redefine_variable_name(y_variable_name_list) for x_label in new_x_variable_name_list: x_array = df_step[x_label].values for y_label in new_y_variable_name_list: y_array = df_step[y_label].values figclass = lammp_figure_max(self.step1, self.step2, x_label, y_label, maxlabel) figclass.create_and_save(debug_fig_max_path, x_array, y_array) plt.close('all') print("finish plot max")
def __init__(self, step1, step2, fromtraceorall): super().__init__() self.step1 = step1 self.step2 = step2 self.fromtraceorall = fromtraceorall print("plot step from {step1} to {step2}".format(step1=step1, step2=step2)) cd.dumptofile(fromtraceorall).dump_custom()
def __init__(self, step1, step2, id_i, fromtraceorall): super().__init__() self.step1 = step1 self.step2 = step2 self.id_i = id_i self.id_i_list = [id_i] self.fromtraceorall = fromtraceorall print("plot step from {step1} to {step2}".format(step1=step1, step2=step2)) cd.dumptofile(fromtraceorall).dump_custom_select(self.id_i_list) self.f_read_custom_single = dp.put_id_on_file(self.id_i_list, dp.f_custom)
#!/usr/bin/env python import sys import datapath as dp import createdata.datatofile as cd import calculate.checkoutputfile as cco import plotfigure.plottofile as ppf # thermo cd.thermo_hdf5_csv() traceorall = 'trace' cd.dumptofile(fromtraceorall=traceorall).dump_custom() step1 = 0 #23730 step2 = 19943 error_tolerence = 1e-15 method_list = [2] # method 2 has smaller error than method 0, 1 for id_i in range(131689, 131690): cco.checkoverlap(id_i, step1, step2).checkprint() cco.checkforce(id_i, 19200, step2, error_tolerence, method_list).checkprint() """ cd.dumptofile(traceorall).dump_custom_max("c_KEt_atom") cd.dumptofile(traceorall).dump_custom_max("z") cd.dumptofile(traceorall).dump_custom_max("c_KEt_atom") cco.checkmaxid("c_KEt_atom", step1, step2).checkprint() cco.checkforce(109753, 20980, 21000, error_tolerence, method_list).checkprint()
# thermo cd.thermo_hdf5_csv() step1 = 6300001 step2 = 7200001 # thermo plot y_variable_name_list = 'all' x_variable_name_list = ['Step'] ppf.plotfromthermo(step1, step2).plotthermo(x_variable_name_list, y_variable_name_list) fromtraceorall_input = 'all' fromtraceorall_input = 'trace' cd.dumptofile(fromtraceorall=fromtraceorall_input).dump_custom_max("c_KEt_atom") cco.checkmaxid("c_KEt_atom", step1, step2).checkprint() y_variable_name_list2 = ['c_KEt_atom','c_KEr_atom','v_KEtr_atom','id',] y_variables = [ 'fx', 'fy', 'fz', 'x', 'y', 'z', 'vx', 'vy', 'vz',