Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
PORTER Edward
GWHMC
Commits
cfed11e7
Commit
cfed11e7
authored
Apr 06, 2021
by
Marc Arene
Browse files
load individual lengths
parent
98726a3b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
Tests/plot_trajectory.py
Tests/plot_trajectory.py
+4
-1
No files found.
Tests/plot_trajectory.py
View file @
cfed11e7
...
...
@@ -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
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment