diff --git a/linfa/plot_res.py b/linfa/plot_res.py index d969d0d..b566423 100644 --- a/linfa/plot_res.py +++ b/linfa/plot_res.py @@ -35,16 +35,19 @@ def plot_log(log_file,out_dir,fig_format='png', use_dark_mode=False): def plot_params(param_data,LL_data,idx1,idx2,out_dir,out_info,fig_format='png', use_dark_mode=False): # Read data - param_data = np.loadtxt(param_data) - dent_data = np.loadtxt(LL_data) + param_data = np.loadtxt(param_data) # [5000, 3] + dent_data = np.loadtxt(LL_data) # [5000, ] # Plot figure plt.figure() plt.scatter(param_data[:,idx1], param_data[:,idx2]/1000, lw = 0, s =7, marker = 'o', c = np.exp(dent_data)) - plt.plot(1000, -21.0, 'r*') + + #plt.plot(1000, -21.0, 'r*') plt.colorbar() - plt.xlabel('Std. Pressure, '+r'$P_0$'+' [Pa]') - plt.ylabel('Ads. Energy, '+r'$E$'+' [kJ'+r'$\cdot$'+'mol'+r'$^{-1}$'+']') + # plt.xlabel('Std. Pressure, '+r'$P_0$'+' [Pa]') + # plt.ylabel('Ads. Energy, '+r'$E$'+' [kJ'+r'$\cdot$'+'mol'+r'$^{-1}$'+']') + plt.xlabel(r'$\theta_{K,'+str(idx1+1)+'}$') + plt.ylabel(r'$\theta_{K,'+str(idx2+1)+'}$') plt.savefig(os.path.join(out_dir,'params_plot_' + out_info + '_'+str(idx1)+'_'+str(idx2)+'.'+fig_format)) plt.close() @@ -164,10 +167,10 @@ def plot_outputs(sample_file,obs_file,idx1,idx2,out_dir,out_info,fig_format='png # Plot 2D slice of posterior samples if(os.path.isfile(param_file) and os.path.isfile(LL_file)): - tot_params = np.loadtxt(param_file).shape[1] + tot_params = np.loadtxt(param_file).shape[1] # extract total number of parameters inferred print('Plotting posterior samples...') - for loopA in range(tot_params): - for loopB in range(loopA+1, tot_params): + for loopA in range(tot_params): # loop over total number of parameters + for loopB in range(loopA+1, tot_params): # get next parameter plot_params(param_file,LL_file,loopA,loopB,out_dir,out_info,fig_format=args.img_format,use_dark_mode=args.use_dark_mode) else: print('File with posterior samples not found: '+param_file) diff --git a/linfa/tests/test_no_disc_TP15_error_estimation.py b/linfa/tests/test_no_disc_TP15_error_estimation.py index 65b1180..9869dc6 100644 --- a/linfa/tests/test_no_disc_TP15_error_estimation.py +++ b/linfa/tests/test_no_disc_TP15_error_estimation.py @@ -58,7 +58,7 @@ def run_test(): # Define transformation trsf_info = [['tanh', -30.0, 30.0, 500.0, 1500.0], ['tanh', -30.0, 30.0, -30000.0, -15000.0], - ['tanh', -7.0, 7.0, 0.01, 0.1]] + ['tanh', -15.0, 15.0, 0.0001, 0.5]] trsf = Transformation(trsf_info) # Apply the transformation