Mie Python
Mie Python
PyMieScatt is a python mie code based on based on Bohren and Huffman's Mie Theory
derivations which calculates extinction efficiency (Qext), scattering efficiency (Qsca),
backscattering efficiency (Qback) and asymmetry parameter (g). It requires the refractive
index of the scattering particle and the size parameter.
Requirements
Python environment
PyMieScatt
NumPy
SciPy
matplotlib-pyplot
Single particle
Mie code calculates the mie efficiencies and asymmetry parameter from the particle
refractive index, particle diameter and wavelength of interacting radiation
{'Qext': 1.625363260122038,
Out[13]:
'Qsca': 0.45142608901140946,
'Qabs': 1.1739371711106286,
'g': 0.35644716992630443,
'Qpr': 1.4644537082630211,
'Qback': 0.19816623330368757,
'Qratio': 0.43897824722017575}
Polydisperse particles
In atmosphere particles exist in different size and composition. In order to assess the
scattering properties of atmospheric particles, we have to take account of their size
distribution. Size distribution of atmospheric particles can be best assumed as lognormal
which can be described by its
mod radius
standard deviation
upper and lower bounds of particle size
2 2
dn(r)/dr = (n/(√2π ln σr) exp [− ln (r/rm )/2(lnσ) ]
def miecoeff(n,sigma,rad_array,lamb,rm,m):
bext_array = [] # Arrays to store f(x)
bsca_array = [] # of each radius value
babs_array = [] # for each radius value
g_array = []
for r in rad_array:
mie_params = mie.MieQ(ref_index,wavelength,radius*2,asDict=True) #
# mie parameters
bext = math.sqrt(math.pi/2.0)*(n/np.log(sigma))*r*mie_params['Qext'
bsca = math.sqrt(math.pi/2.0)*(n/np.log(sigma))*r*mie_params['Qsca'
babs = math.sqrt(math.pi/2.0)*(n/np.log(sigma))*r*mie_params['Qabs'
g = math.sqrt(math.pi/2.0)*(n/np.log(sigma))*r*mie_params['Qsca']*mi
bext_array,bsca_array,babs_array,g_array = miecoeff(n,sigma,rad_array,wavele
fig = plt.Figure(figsize=(5,5))
plt.plot(size_param_array,qext_array,label = 'Qext')
plt.plot(size_param_array,qabs_array,label = 'Qabs')
plt.plot(size_param_array,qsca_array,label = 'Qsca')
plt.xlabel('Size parameter')
plt.ylabel('Qext/Qabs/Qsca')
plt.legend()
<matplotlib.legend.Legend at 0x7f0d53ff84c0>
Out[51]:
fig = plt.Figure(figsize=(5,5))
plt.plot(size_param_array,ssa_array,label = str(ref_index))
ref_index = 1.33+0.01j
qext_array = []
qsca_array = []
qabs_array = []
size_param_array = []
ssa_array = []
for r in rad_array:
mie_params = mie.MieQ(ref_index,wavelength,r*2,asDict=True)
size_param = (2*math.pi*r)/wavelength
qext_array.append(mie_params['Qext'])
qabs_array.append(mie_params['Qabs'])
qsca_array.append(mie_params['Qsca'])
size_param_array.append(size_param)
ssa_array = np.divide(qsca_array,qext_array)
plt.plot(size_param_array,ssa_array,label = str(ref_index))
ref_index = 1.33+0.1j
qext_array = []
qsca_array = []
qabs_array = []
size_param_array = []
ssa_array = []
for r in rad_array:
mie_params = mie.MieQ(ref_index,wavelength,r*2,asDict=True)
size_param = (2*math.pi*r)/wavelength
qext_array.append(mie_params['Qext'])
qabs_array.append(mie_params['Qabs'])
qsca_array.append(mie_params['Qsca'])
size_param_array.append(size_param)
ssa_array = np.divide(qsca_array,qext_array)
plt.plot(size_param_array,ssa_array,label = str(ref_index))
plt.xlabel('Size parameter')
plt.ylabel('SSA')
plt.legend()
<matplotlib.legend.Legend at 0x7f0d5416f6a0>
Out[47]:
Useful links
https://scattport.org/index.php/programs-menu/mie-type-codes-menu
http://www.philiplaven.com/mieplot.htm
In [ ]: