Skip to content

Commit

Permalink
update figures, fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
scottprahl committed May 7, 2024
1 parent bbbb950 commit bc0f553
Show file tree
Hide file tree
Showing 12 changed files with 1,132 additions and 1,581 deletions.
150 changes: 91 additions & 59 deletions docs/01_basics.ipynb

Large diffs are not rendered by default.

139 changes: 74 additions & 65 deletions docs/02_efficiencies.ipynb

Large diffs are not rendered by default.

821 changes: 162 additions & 659 deletions docs/03_angular_scattering.ipynb

Large diffs are not rendered by default.

177 changes: 89 additions & 88 deletions docs/03a_normalization.ipynb

Large diffs are not rendered by default.

111 changes: 55 additions & 56 deletions docs/04_rayleigh.ipynb

Large diffs are not rendered by default.

162 changes: 95 additions & 67 deletions docs/05_fog.ipynb

Large diffs are not rendered by default.

126 changes: 65 additions & 61 deletions docs/06_random_deviates.ipynb

Large diffs are not rendered by default.

100 changes: 21 additions & 79 deletions docs/07_algorithm.ipynb

Large diffs are not rendered by default.

551 changes: 298 additions & 253 deletions docs/08_large_spheres.ipynb

Large diffs are not rendered by default.

90 changes: 42 additions & 48 deletions docs/09_backscattering.ipynb

Large diffs are not rendered by default.

