Skip to content
Snippets Groups Projects
Commit 38f3f6a6 authored by Arnaud HEMMERLE's avatar Arnaud HEMMERLE
Browse files

Changed .value after h5py update

parent 577c5318
No related branches found
No related tags found
No related merge requests found
Source diff could not be displayed: it is too large. Options to address this: view the blob.
......@@ -36,13 +36,13 @@ for i, scan in enumerate(scans):
# 5: Error (float)
# Extract the parameter names
col0 = [val.decode("UTF-8") for val in f['current/parameters/data col 0'].value]
col0 = [val.decode("UTF-8") for val in f['current/parameters/data col 0'][()]]
# Find where the param is
arg_param = col0.index("Sub.setDens")
# Change its max value (needs to extract and update the whole array)
# 'Max' value is in data col 4 (see list above)
temp = f['current/parameters/data col 4'].value
temp = f['current/parameters/data col 4'][()]
temp[arg_param] = max_rho[i]
f['current/parameters/data col 4'][...] = temp
......@@ -63,22 +63,22 @@ for i, scan in enumerate(scans):
f = h5py.File("results_C/result"+str(i)+".hgx", "r")
# Extract and save the curves
x = f['current/data/datasets/0/x'].value
y = f['current/data/datasets/0/y'].value
y_sim = f['current/data/datasets/0/y_sim'].value
error = f['current/data/datasets/0/error'].value
x = f['current/data/datasets/0/x'][()]
y = f['current/data/datasets/0/y'][()]
y_sim = f['current/data/datasets/0/y_sim'][()]
error = f['current/data/datasets/0/error'][()]
np.savetxt('results_C/fit'+str(i)+'.dat', np.transpose([x, y, y_sim, error]),
header='#x\t#y\t#y_fit\t#error' )
# Extract and save the parameters
col0 = [val.decode("UTF-8") for val in f['current/parameters/data col 0'].value]
col1 = [val for val in f['current/parameters/data col 1'].value]
col2 = [val for val in f['current/parameters/data col 2'].value]
col3 = [val for val in f['current/parameters/data col 3'].value]
col4 = [val for val in f['current/parameters/data col 4'].value]
col5 = [val for val in f['current/parameters/data col 5'].value]
col_labels = [val.decode("UTF-8") for val in f['current/parameters/data_labels'].value]
col0 = [val.decode("UTF-8") for val in f['current/parameters/data col 0'][()]]
col1 = [val for val in f['current/parameters/data col 1'][()]]
col2 = [val for val in f['current/parameters/data col 2'][()]]
col3 = [val for val in f['current/parameters/data col 3'][()]]
col4 = [val for val in f['current/parameters/data col 4'][()]]
col5 = [val for val in f['current/parameters/data col 5'][()]]
col_labels = [val.decode("UTF-8") for val in f['current/parameters/data_labels'][()]]
f.close()
# Reorganise as a table and print
......
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment