yasfpy.particles#
Particle container and derived geometry helpers.
This module defines Particles, a lightweight container
for particle positions, radii, and material assignments used as input to a
Parameters object.
Classes#
The Particles class represents a collection of particles with various properties such as position, |
Functions#
|
Compute the radius of gyration of a cluster of spheres. |
Module Contents#
- class yasfpy.particles.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.
- position#
- r#
- refractive_index#
- type = 'sphere'#
- log#
- refractive_index_table = None#
- number#
- compute_unique_refractive_indices()#
Computes the unique refractive indices and their indices.
- compute_unique_radii()#
The function computes the unique radii from an array and stores them in a variable.
- compute_unique_radii_index_pairs()#
The function computes unique pairs of radii and refractive indices and stores them in different arrays.
- compute_single_unique_idx()#
The function computes a single unique index based on the sum of pairs of values and their corresponding indices.
- compute_maximal_particle_distance()#
The function computes the maximum distance between particles using the ConvexHull algorithm.
- compute_volume_equivalent_area()#
The function computes the volume equivalent area by calculating the geometric projection.
- radius_of_gyration()#
Compute the radius of gyration for this particle cluster.
- Returns:
Radius of gyration of the cluster.
- Return type:
See also
radius_of_gyrationFunctional form operating on arrays.
- yasfpy.particles.radius_of_gyration(positions, radii)#
Compute the radius of gyration of a cluster of spheres.
- Parameters:
positions – Array of particle centers with shape
(n, 3).radii – Array of particle radii with shape
(n,).
- Returns:
Radius of gyration of the cluster.
- Return type:
- Raises:
ValueError – If input shapes do not match expectations.
Notes
Assumes unit density, so particle mass is proportional to volume.