Skip to content

Commit 26b82c3

Browse files
committed
improvements
1 parent e96d8ef commit 26b82c3

1 file changed

Lines changed: 12 additions & 57 deletions

File tree

README.rst

Lines changed: 12 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,17 @@
3737
miepython
3838
=========
3939

40-
**A pure Python library for Mie light scattering calculations**
41-
4240
|pypi| |github| |conda| |doi|
4341

4442
|license| |test| |docs| |downloads| |black|
4543

46-
--------
47-
48-
Overview
49-
--------
50-
5144
``miepython`` is a pure‑Python implementation of Mie theory for spherical
5245
scatterers, validated against Wiscombe's reference results. The library is
5346
lightweight, extensively tested, and—thanks to an *optional* Numba backend—can
54-
process nearly a **million particles per second**.
47+
process nearly a million particles per second.
48+
49+
Overview
50+
--------
5551

5652
- **Non-absorbing spheres** (dielectric particles)
5753
- **Partially-absorbing spheres** (lossy dielectrics)
@@ -113,29 +109,6 @@ Basic Example
113109
Backscatter efficiency: 0.573
114110
Scattering anisotropy: 0.192
115111
116-
Angular Scattering
117-
~~~~~~~~~~~~~~~~~~
118-
119-
.. code-block:: python
120-
121-
import numpy as np
122-
import matplotlib.pyplot as plt
123-
124-
# Calculate scattering at different angles
125-
angles = np.linspace(0, np.pi, 100)
126-
mu = np.cos(angles)
127-
128-
# Get parallel and perpendicular intensities
129-
I_par, I_per = mie.intensities(m, d, lambda0, mu)
130-
131-
# Plot results
132-
plt.figure(figsize=(8, 6))
133-
plt.semilogy(np.degrees(angles), I_par, label='Parallel')
134-
plt.semilogy(np.degrees(angles), I_per, label='Perpendicular')
135-
plt.xlabel('Scattering Angle (degrees)')
136-
plt.ylabel('Intensity (1/sr)')
137-
plt.legend()
138-
plt.show()
139112
140113
API Reference
141114
-------------
@@ -146,16 +119,18 @@ Core Functions
146119
=============================================== ===========================================================
147120
Function Purpose
148121
=============================================== ===========================================================
149-
``efficiencies(m, d, lambda0)`` Calculate extinction, scattering, backscattering, asymmetry
150-
``intensities(m, d, lambda0, mu)`` Angular scattering intensities for parallel/perpendicular polarization
122+
``efficiencies(m, d, lambda0, n_env=1)`` Calculate extinction, scattering, backscattering, asymmetry
123+
``intensities(m, d, lambda0, mu n_env=1)`` Angular scattering intensities for parallel/perpendicular polarization
151124
``S1_S2(m, x, mu)`` Complex scattering amplitudes
152125
``coefficients(m, x)`` Mie coefficients for field calculations
126+
``phase_matrix(m, x, mu)`` Mueller matrix for sphere
153127
=============================================== ===========================================================
154128

155129
Parameters
156130
~~~~~~~~~~
157131

158-
- **m** (complex): Refractive index of sphere relative to medium
132+
- **m** (complex): Complex refractive index of sphere
133+
- **n_env** (complex): Real refractive index of medium
159134
- **d** (float): Sphere diameter [same units as wavelength]
160135
- **lambda0** (float): Wavelength in vacuum [same units as diameter]
161136
- **x** (float): Size parameter (π×diameter/wavelength)
@@ -260,9 +235,6 @@ Gold Nanoparticles
260235
Important Conventions
261236
---------------------
262237

263-
.. warning::
264-
**Key assumptions in miepython:**
265-
266238
1. **Negative imaginary refractive index**: For absorbing materials, use ``m = n - ik`` where k > 0
267239
2. **Albedo normalization**: Scattering phase functions integrate to the single scattering albedo over 4π steradians (customizable)
268240

@@ -271,7 +243,7 @@ Important Conventions
271243
Version 3.0 Breaking Changes
272244
----------------------------
273245

274-
Version 3.0 introduces significant API changes and new functionality:
246+
Version 3.0 introduced significant API changes and new functionality:
275247

276248
New Features
277249
~~~~~~~~~~~~
@@ -289,24 +261,6 @@ If you need the old API, pin to version 2.5.5::
289261

290262
For new projects, use v3.0+ to access the latest features and improvements.
291263

292-
Advanced Usage
293-
--------------
294-
295-
Multiple Wavelengths
296-
~~~~~~~~~~~~~~~~~~~~
297-
298-
.. code-block:: python
299-
300-
# Wavelength-dependent calculations
301-
wavelengths = np.linspace(400, 700, 100) # nm
302-
diameters = np.full_like(wavelengths, 200) # 200 nm spheres
303-
304-
results = []
305-
for wl, d in zip(wavelengths, diameters):
306-
qext, qsca, qback, g = mie.efficiencies(m, d, wl)
307-
results.append([qext, qsca, qback, g])
308-
309-
results = np.array(results)
310264

311265
Custom Normalization
312266
~~~~~~~~~~~~~~~~~~~~
@@ -329,7 +283,8 @@ Documentation
329283
Citation
330284
--------
331285

332-
If you use miepython in your research, please cite:
286+
If you use miepython in your research, use the zenodo link |doi| to cite
287+
the version of miepython that you used:
333288

334289
.. code-block:: bibtex
335290

0 commit comments

Comments
 (0)