Particles
Particles
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.
Initializes an object with position, radius, refractive index, refractive index table, and shape type attributes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
position |
array
|
A numpy array representing the position of the shape. |
required |
r |
array
|
A numpy array containing the radius values for each shape in the system. |
required |
refractive_index |
array
|
A numpy array representing the refractive index of the shape. It can be either a complex number or a two-column matrix. |
required |
refractive_index_table |
list
|
A list containing the refractive index values for different materials. Each element in the list represents a material, and the refractive index values for that material are stored as a complex number. |
None
|
shape_type |
str
|
A string specifying the type of shape for the object. Defaults to "sphere" or any other supported shape type. |
'sphere'
|
Source code in yasfpy/particles.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
|
position = position
instance-attribute
r = r
instance-attribute
refractive_index = refractive_index
instance-attribute
type = shape_type
instance-attribute
log = log.scattering_logger(__name__)
instance-attribute
refractive_index_table = refractive_index_table
instance-attribute
number = r.shape[0]
instance-attribute
generate_refractive_index_table
staticmethod
The function generate_refractive_index_table
takes a list of URLs, retrieves data from each
URL using the material_handler
function, and returns a list of the retrieved data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
urls |
list
|
A list of URLs representing different materials. |
required |
Returns:
Name | Type | Description |
---|---|---|
data |
list
|
A list of data. Each element in the list corresponds to a URL in the input list,
and the data is obtained by calling the |
Source code in yasfpy/particles.py
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
|
compute_unique_refractive_indices
Computes the unique refractive indices and their indices.
Source code in yasfpy/particles.py
82 83 84 85 86 87 |
|
compute_unique_radii
The function computes the unique radii from an array and stores them in a variable.
Source code in yasfpy/particles.py
89 90 91 92 93 94 |
|
compute_unique_radii_index_pairs
The function computes unique pairs of radii and refractive indices and stores them in different arrays.
Source code in yasfpy/particles.py
96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
|
compute_single_unique_idx
The function computes a single unique index based on the sum of pairs of values and their corresponding indices.
Source code in yasfpy/particles.py
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 |
|
compute_maximal_particle_distance
The function computes the maximum distance between particles using the ConvexHull algorithm.
Source code in yasfpy/particles.py
133 134 135 136 137 |
|
compute_volume_equivalent_area
The function computes the volume equivalent area by calculating the geometric projection.
Source code in yasfpy/particles.py
139 140 141 142 |
|
__setup_impl
The function sets up various computations related to refractive indices, radii, and particle distances.
Source code in yasfpy/particles.py
144 145 146 147 148 149 150 151 152 153 154 |
|