From 3682d3cf3413b810ec4a720dc3a2a08f04d692dc Mon Sep 17 00:00:00 2001 From: nsbalbi <60553434+nsbalbi@users.noreply.github.com> Date: Sun, 15 Aug 2021 21:45:34 -0400 Subject: [PATCH 1/4] Create README.md --- README.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..46ef768 --- /dev/null +++ b/README.md @@ -0,0 +1,33 @@ +# Scattering +Function package for generating theoretical light scattering models. Composed during the 2021 CHARM REU Program for the Furst Group. + + + +## Usage + +The functions mie_scattering and rayleigh_scattering calculate theoretical light scattering properties, including scattering intensities and photon mean-free path. Inputs are the system parameters (particle and medium refractive indeces, particle radii, incident light wavelength) along with the desired structure factor model (default S(q)=1). See the documentation within scattering.py for further detail. Examples are given below and example scripts can be found in the "Examples" folder. + +## Examples + +In the simplest case, only the following system parameters meed to be input: +* particle refractive index, n_p +* medium refractive index, n_s +* particle radii, a_p +* wavelength of the incident light in a vacuum, lambda_vac +* particle volume fraction, phi + +```python +theta, i1, i2, l_star, stats = mie_scattering(n_p, n_s, a_p, lambda_vac, phi) +``` + +Plotting i1 and i2 versus theta generated the polar plots seen above. + +To specify the structure factor, the argument "struct" can be used. Currently implimented is a Percus-Yevick hard sphere structure factor ('PY'), a hard sphere with an excluded annulus ('PYAnnulus'), and a sticky hard sphere model with a square potential well ('SHS'). For some models, additional parameters must be specified using the "optional_params" arguement. Examples of each are seen below along with an plot of example parameters. See the documentation of scattering.py for more details and citations. + +```python +_, _, _, _, [q, _, s_q, _, _, _, _, _] = mie_scattering(n_p, n_s, a_p, lambda_vac, phi, struct='PY') +... = mie_scattering(n_p, n_s, a_p, lambda_vac, phi, sruct='PYAnnulus', optional_params=[1.2*a_p]) +... = mie_scattering(n_p, n_s, a_p, lambda_vac, phi, sruct='SHS', optional_params=[0.2, 0.05]) +``` + + From a76670ae8e69fc849360f1e9d199eba60be4ec04 Mon Sep 17 00:00:00 2001 From: nsbalbi <60553434+nsbalbi@users.noreply.github.com> Date: Sun, 15 Aug 2021 21:48:19 -0400 Subject: [PATCH 2/4] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 46ef768..2a454bc 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ theta, i1, i2, l_star, stats = mie_scattering(n_p, n_s, a_p, lambda_vac, phi) Plotting i1 and i2 versus theta generated the polar plots seen above. -To specify the structure factor, the argument "struct" can be used. Currently implimented is a Percus-Yevick hard sphere structure factor ('PY'), a hard sphere with an excluded annulus ('PYAnnulus'), and a sticky hard sphere model with a square potential well ('SHS'). For some models, additional parameters must be specified using the "optional_params" arguement. Examples of each are seen below along with an plot of example parameters. See the documentation of scattering.py for more details and citations. +To specify the structure factor, the argument "struct" can be used. Currently implimented is a Percus-Yevick hard sphere structure factor ('PY'), a hard sphere with an excluded annulus ('PYAnnulus'), and a sticky hard sphere model with a square potential well ('SHS'). For some models, additional parameters must be specified using the "optional_params" arguement. Examples of each are seen below along with an plot of example parameters. See the documentation of scattering.py for parameter details and citations. ```python _, _, _, _, [q, _, s_q, _, _, _, _, _] = mie_scattering(n_p, n_s, a_p, lambda_vac, phi, struct='PY') From 7b5e69258c792b9d31c9f7a73a89b49cf00229cd Mon Sep 17 00:00:00 2001 From: nsbalbi <60553434+nsbalbi@users.noreply.github.com> Date: Sun, 15 Aug 2021 22:07:28 -0400 Subject: [PATCH 3/4] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 2a454bc..88ba67a 100644 --- a/README.md +++ b/README.md @@ -31,3 +31,5 @@ _, _, _, _, [q, _, s_q, _, _, _, _, _] = mie_scattering(n_p, n_s, a_p, lambda_va ``` + +Another great resourse and similar code can be found here: https://miepython.readthedocs.io/en/latest/index.html From b7ae9e1303bc05b08025184c04952da879f58b88 Mon Sep 17 00:00:00 2001 From: nsbalbi <60553434+nsbalbi@users.noreply.github.com> Date: Mon, 16 Aug 2021 12:47:40 -0400 Subject: [PATCH 4/4] Update README.md --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 88ba67a..c482d22 100644 --- a/README.md +++ b/README.md @@ -32,4 +32,12 @@ _, _, _, _, [q, _, s_q, _, _, _, _, _] = mie_scattering(n_p, n_s, a_p, lambda_va -Another great resourse and similar code can be found here: https://miepython.readthedocs.io/en/latest/index.html +The code is sufficiently optimized so that 100+ calls to mie/rayleigh_scattering can occur in under a second. See mie_vs_rayleigh_l_star for an example of such, the results of which are shown below. + + + +## Other Resources + +Other great resources for scattering calculations can be found here: +* https://miepython.readthedocs.io/en/latest/index.html +* https://omlc.org/calc/mie_calc.html