Commit cfed11e7 authored by Marc Arene's avatar Marc Arene
Browse files

load individual lengths

parent 98726a3b
......@@ -66,7 +66,7 @@ if os.path.isfile(outdir + 'config.ini'):
config_parser = ConfigParser()
config_parser.read(config_file_path)
config_dict = pu.config_parser_to_dict(config_parser)
lengthT = config_dict['hmc']['length_num_traj']
# lengthT = config_dict['hmc']['length_num_traj']
else:
print("ERROR: COULD NOT FIND ANY SORT OF CONFIGURATION FILE")
sys.exit()
......@@ -88,6 +88,7 @@ dlogL_file = outdir_plot_traj + 'dlogL.dat'
H_p_logL_logP_file = outdir_plot_traj + 'H_p_logL_logP.dat'
pmom_trajs_file = outdir_plot_traj + 'pmom_trajs.dat'
dlogTrajPi_trajs_file = outdir_plot_traj + 'dlogTrajPi_traj.dat'
lengths_file = outdir_plot_traj + 'lengths.dat'
# # Pb with np.loadtxt(): when there is only one index in the file, the resulting array has a shape = (), but size still equal to 1. Reshaping it puts it with shape = (1,) and hence it can be normally manipulated then
# if search_parameter_indices.size == 1:
......@@ -99,6 +100,7 @@ dlogL = np.loadtxt(dlogL_file).T
H_p_logL_logP = np.loadtxt(H_p_logL_logP_file).T
pmom_trajs = np.loadtxt(pmom_trajs_file).T
dlogTrajPi_trajs = np.loadtxt(dlogTrajPi_trajs_file).T
lengths = np.loadtxt(lengths_file).T
if os.path.exists(outdir + 'sampler_state/phase1/scales.dat'):
scale = np.loadtxt(outdir + 'sampler_state/phase1/scales.dat').T
elif os.path.exists(outdir + 'sampler_state/scales.dat'):
......@@ -109,6 +111,7 @@ else:
# q_pos = pt_fit_traj[search_parameter_indices]
# dlogL = dlogL_all[search_parameter_indices]
# import IPython; IPython.embed();
lengthT = int(lengths[trajectory_index])
idx_start = trajectory_index * (lengthT + 1)
idx_end = (trajectory_index +1) * (lengthT + 1)
pt_fit_traj = pt_fit_traj[:, idx_start: idx_end]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment