pwtools.crys.call_vmd_measure_gofr

pwtools.crys.call_vmd_measure_gofr(trajfn, dr=None, rmax=None, sel=['all', 'all'], fntype='xsf', first=0, last=-1, step=1, usepbc=1, datafn=None, scriptfn=None, logfn=None, tmpdir=None, verbose=False)[source]

Call VMD’s “measure gofr” command. This is a simple interface which does in fact the same thing as the gofr GUI, only scriptable. Accepts a file with trajectory data.

Only orthogonal boxes are allowed (like in VMD).

Parameters:
  • trajfn (filename of trajectory which is fed to VMD (e.g. foo.axsf))

  • dr (float) – dr in Angstrom

  • rmax (float) – Max. radius up to which minimum image nearest neighbors are counted. For cubic boxes of side length L, this is L/2 [AT,MD].

  • sel (list of two strings, optional) – string to select atoms, [“name Ca”, “name O”], [“all”, “all”], …, where sel[0] is selection 1, sel[1] is selection 2 in VMD

  • fntype (str, optional) – file type of fn for the VMD “mol” command

  • first (int, optional) – Select which MD steps are averaged. Like Python, VMD starts counting at 0. Last is -1, like in Python.

  • last (int, optional) – Select which MD steps are averaged. Like Python, VMD starts counting at 0. Last is -1, like in Python.

  • step (int, optional) – Select which MD steps are averaged. Like Python, VMD starts counting at 0. Last is -1, like in Python.

  • usepbc (int {1,0}, optional) – Whether to use the minimum image convention.

  • datafn (str, optional) – temp file where VMD results are written to and loaded

  • scriptfn (str, optional) – temp file where VMD tcl input script is written to

  • logfn (str, optional) – file where VMD output is logged

  • tmpdir (str, optional) – dir where auto-generated tmp files are written

  • verbose (bool, optional) – display VMD output

Returns:

  • array (len(rad), 3), colums 0,1,2

  • rad (1d array) – radius (x-axis) with spacing dr, each value r[i] is the middle of a histogram bin

  • hist (1d array, (len(rad),)) – the function values g(r)

  • num_int (1d array, (len(rad),)) – the (averaged) number integral number_density*hist*4*pi*r**2.0*dr