miepython 2.3.2__tar.gz → 2.5.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {miepython-2.3.2 → miepython-2.5.0}/CHANGELOG.rst +8 -0
- miepython-2.5.0/CITATION.cff +10 -0
- {miepython-2.3.2 → miepython-2.5.0}/Makefile +0 -1
- {miepython-2.3.2/miepython.egg-info → miepython-2.5.0}/PKG-INFO +1 -7
- {miepython-2.3.2 → miepython-2.5.0}/README.rst +0 -6
- {miepython-2.3.2 → miepython-2.5.0}/docs/index.rst +6 -10
- {miepython-2.3.2 → miepython-2.5.0}/miepython/__init__.py +6 -1
- {miepython-2.3.2 → miepython-2.5.0}/miepython/miepython.py +56 -12
- {miepython-2.3.2 → miepython-2.5.0}/miepython/miepython_nojit.py +58 -16
- {miepython-2.3.2 → miepython-2.5.0/miepython.egg-info}/PKG-INFO +1 -7
- miepython-2.3.2/CITATION.cff +0 -40
- {miepython-2.3.2 → miepython-2.5.0}/.github/workflows/test.yml +0 -0
- {miepython-2.3.2 → miepython-2.5.0}/.gitignore +0 -0
- {miepython-2.3.2 → miepython-2.5.0}/.readthedocs.yaml +0 -0
- {miepython-2.3.2 → miepython-2.5.0}/.testignore +0 -0
- {miepython-2.3.2 → miepython-2.5.0}/LICENSE.txt +0 -0
- {miepython-2.3.2 → miepython-2.5.0}/MANIFEST.in +0 -0
- {miepython-2.3.2 → miepython-2.5.0}/docs/01_basics.ipynb +0 -0
- {miepython-2.3.2 → miepython-2.5.0}/docs/01_plot.png +0 -0
- {miepython-2.3.2 → miepython-2.5.0}/docs/02_efficiencies.ipynb +0 -0
- {miepython-2.3.2 → miepython-2.5.0}/docs/02_plot.png +0 -0
- {miepython-2.3.2 → miepython-2.5.0}/docs/03_angular_scattering.ipynb +0 -0
- {miepython-2.3.2 → miepython-2.5.0}/docs/03_plot.png +0 -0
- {miepython-2.3.2 → miepython-2.5.0}/docs/03a_normalization.ipynb +0 -0
- {miepython-2.3.2 → miepython-2.5.0}/docs/04_plot.png +0 -0
- {miepython-2.3.2 → miepython-2.5.0}/docs/04_rayleigh.ipynb +0 -0
- {miepython-2.3.2 → miepython-2.5.0}/docs/05_fog.ipynb +0 -0
- {miepython-2.3.2 → miepython-2.5.0}/docs/06_random_deviates.ipynb +0 -0
- {miepython-2.3.2 → miepython-2.5.0}/docs/07_algorithm.ipynb +0 -0
- {miepython-2.3.2 → miepython-2.5.0}/docs/08_large_spheres.ipynb +0 -0
- {miepython-2.3.2 → miepython-2.5.0}/docs/09_backscattering.ipynb +0 -0
- {miepython-2.3.2 → miepython-2.5.0}/docs/10_basic_tests.ipynb +0 -0
- {miepython-2.3.2 → miepython-2.5.0}/docs/11_performance.ipynb +0 -0
- {miepython-2.3.2 → miepython-2.5.0}/docs/changelog.rst +0 -0
- {miepython-2.3.2 → miepython-2.5.0}/docs/conf.py +0 -0
- {miepython-2.3.2 → miepython-2.5.0}/docs/miepython.rst +0 -0
- {miepython-2.3.2 → miepython-2.5.0}/docs/requirements.txt +0 -0
- {miepython-2.3.2 → miepython-2.5.0}/miepython/data/Johnson.txt +0 -0
- {miepython-2.3.2 → miepython-2.5.0}/miepython/data/ag-Johnson.txt +0 -0
- {miepython-2.3.2 → miepython-2.5.0}/miepython/data/segelstein81_index.txt +0 -0
- {miepython-2.3.2 → miepython-2.5.0}/miepython/examples/01_dielectric.py +0 -0
- {miepython-2.3.2 → miepython-2.5.0}/miepython/examples/02_glass.py +0 -0
- {miepython-2.3.2 → miepython-2.5.0}/miepython/examples/03_droplets.py +0 -0
- {miepython-2.3.2 → miepython-2.5.0}/miepython/examples/04_gold.py +0 -0
- {miepython-2.3.2 → miepython-2.5.0}/miepython.egg-info/SOURCES.txt +0 -0
- {miepython-2.3.2 → miepython-2.5.0}/miepython.egg-info/dependency_links.txt +0 -0
- {miepython-2.3.2 → miepython-2.5.0}/miepython.egg-info/requires.txt +0 -0
- {miepython-2.3.2 → miepython-2.5.0}/miepython.egg-info/top_level.txt +0 -0
- {miepython-2.3.2 → miepython-2.5.0}/pyproject.toml +0 -0
- {miepython-2.3.2 → miepython-2.5.0}/release.txt +0 -0
- {miepython-2.3.2 → miepython-2.5.0}/requirements-dev.txt +0 -0
- {miepython-2.3.2 → miepython-2.5.0}/requirements.txt +0 -0
- {miepython-2.3.2 → miepython-2.5.0}/setup.cfg +0 -0
- {miepython-2.3.2 → miepython-2.5.0}/setup.py +0 -0
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
Changelog
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
+
v2.5.0 (8/4/2023)
|
|
5
|
+
-------------------
|
|
6
|
+
* fix scattering function for very small spheres
|
|
7
|
+
|
|
8
|
+
v2.4.0 (6/10/2023)
|
|
9
|
+
-------------------
|
|
10
|
+
* add mie_phase_matrix() to calculate scattering (Mueller) matrix
|
|
11
|
+
|
|
4
12
|
v2.3.2
|
|
5
13
|
-------------------
|
|
6
14
|
* fix typo in README.rst that prevented pypi upload
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
cff-version: 1.2.0
|
|
2
|
+
title: 'miepython: Pure python implementation of Mie scattering'
|
|
3
|
+
message: 'If you use this software, please cite it as below.'
|
|
4
|
+
|
|
5
|
+
authors:
|
|
6
|
+
- given-names: Scott
|
|
7
|
+
family-names: Prahl
|
|
8
|
+
orcid: 'https://orcid.org/0000-0003-1468-6851'
|
|
9
|
+
doi: 10.5281/zenodo.7949264
|
|
10
|
+
url: 'https://doi.org/10.5281/zenodo.7949403'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: miepython
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.5.0
|
|
4
4
|
Summary: Mie scattering of a plane wave by a sphere
|
|
5
5
|
Home-page: https://github.com/scottprahl/miepython.git
|
|
6
6
|
Author: Scott Prahl
|
|
@@ -25,15 +25,9 @@ by Scott Prahl
|
|
|
25
25
|
.. image:: https://img.shields.io/pypi/v/miepython.svg
|
|
26
26
|
:target: https://pypi.org/project/miepython/
|
|
27
27
|
|
|
28
|
-
.. image:: https://colab.research.google.com/assets/colab-badge.svg
|
|
29
|
-
:target: https://colab.research.google.com/github/scottprahl/miepython/blob/master
|
|
30
|
-
|
|
31
28
|
.. image:: https://img.shields.io/badge/readthedocs-latest-blue.svg
|
|
32
29
|
:target: https://miepython.readthedocs.io
|
|
33
30
|
|
|
34
|
-
.. image:: https://img.shields.io/badge/github-code-green.svg
|
|
35
|
-
:target: https://github.com/scottprahl/miepython
|
|
36
|
-
|
|
37
31
|
.. image:: https://img.shields.io/badge/MIT-license-yellow.svg
|
|
38
32
|
:target: https://github.com/scottprahl/miepython/blob/master/LICENSE.txt
|
|
39
33
|
|
|
@@ -6,15 +6,9 @@ by Scott Prahl
|
|
|
6
6
|
.. image:: https://img.shields.io/pypi/v/miepython.svg
|
|
7
7
|
:target: https://pypi.org/project/miepython/
|
|
8
8
|
|
|
9
|
-
.. image:: https://colab.research.google.com/assets/colab-badge.svg
|
|
10
|
-
:target: https://colab.research.google.com/github/scottprahl/miepython/blob/master
|
|
11
|
-
|
|
12
9
|
.. image:: https://img.shields.io/badge/readthedocs-latest-blue.svg
|
|
13
10
|
:target: https://miepython.readthedocs.io
|
|
14
11
|
|
|
15
|
-
.. image:: https://img.shields.io/badge/github-code-green.svg
|
|
16
|
-
:target: https://github.com/scottprahl/miepython
|
|
17
|
-
|
|
18
12
|
.. image:: https://img.shields.io/badge/MIT-license-yellow.svg
|
|
19
13
|
:target: https://github.com/scottprahl/miepython/blob/master/LICENSE.txt
|
|
20
14
|
|
|
@@ -1,24 +1,20 @@
|
|
|
1
1
|
miepython
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
+
by Scott Prahl
|
|
5
|
+
|
|
4
6
|
.. image:: https://img.shields.io/pypi/v/miepython.svg
|
|
5
7
|
:target: https://pypi.org/project/miepython/
|
|
6
8
|
|
|
7
|
-
.. image:: https://colab.research.google.com/assets/colab-badge.svg
|
|
8
|
-
:target: https://colab.research.google.com/github/scottprahl/miepython/blob/master
|
|
9
|
-
|
|
10
|
-
.. image:: https://img.shields.io/badge/readthedocs-latest-blue.svg
|
|
11
|
-
:target: https://miepython.readthedocs.io
|
|
12
|
-
|
|
13
9
|
.. image:: https://img.shields.io/badge/github-code-green.svg
|
|
14
10
|
:target: https://github.com/scottprahl/miepython
|
|
15
11
|
|
|
16
|
-
.. image:: https://img.shields.io/badge/MIT-license-yellow.svg
|
|
17
|
-
:target: https://github.com/scottprahl/miepython/blob/master/LICENSE.txt
|
|
18
|
-
|
|
19
12
|
.. image:: https://github.com/scottprahl/miepython/actions/workflows/test.yml/badge.svg
|
|
20
13
|
:target: https://github.com/scottprahl/miepython/actions/workflows/test.yml
|
|
21
14
|
|
|
15
|
+
.. image:: https://zenodo.org/badge/99259684.svg
|
|
16
|
+
:target: https://zenodo.org/badge/latestdoi/99259684
|
|
17
|
+
|
|
22
18
|
----
|
|
23
19
|
|
|
24
20
|
``miepython`` is a pure Python module to calculate light scattering by
|
|
@@ -47,7 +43,7 @@ Using miepython
|
|
|
47
43
|
|
|
48
44
|
1. You can install locally using pip::
|
|
49
45
|
|
|
50
|
-
pip install
|
|
46
|
+
pip install miepython
|
|
51
47
|
|
|
52
48
|
2. or `run this code in the cloud using Google Collaboratory <https://colab.research.google.com/github/scottprahl/miepython/blob/master>`_ by selecting the Jupyter notebook that interests you.
|
|
53
49
|
|
|
@@ -36,8 +36,13 @@ Mie scattering intensities normalized to one when integrated over all angles::
|
|
|
36
36
|
miepython.i_per(m, x, mu, norm='one')
|
|
37
37
|
miepython.i_par(m, x, mu, norm='one')
|
|
38
38
|
miepython.i_unpolarized(m, x, mu, norm='one')
|
|
39
|
+
|
|
40
|
+
The scattering matrix
|
|
41
|
+
|
|
42
|
+
miepython.mie_phase_matrix(m, x, mu)
|
|
43
|
+
|
|
39
44
|
"""
|
|
40
|
-
__version__ = '2.
|
|
45
|
+
__version__ = '2.5.0'
|
|
41
46
|
__author__ = 'Scott Prahl'
|
|
42
47
|
__email__ = 'scott.prahl@oit.edu'
|
|
43
48
|
__copyright__ = 'Copyright 2017-23, Scott Prahl'
|
|
@@ -50,6 +50,7 @@ __all__ = ('ez_mie',
|
|
|
50
50
|
'i_unpolarized',
|
|
51
51
|
'mie',
|
|
52
52
|
'mie_S1_S2',
|
|
53
|
+
'mie_phase_matrix',
|
|
53
54
|
'mie_cdf',
|
|
54
55
|
'mie_mu_with_uniform_cdf',
|
|
55
56
|
'generate_mie_costheta',
|
|
@@ -475,8 +476,8 @@ def _small_mie_S1_S2(m, x, mu):
|
|
|
475
476
|
return [S1, S2]
|
|
476
477
|
|
|
477
478
|
|
|
478
|
-
@njit((complex128
|
|
479
|
-
def normalization_factor(
|
|
479
|
+
@njit((complex128, float64, int32), cache=True)
|
|
480
|
+
def normalization_factor(m, x, norm_int):
|
|
480
481
|
"""
|
|
481
482
|
Figure out scattering function normalization.
|
|
482
483
|
|
|
@@ -491,7 +492,7 @@ def normalization_factor(a, b, x, norm_int):
|
|
|
491
492
|
"""
|
|
492
493
|
# Qsca normalization
|
|
493
494
|
if norm_int == 3:
|
|
494
|
-
return np.sqrt(np.pi
|
|
495
|
+
return x * np.sqrt(np.pi)
|
|
495
496
|
|
|
496
497
|
# Bohren Normalization
|
|
497
498
|
if norm_int == 5:
|
|
@@ -502,26 +503,23 @@ def normalization_factor(a, b, x, norm_int):
|
|
|
502
503
|
return 1
|
|
503
504
|
|
|
504
505
|
# calculate qsca and qext
|
|
505
|
-
|
|
506
|
-
cn = 2.0 * n + 1.0
|
|
507
|
-
qext = 2 * np.sum(cn * (a.real + b.real)) / x**2
|
|
508
|
-
qsca = 2 * np.sum(cn * (np.abs(a)**2 + np.abs(b)**2)) / x**2
|
|
506
|
+
qext, qsca, _, _ = _mie_scalar(m, x)
|
|
509
507
|
|
|
510
508
|
# albedo Normalization
|
|
511
509
|
if norm_int == 0:
|
|
512
|
-
return np.sqrt(np.pi *
|
|
510
|
+
return x * np.sqrt(np.pi * qext)
|
|
513
511
|
|
|
514
512
|
# Unity normalization
|
|
515
513
|
if norm_int == 1:
|
|
516
|
-
return np.sqrt(qsca * np.pi
|
|
514
|
+
return x * np.sqrt(qsca * np.pi)
|
|
517
515
|
|
|
518
516
|
# 4pi Normalization
|
|
519
517
|
if norm_int == 2:
|
|
520
|
-
return np.sqrt(qsca
|
|
518
|
+
return x * np.sqrt(qsca / 4)
|
|
521
519
|
|
|
522
520
|
# Qext Normalization
|
|
523
521
|
if norm_int == 4: # 4pi
|
|
524
|
-
return np.sqrt(qsca * np.pi
|
|
522
|
+
return x * np.sqrt(qsca * np.pi / qext)
|
|
525
523
|
|
|
526
524
|
raise ValueError("norm-int must be in the range 0..6")
|
|
527
525
|
|
|
@@ -608,7 +606,7 @@ def _mie_S1_S2(m, x, mu, norm_int):
|
|
|
608
606
|
pi_nm1 = ((2 * n + 1) * mu[k] * pi_nm1 - (n + 1) * pi_nm2) / n
|
|
609
607
|
pi_nm2 = temp
|
|
610
608
|
|
|
611
|
-
normalization = normalization_factor(
|
|
609
|
+
normalization = normalization_factor(m, x, norm_int)
|
|
612
610
|
|
|
613
611
|
S1 /= normalization
|
|
614
612
|
S2 /= normalization
|
|
@@ -642,6 +640,52 @@ def mie_S1_S2(m, x, mu, norm='albedo'):
|
|
|
642
640
|
return _mie_S1_S2(m, x, mu, norm_int)
|
|
643
641
|
|
|
644
642
|
|
|
643
|
+
def mie_phase_matrix(m, x, mu, norm='albedo'):
|
|
644
|
+
"""
|
|
645
|
+
Calculate the scattering (Mueller) matrix.
|
|
646
|
+
|
|
647
|
+
If mu has length N, then the returned matrix is 4x4xN. If mu is a scalar
|
|
648
|
+
then the matrix is 4x4
|
|
649
|
+
|
|
650
|
+
The phase scattering matrix is computed from the scattering amplitude
|
|
651
|
+
functions, according to equations 5.2.105-6 in K. N. Liou (**2002**) -
|
|
652
|
+
*An Introduction to Atmospheric Radiation*, Second Edition.
|
|
653
|
+
|
|
654
|
+
or
|
|
655
|
+
|
|
656
|
+
Bohren and Huffman, *Absorption and Scattering of Light by Small Particles*,
|
|
657
|
+
JOHN WILEY & SONS, page 112, (1983).
|
|
658
|
+
|
|
659
|
+
Args:
|
|
660
|
+
m: the complex index of refraction of the sphere
|
|
661
|
+
x: the size parameter of the sphere
|
|
662
|
+
mu: the angles, cos(theta), for the phase scattering matrix
|
|
663
|
+
|
|
664
|
+
Returns:
|
|
665
|
+
p: the phase scattering matrix [sr**(-1.0)]
|
|
666
|
+
"""
|
|
667
|
+
s1, s2 = mie_S1_S2(m=m, x=x, mu=mu, norm=norm)
|
|
668
|
+
|
|
669
|
+
mu = np.atleast_1d(mu)
|
|
670
|
+
s1_star = np.conjugate(s1)
|
|
671
|
+
s2_star = np.conjugate(s2)
|
|
672
|
+
m1 = (s1 * s1_star).real
|
|
673
|
+
m2 = (s2 * s2_star).real
|
|
674
|
+
s21 = (0.5 * (s1 * s2_star + s2 * s1_star)).real
|
|
675
|
+
d21 = (-0.5j * (s1 * s2_star - s2 * s1_star)).real
|
|
676
|
+
phase = np.zeros(shape=(4, 4, mu.size))
|
|
677
|
+
phase[0, 0] = 0.5 * (m2 + m1)
|
|
678
|
+
phase[0, 1] = 0.5 * (m2 - m1)
|
|
679
|
+
phase[1, 0] = phase[0, 1]
|
|
680
|
+
phase[1, 1] = phase[0, 0]
|
|
681
|
+
phase[2, 2] = s21
|
|
682
|
+
phase[2, 3] = -d21
|
|
683
|
+
phase[3, 2] = d21
|
|
684
|
+
phase[3, 3] = s21
|
|
685
|
+
|
|
686
|
+
return phase.squeeze()
|
|
687
|
+
|
|
688
|
+
|
|
645
689
|
def mie_cdf(m, x, num, norm='albedo'):
|
|
646
690
|
"""
|
|
647
691
|
Create a CDF for unpolarized scattering uniformly spaced in cos(theta).
|
|
@@ -49,6 +49,7 @@ __all__ = ('ez_mie',
|
|
|
49
49
|
'i_unpolarized',
|
|
50
50
|
'mie',
|
|
51
51
|
'mie_S1_S2',
|
|
52
|
+
'mie_phase_matrix',
|
|
52
53
|
'mie_cdf',
|
|
53
54
|
'mie_mu_with_uniform_cdf',
|
|
54
55
|
'generate_mie_costheta',
|
|
@@ -464,13 +465,12 @@ def _small_mie_S1_S2(m, x, mu):
|
|
|
464
465
|
return [S1, S2]
|
|
465
466
|
|
|
466
467
|
|
|
467
|
-
def normalization_factor(
|
|
468
|
+
def normalization_factor(m, x, norm_str):
|
|
468
469
|
"""
|
|
469
470
|
Figure out scattering function normalization.
|
|
470
471
|
|
|
471
472
|
Args:
|
|
472
|
-
|
|
473
|
-
b: complex array of Bn coefficients
|
|
473
|
+
m: complex index of refraction of sphere
|
|
474
474
|
x: dimensionless sphere size
|
|
475
475
|
norm_str: string describing type of normalization
|
|
476
476
|
|
|
@@ -485,26 +485,22 @@ def normalization_factor(a, b, x, norm_str):
|
|
|
485
485
|
if norm in ['wiscombe']:
|
|
486
486
|
return 1
|
|
487
487
|
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
qext = 2 * np.sum(cn * (a.real + b.real)) / x**2
|
|
488
|
+
if norm in ['qsca', 'scattering_efficiency']:
|
|
489
|
+
return x * np.sqrt(np.pi)
|
|
491
490
|
|
|
492
|
-
|
|
493
|
-
return np.sqrt(np.pi * x**2 * qext)
|
|
491
|
+
qext, qsca, _, _ = _mie_scalar(m, x)
|
|
494
492
|
|
|
495
|
-
|
|
493
|
+
if norm in ['a', 'albedo']:
|
|
494
|
+
return x * np.sqrt(np.pi * qext)
|
|
496
495
|
|
|
497
496
|
if norm in ['1', 'one', 'unity']:
|
|
498
|
-
return np.sqrt(qsca * np.pi
|
|
497
|
+
return x * np.sqrt(qsca * np.pi)
|
|
499
498
|
|
|
500
499
|
if norm in ['four_pi', '4pi']:
|
|
501
|
-
return np.sqrt(qsca
|
|
502
|
-
|
|
503
|
-
if norm in ['qsca', 'scattering_efficiency']:
|
|
504
|
-
return np.sqrt(np.pi * x**2)
|
|
500
|
+
return x * np.sqrt(qsca / 4)
|
|
505
501
|
|
|
506
502
|
if norm in ['qext', 'extinction_efficiency']:
|
|
507
|
-
return np.sqrt(qsca * np.pi
|
|
503
|
+
return x * np.sqrt(qsca * np.pi / qext)
|
|
508
504
|
|
|
509
505
|
raise ValueError("normalization must be one of 'albedo' (default), 'one'"
|
|
510
506
|
"'4pi', 'qext', 'qsca', 'bohren', or 'wiscombe'")
|
|
@@ -548,7 +544,7 @@ def mie_S1_S2(m, x, mu, norm='albedo'):
|
|
|
548
544
|
pi_nm1 = ((2 * n + 1) * mu[k] * pi_nm1 - (n + 1) * pi_nm2) / n
|
|
549
545
|
pi_nm2 = temp
|
|
550
546
|
|
|
551
|
-
normalization = normalization_factor(
|
|
547
|
+
normalization = normalization_factor(m, x, norm)
|
|
552
548
|
|
|
553
549
|
S1 /= normalization
|
|
554
550
|
S2 /= normalization
|
|
@@ -556,6 +552,52 @@ def mie_S1_S2(m, x, mu, norm='albedo'):
|
|
|
556
552
|
return [S1, S2]
|
|
557
553
|
|
|
558
554
|
|
|
555
|
+
def mie_phase_matrix(m, x, mu, norm='albedo'):
|
|
556
|
+
"""
|
|
557
|
+
Calculate the scattering (Mueller) matrix.
|
|
558
|
+
|
|
559
|
+
If mu has length N, then the returned matrix is 4x4xN. If mu is a scalar
|
|
560
|
+
then the matrix is 4x4
|
|
561
|
+
|
|
562
|
+
The phase scattering matrix is computed from the scattering amplitude
|
|
563
|
+
functions, according to equations 5.2.105-6 in K. N. Liou (**2002**) -
|
|
564
|
+
*An Introduction to Atmospheric Radiation*, Second Edition.
|
|
565
|
+
|
|
566
|
+
or
|
|
567
|
+
|
|
568
|
+
Bohren and Huffman, *Absorption and Scattering of Light by Small Particles*,
|
|
569
|
+
JOHN WILEY & SONS, page 112, (1983).
|
|
570
|
+
|
|
571
|
+
Args:
|
|
572
|
+
m: the complex index of refraction of the sphere
|
|
573
|
+
x: the size parameter of the sphere
|
|
574
|
+
mu: the angles, cos(theta), of the phase scattering matrix
|
|
575
|
+
|
|
576
|
+
Returns:
|
|
577
|
+
p: the phase scattering matrix [sr**(-1.0)]
|
|
578
|
+
"""
|
|
579
|
+
mu = np.atleast_1d(mu)
|
|
580
|
+
s1, s2 = mie_S1_S2(m=m, x=x, mu=mu, norm=norm)
|
|
581
|
+
|
|
582
|
+
s1_star = np.conjugate(s1)
|
|
583
|
+
s2_star = np.conjugate(s2)
|
|
584
|
+
m1 = (s1 * s1_star).real
|
|
585
|
+
m2 = (s2 * s2_star).real
|
|
586
|
+
s21 = (0.5 * (s1 * s2_star + s2 * s1_star)).real
|
|
587
|
+
d21 = (-0.5j * (s1 * s2_star - s2 * s1_star)).real
|
|
588
|
+
phase = np.zeros(shape=(4, 4, mu.size))
|
|
589
|
+
phase[0, 0] = 0.5 * (m2 + m1)
|
|
590
|
+
phase[0, 1] = 0.5 * (m2 - m1)
|
|
591
|
+
phase[1, 0] = phase[0, 1]
|
|
592
|
+
phase[1, 1] = phase[0, 0]
|
|
593
|
+
phase[2, 2] = s21
|
|
594
|
+
phase[2, 3] = -d21
|
|
595
|
+
phase[3, 2] = d21
|
|
596
|
+
phase[3, 3] = s21
|
|
597
|
+
|
|
598
|
+
return phase.squeeze()
|
|
599
|
+
|
|
600
|
+
|
|
559
601
|
def mie_cdf(m, x, num, norm='albedo'):
|
|
560
602
|
"""
|
|
561
603
|
Create a CDF for unpolarized scattering uniformly spaced in cos(theta).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: miepython
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.5.0
|
|
4
4
|
Summary: Mie scattering of a plane wave by a sphere
|
|
5
5
|
Home-page: https://github.com/scottprahl/miepython.git
|
|
6
6
|
Author: Scott Prahl
|
|
@@ -25,15 +25,9 @@ by Scott Prahl
|
|
|
25
25
|
.. image:: https://img.shields.io/pypi/v/miepython.svg
|
|
26
26
|
:target: https://pypi.org/project/miepython/
|
|
27
27
|
|
|
28
|
-
.. image:: https://colab.research.google.com/assets/colab-badge.svg
|
|
29
|
-
:target: https://colab.research.google.com/github/scottprahl/miepython/blob/master
|
|
30
|
-
|
|
31
28
|
.. image:: https://img.shields.io/badge/readthedocs-latest-blue.svg
|
|
32
29
|
:target: https://miepython.readthedocs.io
|
|
33
30
|
|
|
34
|
-
.. image:: https://img.shields.io/badge/github-code-green.svg
|
|
35
|
-
:target: https://github.com/scottprahl/miepython
|
|
36
|
-
|
|
37
31
|
.. image:: https://img.shields.io/badge/MIT-license-yellow.svg
|
|
38
32
|
:target: https://github.com/scottprahl/miepython/blob/master/LICENSE.txt
|
|
39
33
|
|
miepython-2.3.2/CITATION.cff
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
cff-version: 1.2.0
|
|
2
|
-
title: miepython
|
|
3
|
-
message: >-
|
|
4
|
-
If you use this software, please cite it using the
|
|
5
|
-
metadata from this file.
|
|
6
|
-
type: software
|
|
7
|
-
authors:
|
|
8
|
-
- given-names: Scott
|
|
9
|
-
name-particle: A
|
|
10
|
-
family-names: Prahl
|
|
11
|
-
email: scott.prahl@oit.edu
|
|
12
|
-
affiliation: Oregon Tech
|
|
13
|
-
orcid: 'https://orcid.org/0000-0003-1468-6851'
|
|
14
|
-
identifiers:
|
|
15
|
-
- type: doi
|
|
16
|
-
value: 10.5281/zenodo.7949264
|
|
17
|
-
repository-code: 'https://github.com/scottprahl/miepython.git'
|
|
18
|
-
url: 'https://github.com/scottprahl/miepython'
|
|
19
|
-
repository: 'https://miepython.readthedocs.io/en/latest/'
|
|
20
|
-
abstract: >-
|
|
21
|
-
miepython is a pure Python module to calculate light
|
|
22
|
-
scattering by non-absorbing, partially-absorbing, or
|
|
23
|
-
perfectly conducting spheres. Mie theory is
|
|
24
|
-
validated against published results by Wiscombe.
|
|
25
|
-
This code provides functions for calculating the
|
|
26
|
-
extinction efficiency, scattering efficiency,
|
|
27
|
-
backscattering, and scattering asymmetry.
|
|
28
|
-
keywords:
|
|
29
|
-
- mie
|
|
30
|
-
- scattering
|
|
31
|
-
- rainbow
|
|
32
|
-
- droplet
|
|
33
|
-
- nanoparticle
|
|
34
|
-
- sphere
|
|
35
|
-
- cloud
|
|
36
|
-
- phase function
|
|
37
|
-
- efficiency
|
|
38
|
-
- rayleigh
|
|
39
|
-
- backscattering
|
|
40
|
-
license: MIT
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|