yasfpy.particles ================ .. py:module:: yasfpy.particles .. autoapi-nested-parse:: Particle container and derived geometry helpers. This module defines :class:`~yasfpy.particles.Particles`, a lightweight container for particle positions, radii, and material assignments used as input to a :class:`~yasfpy.parameters.Parameters` object. Classes ------- .. autoapisummary:: yasfpy.particles.Particles Functions --------- .. autoapisummary:: yasfpy.particles.radius_of_gyration Module Contents --------------- .. py:class:: Particles(position, r, refractive_index, refractive_index_table = None, shape_type = 'sphere') The `Particles` class represents a collection of particles with various properties such as position, radius, and refractive index, and provides methods for computing unique properties and characteristics of the particles. .. py:attribute:: position .. py:attribute:: r .. py:attribute:: refractive_index .. py:attribute:: type :value: 'sphere' .. py:attribute:: log .. py:attribute:: refractive_index_table :value: None .. py:attribute:: number .. py:method:: compute_unique_refractive_indices() Computes the unique refractive indices and their indices. .. py:method:: compute_unique_radii() The function computes the unique radii from an array and stores them in a variable. .. py:method:: compute_unique_radii_index_pairs() The function computes unique pairs of radii and refractive indices and stores them in different arrays. .. py:method:: compute_single_unique_idx() The function computes a single unique index based on the sum of pairs of values and their corresponding indices. .. py:method:: compute_maximal_particle_distance() The function computes the maximum distance between particles using the ConvexHull algorithm. .. py:method:: compute_volume_equivalent_area() The function computes the volume equivalent area by calculating the geometric projection. .. py:method:: radius_of_gyration() Compute the radius of gyration for this particle cluster. :returns: Radius of gyration of the cluster. :rtype: float .. seealso:: :py:obj:`radius_of_gyration` Functional form operating on arrays. .. py:function:: radius_of_gyration(positions, radii) Compute the radius of gyration of a cluster of spheres. :param positions: Array of particle centers with shape ``(n, 3)``. :param radii: Array of particle radii with shape ``(n,)``. :returns: Radius of gyration of the cluster. :rtype: float :raises ValueError: If input shapes do not match expectations. .. rubric:: Notes Assumes unit density, so particle mass is proportional to volume.