molsysmt.structure.move_away#
- molsysmt.structure.move_away(molecular_system, selection='all', center_of_selection='all', weights=None, structure_indices=0, reference_molecular_system=None, reference_center_of_selection='all', reference_weights=None, reference_structure_indices=None, direction=None, distance='3 angstroms', in_place=False, syntax='MolSysMT', skip_digestion=False)[source]#
Translate a selection of atoms away from a reference center by a fixed distance.
Two operating modes are available depending on whether
directionis provided:Auto direction (
direction=None): the displacement direction is computed automatically as the unit vector pointing from the center ofreference_center_of_selectionto the center ofcenter_of_selection. The atoms inselectionare then translated bydistancealong that direction.Explicit direction: the selection is first centered on the reference center (via
molsysmt.structure.center), then translated bydistancealong the supplied unit vector. Only single-frame / single-group use is supported in this mode.
- Parameters:
molecular_system (molecular system) – Molecular system in any supported MolSysMT format.
selection (str, list, tuple, or numpy.ndarray, default='all') – Selection string or boolean/integer array specifying elements.
center_of_selection (str, list, tuple, or numpy.ndarray, or None, default='all') – Atoms whose center defines the translation reference.
weights (numpy.ndarray, list, or tuple, default=None) – Atomic mass weights array for center calculation.
structure_indices (int, list, tuple, or numpy.ndarray, default=0) – Structure indices (0-based) to include or process.
reference_molecular_system (molecular system or None, default=None) – Reference molecular system; None uses the input molecular system.
reference_center_of_selection (str, list, tuple, or numpy.ndarray, default='all') – Atoms whose center defines the reference position.
reference_weights (str, list, tuple, numpy.ndarray, or None, default=None) – Weights used to calculate the reference center.
reference_structure_indices (int, list, tuple, numpy.ndarray, or None, default=None) – Zero-based structures used to calculate the reference center.
direction (array-like or None, default=None) – Direction of displacement; None uses the vector between the two centers.
distance (PyUnitWizard quantity, default='3 angstroms') – Requested separation between the selected centers, in units of length.
in_place (bool, default=False) – Whether to modify the input molecular system in place.
syntax (str, default='MolSysMT') – Selection syntax used to evaluate selection (e.g., ‘MolSysMT’, ‘MDTraj’).
skip_digestion (bool, default=False) – Whether to skip MolSysMT’s internal argument digestion mechanism.
- Returns:
A new molecular system with the displaced coordinates when
in_place=False;Nonewhenin_place=True.- Return type:
molecular system or None
- Raises:
NotImplementedMethodError – When called with an explicit
directionand more than one frame or more than one group — not yet implemented for that case.
Added in version 1.0.0.