Output clusters with only a certain size

Hi everyone,

I am doing a cluster analysis in OVITO and I am looking at clusters with a size of 3. I export the cluster analysis data as .xyz in order to further analyse them and separate H2O from other clusters with 3 atoms (SiO2, HO2 etc.), but also because I want the atom velocities. When I save the data though it also saves all other clusters with different sizes.

Is there a way to only select and export clusters with a certain size, either using a modifier of a python script?

Thanks,

Anastasis

Hi,

Yes, In OVITO Pro, you can use a Python script modifier to look up the Cluster identifiers for all Clusters with a size of 3 in the Cluster list data table generated by the Cluster analysis modifier. This information can then be used to filter and remove all particles from the scene that do not correspond to the identified Cluster particle property values, e.g.,

    cluster_ids = data.tables['clusters']['Cluster Identifier'][data.tables['clusters']['Cluster Size'] == 3]

Please don’t hesitate to contact OVITO Pro support via email if you need additional assistance with developing your code.