69 changes: 26 additions & 43 deletions docs/10_basic_tests.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -8,76 +8,59 @@
"\n",
"**Scott Prahl**\n",
"\n",
"**Mar 2021**\n",
"**May 2024**\n",
"\n",
"Basic tests for Mie scattering in a Jupyter notebook collected in one place. \n",
"\n",
"*If miepython is not installed, uncomment the following cell (i.e., delete the #) and run (shift-enter)*"
"Basic tests for Mie scattering in a Jupyter notebook collected in one place. "
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"#!pip install --user miepython"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"import unittest\n",
"\n",
"try:\n",
" import miepython.miepython as miepython\n",
"\n",
"except ModuleNotFoundError:\n",
" print('miepython not installed. To install, uncomment and run the cell above.')\n",
" print('Once installation is successful, rerun this cell again.')"
"import miepython.miepython as miepython"
]
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"test_06_wiscombe_water_absorbing (__main__.absorbing) ... ok\n",
"test_07_wiscombe_absorbing (__main__.absorbing) ... ok\n",
"test_08_wiscombe_more_absorbing (__main__.absorbing) ... ok\n",
"test_09_single_nonmagnetic (__main__.absorbing) ... ok\n",
"test_12_scatter_function (__main__.angle_scattering) ... ok\n",
"test_13_single_angle (__main__.angle_scattering) ... ok\n",
"test_01_log_derivatives (__main__.low_level) ... ok\n",
"test_02_an_bn (__main__.low_level) ... ok\n",
"test_03_bh_dielectric (__main__.non_absorbing) ... ok\n",
"test_04_non_dielectric (__main__.non_absorbing) ... ok\n",
"test_05_old_wiscombe_non_absorbing (__main__.non_absorbing) ... ok\n",
"test_05_wiscombe_non_absorbing (__main__.non_absorbing) ... ok\n",
"test_11_wiscombe_perfectly_reflecting (__main__.perfectly_reflecting) ... ok\n",
"test_10_small_spheres (__main__.small) ... ok\n",
"test_06_wiscombe_water_absorbing (__main__.absorbing.test_06_wiscombe_water_absorbing) ... ok\n",
"test_07_wiscombe_absorbing (__main__.absorbing.test_07_wiscombe_absorbing) ... ok\n",
"test_08_wiscombe_more_absorbing (__main__.absorbing.test_08_wiscombe_more_absorbing) ... ok\n",
"test_09_single_nonmagnetic (__main__.absorbing.test_09_single_nonmagnetic) ... ok\n",
"test_12_scatter_function (__main__.angle_scattering.test_12_scatter_function) ... ok\n",
"test_13_single_angle (__main__.angle_scattering.test_13_single_angle) ... ok\n",
"test_01_log_derivatives (__main__.low_level.test_01_log_derivatives) ... ok\n",
"test_02_an_bn (__main__.low_level.test_02_an_bn) ... ok\n",
"test_03_bh_dielectric (__main__.non_absorbing.test_03_bh_dielectric) ... ok\n",
"test_04_non_dielectric (__main__.non_absorbing.test_04_non_dielectric) ... ok\n",
"test_05_old_wiscombe_non_absorbing (__main__.non_absorbing.test_05_old_wiscombe_non_absorbing) ... ok\n",
"test_05_wiscombe_non_absorbing (__main__.non_absorbing.test_05_wiscombe_non_absorbing) ... ok\n",
"test_11_wiscombe_perfectly_reflecting (__main__.perfectly_reflecting.test_11_wiscombe_perfectly_reflecting) ... ok\n",
"test_10_small_spheres (__main__.small.test_10_small_spheres) ... ok\n",
"\n",
"----------------------------------------------------------------------\n",
"Ran 14 tests in 0.018s\n",
"Ran 14 tests in 0.052s\n",
"\n",
"OK\n"
]
},
{
"data": {
"text/plain": [
"<unittest.main.TestProgram at 0x12e5d84c0>"
"<unittest.main.TestProgram at 0x10af4fb60>"
]
},
"execution_count": 3,
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -101,7 +84,7 @@
" nstop = int(x + 4.05 * x**0.33333 + 2.0) + 1\n",
" a = np.zeros(nstop - 1, dtype=np.complex128)\n",
" b = np.zeros(nstop - 1, dtype=np.complex128)\n",
" miepython._mie_An_Bn(m,x,a,b)\n",
" a, b = miepython._mie_An_Bn(m,x)\n",
" self.assertAlmostEqual( a[0].real, 0.5311058892948411929, delta=0.00000001)\n",
" self.assertAlmostEqual(-a[0].imag,-0.4990314856310943073, delta=0.00000001)\n",
" self.assertAlmostEqual( b[0].real, 0.7919244759352004773, delta=0.00001)\n",
Expand All @@ -112,7 +95,7 @@
" nstop = int(x + 4.05 * x**0.33333 + 2.0) + 1\n",
" a = np.zeros(nstop - 1, dtype=np.complex128)\n",
" b = np.zeros(nstop - 1, dtype=np.complex128)\n",
" miepython._mie_An_Bn(m,x,a,b)\n",
" a, b = miepython._mie_An_Bn(m,x)\n",
" self.assertAlmostEqual( a[0].real, 0.5465202033970914511, delta=0.00000001)\n",
" self.assertAlmostEqual(-a[0].imag,-0.1523738572575972279, delta=0.00000001)\n",
" self.assertAlmostEqual( b[0].real, 0.3897147278879423235, delta=0.00001)\n",
Expand All @@ -123,7 +106,7 @@
" nstop = int(x + 4.05 * x**0.33333 + 2.0) + 1\n",
" a = np.zeros(nstop - 1, dtype=np.complex128)\n",
" b = np.zeros(nstop - 1, dtype=np.complex128)\n",
" miepython._mie_An_Bn(m,x,a,b)\n",
" a, b = miepython._mie_An_Bn(m,x)\n",
" self.assertAlmostEqual(a[1].real, 0.324433578437, delta=0.0001)\n",
" self.assertAlmostEqual(a[1].imag, 0.465627763266, delta=0.0001)\n",
" self.assertAlmostEqual(b[1].real, 0.060464399088, delta=0.0001)\n",
Expand Down Expand Up @@ -489,7 +472,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -503,7 +486,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.4"
"version": "3.12.3"
}
},
"nbformat": 4,
Expand Down
217 changes: 114 additions & 103 deletions docs/11_performance.ipynb

Large diffs are not rendered by default.

0 comments on commit bc0f553

Please sign in to comment.