Skip to content

Commit

Permalink
update data
Browse files Browse the repository at this point in the history
  • Loading branch information
simongravelle committed Jan 25, 2024
1 parent f0d4a4f commit 1362761
Show file tree
Hide file tree
Showing 10 changed files with 145 additions and 97 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 52 additions & 0 deletions examples/illustrations/bulk-water-tip4p-anisotropic/analysis.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/usr/bin/env python
# coding: utf-8

import numpy as np
import MDAnalysis as mda
import nmrformd

import sys, os, git
current_path = os.getcwd()
git_repo = git.Repo(current_path, search_parent_directories=True)
git_path = git_repo.git.rev_parse("--show-toplevel")

sys.path.append(git_path + '/examples/shared/')
from utilities import save_result, measure_N, measure_R1

path = "/data/nmrformd-data/bulk-water-tip4p-vs-temperature/raw_data/"
run = True
R1_intra = 1e-5
R1_inter = 1e-5
T = 300
while run:
# Read current status
name_intra = "N4000_intra_T" + str(T) + "K"
name_inter = "N4000_inter_T" + str(T) + "K"
n_intra = measure_N(name_intra)
n_inter = measure_N(name_inter)
# Import MDA universe
datapath = path + "N4000_" + str(T) + "K/"
u = mda.Universe(datapath+"prod.tpr", datapath+"prod.xtc")
hydrogen = u.select_atoms("name HW1 HW2")
n_hydrogen = hydrogen.n_atoms
if n_intra < n_hydrogen:
# Calculated NMR properties
intra = nmrformd.NMR(u, atom_group = hydrogen,
neighbor_group = hydrogen,
type_analysis = "intra_molecular", isotropic=False,
number_i = 1)
save_result(intra, name = name_intra, aniso=True)
if np.random.random() < 0.2:
inter = nmrformd.NMR(u, atom_group = hydrogen,
neighbor_group = hydrogen,
type_analysis = "inter_molecular", isotropic=False,
number_i = 1)
save_result(inter, name = name_inter, aniso=True)
else:
run = False
# Print information
R1_intra = measure_R1(name_intra)
R1_inter = measure_R1(name_inter)
print("T =", T, "K --", n_intra, n_hydrogen,
"R1:", np.round(R1_intra,2), np.round(R1_inter,2),
"T1:", np.round(1/(R1_intra+R1_inter),2))
Binary file not shown.
Binary file not shown.
190 changes: 93 additions & 97 deletions examples/illustrations/bulk-water.ipynb

Large diffs are not rendered by default.

0 comments on commit 1362761

Please sign in to comment.