3 from mayavi
import mlab
4 from os.path
import join
6 from argparse
import ArgumentParser
11 parser = ArgumentParser()
12 parser.add_argument(
"results_path")
13 parser.add_argument(
"--id", nargs=
'?', default=
"tmp")
14 args = parser.parse_args()
20 from sumatra.projects
import load_project
21 output_dir = os.path.join(os.path.abspath(load_project().data_store.root), args.id)
25 if not os.path.exists(output_dir):
26 os.makedirs(output_dir)
32 if atom_meta[counter][
"type"] == 1:
34 elif atom_meta[counter][
"type"] == 8:
38 mlab.points3d(atom[0], atom[1], atom[2],
47 path_name =
"/home/svenni/Dropbox/projects/programming/hartree-fock/build-hartree-fock-stan-Desktop_Qt_5_2_1_GCC_64bit-Release/app"
49 atoms_data_file = h5py.File(join(path_name,
"results.h5"))
50 atom_meta = atoms_data_file.get(
"atomMeta")[:]
51 atoms = atoms_data_file.get(
"state")[:]
52 atoms_data_file.close()
54 file_name =
"electrostatic_potential.h5"
55 density_file = h5py.File(join(path_name, file_name))
56 data = density_file.get(
"dataset")[:]
59 print "Data min,max:",data.min(),data.max()
61 X,Y,Z = mgrid[-5:5:1j*data.shape[0], -5:5:1j*data.shape[1], -5:5:1j*data.shape[2]]
63 mlab.figure(2, bgcolor=(0, 0, 0), size=(1280, 720))
66 data_max_min_diff = (data.max() - data.min())
67 levels = [0.0003, 0.008]
70 contours.append(data.min() + level * data_max_min_diff)
71 contours = [-0.03, 0.7]
72 iso = mlab.contour3d(X, Y, Z, data, vmin=contours[0], vmax=contours[-1], opacity=0.5, contours=contours)
74 mlab.savefig(
"ch4-volume.x3d")