/ReduceProperty

Apply reduction operations to OVITO properties

Primary LanguagePythonMIT LicenseMIT

Reduce Property

Apply common reduction operations to properties in the DataCollection

Description

Apply one of the following reduction operations to a selected property. If the property as multiple components, e.g. position, the reduction operation is applied for each component.

Operations:

- Mean
- Median
- Standard Deviation
- Variance
- Minimum
- Maximum
- Sum
- Non-zero

Parameters

  • input_container : ovito.data.DataObject.Ref / "Container": Container from which a property is selcted.
  • input_property: str / "Property": Property to which the reduction operation will be applied.
  • operation : str / "Operation": Reduction operation to apply to the selected property.
  • only_selected : bool / "Reduce only selected elements": Apply reduction operation only to selected entries in the property array. Requires the "Selection" property to be present in the container.

The output is stored in a global attribute under the <container>_<property>_<operation> key.

Example

Example_01

# Reduce Property:
pipeline.modifiers.append(
    ReduceProperty(
        input_container=DataObject.Ref(Particles, "particles"),
        input_property="Velocity",
    )
)

Installation

Technical information / dependencies

  • Tested on OVITO version 3.11.0

Contact