Weighting functions#

Weight functions used for spatial binned analysis modules.

maicos.lib.weights.density_weights(atomgroup, grouping, dens)[source]#

Weights for density calculations.

Parameters:
  • atomgroup (MDAnalysis.core.groups.AtomGroup) – atomgroup taken for weight calculation

  • grouping (str, {'atoms', 'residues', 'segments', 'molecules', 'fragments'}) – constituent to group weights with respect to

  • dens (str, {'mass', 'number', 'charge'}) – type of density weight

Returns:

1D array of calculated weights. The length depends on the grouping.

Return type:

numpy.ndarray

maicos.lib.weights.diporder_planar_weights(atomgroup, grouping, dim, order_parameter)[source]#

Weights for DiporderPlanar calculations.

Parameters:
  • atomgroup (MDAnalysis.core.groups.AtomGroup) – atomgroup taken for weight calculation

  • grouping (str, {'atoms', 'residues', 'segments', 'molecules', 'fragments'}) – constituent to group weights with respect to

  • dim ({0, 1, 2}) – direction of the projection

  • order_parameter (str, {'P0', 'cos_theta', 'cos_2_theta'}) – type of weight to be calculated

Returns:

1D array of calculated weights. The length depends on the grouping.

Return type:

numpy.ndarray

maicos.lib.weights.temperature_weights(ag, grouping)[source]#

Weights for temperature calculations.

Parameters:
  • atomgroup (MDAnalysis.core.groups.AtomGroup) – atomgroup taken for weight calculation

  • grouping (str, {'atoms', 'residues', 'segments', 'molecules', 'fragments'}) – constituent to group weights with respect to

Returns:

1D array of calculated weights. The length depends on the grouping.

Return type:

numpy.ndarray

Raises:

NotImplementedError – Currently only works for grouping=’atoms’

maicos.lib.weights.velocity_weights(atomgroup, grouping, vdim, flux)[source]#

Weights for velocity calculations.

The function either normalises by the number of compounds (to get the velocity) or does not normalise to get the flux (flux = velocity x number of compounds).

Parameters:
  • atomgroup (MDAnalysis.core.groups.AtomGroup) – atomgroup taken for weight calculation

  • grouping (str, {'atoms', 'residues', 'segments', 'molecules', 'fragments'}) – constituent to group weights with respect to

  • vdim (int, {0, 1, 2}) – direction of the velocity taken for the weights

  • flux (bool) – convert velocities into a flux

Returns:

1D array of calculated weights. The length depends on the grouping.

Return type:

numpy.ndarray