polypy.density

Density functions included with polypy. The Density class will determine generate a three dimensional grid that stores the total number of times that an atom spends within a xyz grid point during the simulation.

class polypy.density.Density(data, histogram_size=0.1, atom=None)[source]

Bases: object

The polypy.density.Density class evaluates the positions of all atoms in the simulation.

Parameters:
  • data (polypy.read.Trajectory) – Object containing the information from the HISTORY or ARCHIVE files.
  • histogram_size (float, optional) – Specifies the spacing between histograms.
  • atom (str, optional) – Specifies the atom to calculate the density for.
build_map()[source]

Constructs three dimensional grid of histogram_size * histogram_size * histogram_size. containing a count for how many times an atom passes through each histogram_size ** 3 cube.

find_limits()[source]

Determine the upper and lower limits of the simulation cell in all three dimensions.

one_dimensional_density(direction='x')[source]

Calculate the particle density within one dimensional histograms of a structure.

Parameters:direction (str) – The dimension perpendicular to the histograms.
Returns:Locations of histograms. y (array_like): Size of histograms. bin_volume (float): Volume of histograms.
Return type:x (array_like)
two_dimensional_density(direction='x')[source]

Calculate the particle density within two dimensional pixels of a structure.

Parameters:direction (str) – The dimension normal to the pixels.
Returns:Locations of one dimension of the pixels. y (array_like): Locations of one dimension of the pixels. z (array_like): Size of pixels. bin_volume (float): Volume of pixels.
Return type:x (array_like)
update_map(position)[source]

Determines the specific location of a given atom and adds it to the corresponding location in the three dimensional map of atomic positions.