<jupyter_start><jupyter_text>Here we explore the sensitivity of the Mie solution to the input parameters We start with the sensitivity to imaginary part of the refractive index (RI)Let's see how the size parameter x is 2*pi*r/lambda changes for aerosols.Take lambda 0.5 um (visible), r changes from 0.1 um to 10 um and larger (dust).Then x goes from 1.25 to 125.<jupyter_code>%load_ext autoreload
%autoreload 2
"""
Plot the extinction efficiency as a function of particle size
for non-absorbing and absorbing spheres
"""

import numpy as np
import matplotlib.pyplot as plt
import miepython

x = np.linspace(0.1,100,300)

# mie() will automatically try to do the right thing

qext, qsca, qback, g = miepython.mie(1.5,x)
plt.plot(x,qext,color='red',label="1.5")

qext, qsca, qback, g = miepython.mie(1.5-0.1j,x)
plt.plot(x,qext,color='blue',label="1.5-0.1j")

qext, qsca, qback, g = miepython.mie(1.5-0.01j,x)
plt.plot(x,qext,label="1.5-0.01j")

qext, qsca, qback, g = miepython.mie(1.5-0.001j,x)
plt.plot(x,qext,label="1.5-0.001j")

plt.title("Comparison of extinction for absorbing and non-absorbing spheres")
plt.xlabel("Size Parameter (-)")
plt.ylabel("Qext")
plt.legend()
plt.show()<jupyter_output><empty_output><jupyter_text>The same for the real part<jupyter_code>qext, qsca, qback, g = miepython.mie(1.5-0.1j,x)
plt.plot(x,qext,color='red',label="1.5-0.1j")

qext, qsca, qback, g = miepython.mie(1.45-0.1j,x)
plt.plot(x,qext,color='blue',label="1.45-0.1j")

plt.title("Comparison of extinction")
plt.xlabel("Size Parameter (-)")
plt.ylabel("Qext")
plt.legend()
plt.show()<jupyter_output><empty_output><jupyter_text>Compare different dust RIs<jupyter_code>from climpy.utils.refractive_index_utils import get_dust_ri, get_spectral_refractive_index
wrf_dust_ri_vo = get_spectral_refractive_index('soil', sign_convention='negative')  # RI from WRF code
obs_dust_ri_vo = get_dust_ri(sign_convention='negative')  # recent RI from observations
print(wrf_dust_ri_vo)
print(obs_dust_ri_vo)
ri = wrf_dust_ri_vo['ri']
qext, qsca, qback, g = miepython.mie(ri,x)
plt.plot(x,qext,color='red',label=ri)

ri = obs_dust_ri_vo['ri'][0]
qext, qsca, qback, g = miepython.mie(ri,x)
plt.plot(x,qext,color='blue',label=ri)

plt.title("Comparison of extinction")
plt.xlabel("Size Parameter (-)")
plt.ylabel("Qext")
plt.legend()
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1497872340425532, 'fraction_numerical': 0.031914893617021274, 'mean_word_length': 6.369905956112853, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '350498', 'license': 'MIT', 'n_tokens_mistral': 1020, 'n_tokens_neox': 946, 'n_words': 204, 'path': 'examples/aerosols_mie_sensitivity/mie_sensitivity.ipynb', 'repo_name': 'SeregaOsipov/ClimPy', 'size': '2350'}