pyPRISM.omega.FromFile module¶
-
class
pyPRISM.omega.FromFile.
FromFile
(fileName)[source]¶ Bases:
pyPRISM.omega.Omega.Omega
Read intra-molecular correlations from file
This class reads a one or two column file using Numpy’s loadtxt function. A one-column file is expected to only contain intra-molecular correlation data, while a two-column file contains the k values of the data in the first column as well. If the k-values are provided, an extra check to make sure that the file data matches the same k-space grid of the domain.
-
fileName
¶ full path + name to column file
Type: str
Example
import pyPRISM import numpy as np import matplotlib.pyplot as plt #set type A omega(k) from a file sys = pyPRISM.System(['A','B'],kT=1.0) sys.domain = pyPRISM.Domain(dr=0.1,length=1024) fileName = './test_example_filename.txt' sys.omega['A','A'] = pyPRISM.omega.FromFile(fileName) x = sys.domain.k y = sys.omega['A','A'].calculate(x) #plot using matplotlib plt.plot(x,y) plt.gca().set_xscale("log", nonposx='clip') plt.gca().set_yscale("log", nonposy='clip') plt.show()
-