1

**Support Forum / Re: Particle count on multiple selected clusters**

« **on:**May 17, 2019, 05:24:40 PM »

Hi shanis,

do I understand you correctly that you want to export all individual cluster ID's along with your custom property "Cluster size"?

In that case, if you have used numpy.bincount() to calculate the number of C-atoms in your different clusters

occuring Cluster ID. You could use numpy.where() to filter out clusters smaller or larger than a certain size

and then e.g. numpy.savetxt() to export this to a textfile.

-Constanze

do I understand you correctly that you want to export all individual cluster ID's along with your custom property "Cluster size"?

In that case, if you have used numpy.bincount() to calculate the number of C-atoms in your different clusters

Code: [Select]

`cluster_sizes = numpy.bincount( data.particles['Cluster'][ptype == C_type_id])`

you already got the information you would like to export. "cluster_sizes" is an ndarray of length max(Cluster ID's) +1 that contains a bincount (i.e. the cluster sizes) of each occuring Cluster ID. You could use numpy.where() to filter out clusters smaller or larger than a certain size

and then e.g. numpy.savetxt() to export this to a textfile.

-Constanze