pwtools.crys.vmd_measure_gofr

pwtools.crys.vmd_measure_gofr(traj, dr=0.05, rmax='auto', sel=['all', 'all'], first=0, last=-1, step=1, usepbc=1, slicefirst=True, verbose=False, tmpdir=None)[source]

Call call_vmd_measure_gofr(), accept Structure / Trajectory as input. This is intended as a complementary function to rpdf() and should, of course, produce the “same” results.

Only orthogonal boxes are allowed (like in VMD).

Parameters:
  • traj (Structure or Trajectory)

  • dr (float) – dr in Angstrom

  • rmax ({'auto', float}, optional) –

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

    ’auto’ : the method of [Smith] is used to calculate the max. sphere
    raduis for any cell shape
    float : set value yourself

  • 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

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

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

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

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

  • slicefirst (bool, optional) – Whether to slice coords here in the wrapper based on first,last,step. This will write a smaller XSF file, which can save time. In the VMD script, we always use first=0,last=-1,step=1 in that case.

  • verbose (bool, optional) – display VMD output

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

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