Weighting functions#

Weight functions used for spatial binned analysis modules.

maicos.lib.weights.density_weights(atomgroup: AtomGroup, grouping: str, dens: str) ndarray[source]#

Weights for density calculations.

Parameters:
  • atomgroup (MDAnalysis.core.groups.AtomGroup) – A AtomGroup for which the calculations are performed.

  • grouping ({"atoms", "residues", "segments", "molecules", "fragments"}) –

    Atom grouping for the calculations.

    The possible grouping options are the atom positions (in the case where grouping="atoms") or the center of mass of the specified grouping unit (in the case where grouping="residues", "segments", "molecules" or "fragments").

  • dens ({"mass", "number", "charge"}) – density type to be calculated.

Returns:

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

Return type:

numpy.ndarray

Raises:

ValueError – if grouping or dens parameter is not supported.

maicos.lib.weights.diporder_pair_weights(g1: AtomGroup, g2: AtomGroup, compound: str) ndarray[source]#

Normalized dipole moments as weights for general diporder RDF calculations.

maicos.lib.weights.diporder_weights(atomgroup: AtomGroup, grouping: str, order_parameter: str, get_unit_vectors: Unit_vector) ndarray[source]#

Weights for general diporder calculations.

Parameters:
  • atomgroup (MDAnalysis.core.groups.AtomGroup) – A AtomGroup for which the calculations are performed.

  • grouping ({"atoms", "residues", "segments", "molecules", "fragments"}) –

    Atom grouping for the calculations.

    The possible grouping options are the atom positions (in the case where grouping="atoms") or the center of mass of the specified grouping unit (in the case where grouping="residues", "segments", "molecules" or "fragments").

  • order_parameter ({"P0", "cos_theta", "cos_2_theta"}) –

    Order parameter to be calculated:
    • "P0": total dipole moment projected on an axis

    • "cos_theta": cosine of the dipole moment with an axis

    • "cos_2_theta": squred cosine with an axis.

  • get_unit_vectors (Callable) – Callable that returns unit vectors on which the projection is performed. Returned unit_vectors can either be of shape (3,) or of shape (n, 3). For a shape of (3,) the same unit vector is used for all calculations.

maicos.lib.weights.temperature_weights(atomgroup: AtomGroup, grouping: str) ndarray[source]#

Weights for temperature calculations.

Parameters:
  • atomgroup (MDAnalysis.core.groups.AtomGroup) – A AtomGroup for which the calculations are performed.

  • grouping ({"atoms", "residues", "segments", "molecules", "fragments"}) –

    Atom grouping for the calculations.

    The possible grouping options are the atom positions (in the case where grouping="atoms") or the center of mass of the specified grouping unit (in the case where grouping="residues", "segments", "molecules" or "fragments").

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: AtomGroup, grouping: str, vdim: int) ndarray[source]#

Weights for velocity calculations.

The function normalises by the number of compounds.

Parameters:
  • atomgroup (MDAnalysis.core.groups.AtomGroup) – A AtomGroup for which the calculations are performed.

  • grouping ({"atoms", "residues", "segments", "molecules", "fragments"}) –

    Atom grouping for the calculations.

    The possible grouping options are the atom positions (in the case where grouping="atoms") or the center of mass of the specified grouping unit (in the case where grouping="residues", "segments", "molecules" or "fragments"). vdim : {0, 1, 2} Dimension for velocity binning (x=0, y=1, z=1).

Returns:

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

Return type:

numpy.ndarray