miepython 2.4.0__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.4.0 → miepython-2.5.0}/CHANGELOG.rst +4 -0
- {miepython-2.4.0/miepython.egg-info → miepython-2.5.0}/PKG-INFO +1 -1
- {miepython-2.4.0 → miepython-2.5.0}/miepython/__init__.py +1 -1
- {miepython-2.4.0 → miepython-2.5.0}/miepython/miepython.py +9 -12
- {miepython-2.4.0 → miepython-2.5.0}/miepython/miepython_nojit.py +11 -16
- {miepython-2.4.0 → miepython-2.5.0/miepython.egg-info}/PKG-INFO +1 -1
- {miepython-2.4.0 → miepython-2.5.0}/.github/workflows/test.yml +0 -0
- {miepython-2.4.0 → miepython-2.5.0}/.gitignore +0 -0
- {miepython-2.4.0 → miepython-2.5.0}/.readthedocs.yaml +0 -0
- {miepython-2.4.0 → miepython-2.5.0}/.testignore +0 -0
- {miepython-2.4.0 → miepython-2.5.0}/CITATION.cff +0 -0
- {miepython-2.4.0 → miepython-2.5.0}/LICENSE.txt +0 -0
- {miepython-2.4.0 → miepython-2.5.0}/MANIFEST.in +0 -0
- {miepython-2.4.0 → miepython-2.5.0}/Makefile +0 -0
- {miepython-2.4.0 → miepython-2.5.0}/README.rst +0 -0
- {miepython-2.4.0 → miepython-2.5.0}/docs/01_basics.ipynb +0 -0
- {miepython-2.4.0 → miepython-2.5.0}/docs/01_plot.png +0 -0
- {miepython-2.4.0 → miepython-2.5.0}/docs/02_efficiencies.ipynb +0 -0
- {miepython-2.4.0 → miepython-2.5.0}/docs/02_plot.png +0 -0
- {miepython-2.4.0 → miepython-2.5.0}/docs/03_angular_scattering.ipynb +0 -0
- {miepython-2.4.0 → miepython-2.5.0}/docs/03_plot.png +0 -0
- {miepython-2.4.0 → miepython-2.5.0}/docs/03a_normalization.ipynb +0 -0
- {miepython-2.4.0 → miepython-2.5.0}/docs/04_plot.png +0 -0
- {miepython-2.4.0 → miepython-2.5.0}/docs/04_rayleigh.ipynb +0 -0
- {miepython-2.4.0 → miepython-2.5.0}/docs/05_fog.ipynb +0 -0
- {miepython-2.4.0 → miepython-2.5.0}/docs/06_random_deviates.ipynb +0 -0
- {miepython-2.4.0 → miepython-2.5.0}/docs/07_algorithm.ipynb +0 -0
- {miepython-2.4.0 → miepython-2.5.0}/docs/08_large_spheres.ipynb +0 -0
- {miepython-2.4.0 → miepython-2.5.0}/docs/09_backscattering.ipynb +0 -0
- {miepython-2.4.0 → miepython-2.5.0}/docs/10_basic_tests.ipynb +0 -0
- {miepython-2.4.0 → miepython-2.5.0}/docs/11_performance.ipynb +0 -0
- {miepython-2.4.0 → miepython-2.5.0}/docs/changelog.rst +0 -0
- {miepython-2.4.0 → miepython-2.5.0}/docs/conf.py +0 -0
- {miepython-2.4.0 → miepython-2.5.0}/docs/index.rst +0 -0
- {miepython-2.4.0 → miepython-2.5.0}/docs/miepython.rst +0 -0
- {miepython-2.4.0 → miepython-2.5.0}/docs/requirements.txt +0 -0
- {miepython-2.4.0 → miepython-2.5.0}/miepython/data/Johnson.txt +0 -0
- {miepython-2.4.0 → miepython-2.5.0}/miepython/data/ag-Johnson.txt +0 -0
- {miepython-2.4.0 → miepython-2.5.0}/miepython/data/segelstein81_index.txt +0 -0
- {miepython-2.4.0 → miepython-2.5.0}/miepython/examples/01_dielectric.py +0 -0
- {miepython-2.4.0 → miepython-2.5.0}/miepython/examples/02_glass.py +0 -0
- {miepython-2.4.0 → miepython-2.5.0}/miepython/examples/03_droplets.py +0 -0
- {miepython-2.4.0 → miepython-2.5.0}/miepython/examples/04_gold.py +0 -0
- {miepython-2.4.0 → miepython-2.5.0}/miepython.egg-info/SOURCES.txt +0 -0
- {miepython-2.4.0 → miepython-2.5.0}/miepython.egg-info/dependency_links.txt +0 -0
- {miepython-2.4.0 → miepython-2.5.0}/miepython.egg-info/requires.txt +0 -0
- {miepython-2.4.0 → miepython-2.5.0}/miepython.egg-info/top_level.txt +0 -0
- {miepython-2.4.0 → miepython-2.5.0}/pyproject.toml +0 -0
- {miepython-2.4.0 → miepython-2.5.0}/release.txt +0 -0
- {miepython-2.4.0 → miepython-2.5.0}/requirements-dev.txt +0 -0
- {miepython-2.4.0 → miepython-2.5.0}/requirements.txt +0 -0
- {miepython-2.4.0 → miepython-2.5.0}/setup.cfg +0 -0
- {miepython-2.4.0 → miepython-2.5.0}/setup.py +0 -0
|
@@ -476,8 +476,8 @@ def _small_mie_S1_S2(m, x, mu):
|
|
|
476
476
|
return [S1, S2]
|
|
477
477
|
|
|
478
478
|
|
|
479
|
-
@njit((complex128
|
|
480
|
-
def normalization_factor(
|
|
479
|
+
@njit((complex128, float64, int32), cache=True)
|
|
480
|
+
def normalization_factor(m, x, norm_int):
|
|
481
481
|
"""
|
|
482
482
|
Figure out scattering function normalization.
|
|
483
483
|
|
|
@@ -492,7 +492,7 @@ def normalization_factor(a, b, x, norm_int):
|
|
|
492
492
|
"""
|
|
493
493
|
# Qsca normalization
|
|
494
494
|
if norm_int == 3:
|
|
495
|
-
return np.sqrt(np.pi
|
|
495
|
+
return x * np.sqrt(np.pi)
|
|
496
496
|
|
|
497
497
|
# Bohren Normalization
|
|
498
498
|
if norm_int == 5:
|
|
@@ -503,26 +503,23 @@ def normalization_factor(a, b, x, norm_int):
|
|
|
503
503
|
return 1
|
|
504
504
|
|
|
505
505
|
# calculate qsca and qext
|
|
506
|
-
|
|
507
|
-
cn = 2.0 * n + 1.0
|
|
508
|
-
qext = 2 * np.sum(cn * (a.real + b.real)) / x**2
|
|
509
|
-
qsca = 2 * np.sum(cn * (np.abs(a)**2 + np.abs(b)**2)) / x**2
|
|
506
|
+
qext, qsca, _, _ = _mie_scalar(m, x)
|
|
510
507
|
|
|
511
508
|
# albedo Normalization
|
|
512
509
|
if norm_int == 0:
|
|
513
|
-
return np.sqrt(np.pi *
|
|
510
|
+
return x * np.sqrt(np.pi * qext)
|
|
514
511
|
|
|
515
512
|
# Unity normalization
|
|
516
513
|
if norm_int == 1:
|
|
517
|
-
return np.sqrt(qsca * np.pi
|
|
514
|
+
return x * np.sqrt(qsca * np.pi)
|
|
518
515
|
|
|
519
516
|
# 4pi Normalization
|
|
520
517
|
if norm_int == 2:
|
|
521
|
-
return np.sqrt(qsca
|
|
518
|
+
return x * np.sqrt(qsca / 4)
|
|
522
519
|
|
|
523
520
|
# Qext Normalization
|
|
524
521
|
if norm_int == 4: # 4pi
|
|
525
|
-
return np.sqrt(qsca * np.pi
|
|
522
|
+
return x * np.sqrt(qsca * np.pi / qext)
|
|
526
523
|
|
|
527
524
|
raise ValueError("norm-int must be in the range 0..6")
|
|
528
525
|
|
|
@@ -609,7 +606,7 @@ def _mie_S1_S2(m, x, mu, norm_int):
|
|
|
609
606
|
pi_nm1 = ((2 * n + 1) * mu[k] * pi_nm1 - (n + 1) * pi_nm2) / n
|
|
610
607
|
pi_nm2 = temp
|
|
611
608
|
|
|
612
|
-
normalization = normalization_factor(
|
|
609
|
+
normalization = normalization_factor(m, x, norm_int)
|
|
613
610
|
|
|
614
611
|
S1 /= normalization
|
|
615
612
|
S2 /= normalization
|
|
@@ -465,13 +465,12 @@ def _small_mie_S1_S2(m, x, mu):
|
|
|
465
465
|
return [S1, S2]
|
|
466
466
|
|
|
467
467
|
|
|
468
|
-
def normalization_factor(
|
|
468
|
+
def normalization_factor(m, x, norm_str):
|
|
469
469
|
"""
|
|
470
470
|
Figure out scattering function normalization.
|
|
471
471
|
|
|
472
472
|
Args:
|
|
473
|
-
|
|
474
|
-
b: complex array of Bn coefficients
|
|
473
|
+
m: complex index of refraction of sphere
|
|
475
474
|
x: dimensionless sphere size
|
|
476
475
|
norm_str: string describing type of normalization
|
|
477
476
|
|
|
@@ -486,26 +485,22 @@ def normalization_factor(a, b, x, norm_str):
|
|
|
486
485
|
if norm in ['wiscombe']:
|
|
487
486
|
return 1
|
|
488
487
|
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
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)
|
|
492
490
|
|
|
493
|
-
|
|
494
|
-
return np.sqrt(np.pi * x**2 * qext)
|
|
491
|
+
qext, qsca, _, _ = _mie_scalar(m, x)
|
|
495
492
|
|
|
496
|
-
|
|
493
|
+
if norm in ['a', 'albedo']:
|
|
494
|
+
return x * np.sqrt(np.pi * qext)
|
|
497
495
|
|
|
498
496
|
if norm in ['1', 'one', 'unity']:
|
|
499
|
-
return np.sqrt(qsca * np.pi
|
|
497
|
+
return x * np.sqrt(qsca * np.pi)
|
|
500
498
|
|
|
501
499
|
if norm in ['four_pi', '4pi']:
|
|
502
|
-
return np.sqrt(qsca
|
|
503
|
-
|
|
504
|
-
if norm in ['qsca', 'scattering_efficiency']:
|
|
505
|
-
return np.sqrt(np.pi * x**2)
|
|
500
|
+
return x * np.sqrt(qsca / 4)
|
|
506
501
|
|
|
507
502
|
if norm in ['qext', 'extinction_efficiency']:
|
|
508
|
-
return np.sqrt(qsca * np.pi
|
|
503
|
+
return x * np.sqrt(qsca * np.pi / qext)
|
|
509
504
|
|
|
510
505
|
raise ValueError("normalization must be one of 'albedo' (default), 'one'"
|
|
511
506
|
"'4pi', 'qext', 'qsca', 'bohren', or 'wiscombe'")
|
|
@@ -549,7 +544,7 @@ def mie_S1_S2(m, x, mu, norm='albedo'):
|
|
|
549
544
|
pi_nm1 = ((2 * n + 1) * mu[k] * pi_nm1 - (n + 1) * pi_nm2) / n
|
|
550
545
|
pi_nm2 = temp
|
|
551
546
|
|
|
552
|
-
normalization = normalization_factor(
|
|
547
|
+
normalization = normalization_factor(m, x, norm)
|
|
553
548
|
|
|
554
549
|
S1 /= normalization
|
|
555
550
|
S2 /= normalization
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|