Module: chacon_tarazona

class pytim.chacon_tarazona.ChaconTarazona(universe, alpha=2.0, tau=1.5, group=None, radii_dict=None, max_layers=1, normal='guess', molecular=True, info=True, mesh=None, centered=False, warnings=False, autoassign=True, **kargs)

Identifies the dividing surface using the Chacon-Tarazona method

(Chacón, E.; Tarazona, P. Phys. Rev. Lett. 91, 166103, 2003) (Tarazona, P.; Chacón, E. Phys. Rev. B 70, 235407, 2004)

  • universe (Universe) – The MDAnalysis universe
  • alpha (float) – Molecular scale cutoff
  • tau (float) – Particles within this distance form the surface will be added during the self-consistent procedure.
  • molecular (bool) – Switches between search of interfacial molecules / atoms (default: True)
  • group (AtomGroup) – Compute the density using this group
  • radii_dict (dict) – Dictionary with the atomic radii of the elements in the group. If None is supplied, the default one (from GROMOS43a1) will be used.


>>> import MDAnalysis as mda
>>> import numpy as np
>>> import pytim
>>> from pytim.datafiles import WATER_GRO
>>> u = mda.Universe(WATER_GRO)
>>> g = u.select_atoms('name OW')
>>> interface = pytim.ChaconTarazona(u,alpha=2.,tau=1.5,group=g,info=False,molecular=False)
>>> interface.writepdb('CT.pdb',centered=True)
>>> print (repr(interface.layers))
array([[<AtomGroup with 175 atoms>],
       [<AtomGroup with 159 atoms>]], dtype=object)

(float) real space cutoff


(bool) assign layers every time a frame changes


(real) cutoff for phase identification


(float) threshold for the density-based filtering


(ndarray) additional cluster groups


(bool) print additional information


(AtomGroup) the group, the surface of which should be computed


Assign to all layers a label (the beta tempfactor) that can be used in pdb files. Additionally, set the new layers and sides.


(int) maximum number of layers to be identified


(bool) whether to compute surface atoms or surface molecules


(bool) use parallel implementation


(dict) custom atomic radii


Surfaces associated to the interface

writepdb(filename='layers.pdb', centered='no', group='all', multiframe=True, tempfactors=None)

Write the frame to a pdb file, marking the atoms belonging to the layers with different beta factors.

  • filename (str) – the output file name
  • centered (str) – ‘origin’, ‘middle’, or ‘no’
  • group (AtomGroup) – if ‘all’ is passed, use universe
  • multiframe (bool) – append to pdb file if True
  • tempfactors (ndarray) – use this array as temp (beta) factors
Example: save the positions (centering the interface in the cell)
without appending
>>> import pytim
>>> import pytim.datafiles
>>> import MDAnalysis as mda
>>> from pytim.datafiles import WATER_GRO
>>> u = mda.Universe(WATER_GRO)
>>> interface = pytim.ITIM(u)
>>> interface.writepdb('layers.pdb',multiframe=False)
Example: save the positions without centering the interface. This
will not shift the atoms from the original position (still, they will be put into the basic cell). The multiframe option set to False will overwrite the file
>>> interface.writepdb('layers.pdb',centered='no')

Note that if GITIM is used, and the symmetry option is different from 'planar', the centered='origin' option is equivalent to centered='middle'.