Next: File formats
Up: MagicTools procedures reference:
Previous: DFset - set of
Contents
DF - Distribution Function
DF is a object-oriented class, which is supposed to reproduce basic features of a single distribution
function (e.g. RDF, bond length distribution, angle distribution, intermolecular potential,
angle-bending potential, correction to potential, etc.).
The class contains properties and methods, which are common for every function, however, some methods
are redefined when necessary to keep function specificity:
- Properties:
-
- Name
- - Name of the function
- Kind
- - Kind of the function: 'RDF' or 'POTENTIAL'
- Type
- - Type of the function: It can be 'NB', 'B' or 'A', for Non-bonded, pairwise bond and angle bond, respectively.
- Npoints
- - Number of points in a table defining the function.
- Min,Max
- - Range of distances(Å)/angles(deg) where the function is defined
- Resol
- - Resolution of the table
- g[:, 0:2]
- - The table (numpy array) defining the function. g[:,0]-keeps argument (r,angle), g[:,1]-keeps function's value
- AtomTypes
- - (NB only) Names of the atom/bead types involved in the interaction represented by the function
- BondNumber
- - (B/A only) Number of the bond represented by the function.
- MolTypeName
- - (B/A only) Name of the Molecular type the bond function refers to.
- AtomGroups
- - (B/A only) List of atom pairs/triplets involved in the bond
- Methods:
-
- Plot()
- - Plot the function, using matplotlib library
- Save()
- - Write the function in a tabulated format to a text file.
- Smooth()
- - Smooth values of g[:,1] using Savitzky-Golay 5 points smoothing procedure
- Trim(tolerance)
- - Cut function's (g[:,1]) left and right tails which have values smaller then tolerance
Examples:
import DF
- import the class
RDFref=MagicTools.ReadRDF('dmpc.400ns.v2.rdf')
- read a set of RDFs, which
is and object of the class DFset, containing a number of DF-objects.
rdfNB=RDFref.DFs[0]
- Access the first function of the set. It is an object of class DF representing a non-bonded RDF.
rdfNB.g
- Access the table of the function
rdfNB.Plot()
- Plot the function
rdfNB.AtomTypes
- See what bead/atom types are involved in the function.
rdfB=RDFref.DFs_B[0]
- Access the first pairwise bond related function of the set (they are indexed from 0)
rdfB.MolTypeName
- See the name of the molecular type the bond function belongs to.
Next: File formats
Up: MagicTools procedures reference:
Previous: DFset - set of
Contents
Alexander Lyubartsev
2016-05-03