Closed Apollo3zehn closed 5 years ago
Dear Apollo3zehn, I have run into the same problem. Eventually I switched to PyMieScatt, it gives consistent results with Maetzler code.
Thanks for your link! There are much more Mie implementations than I was aware of a week ago. But hopefully in the end they all provide the same results :) At least with the same sign and only scaled by a constant factor.
Bohren and Huffman use positive values for the imaginary part of the complex index of refraction — see equation 2.48 in their book. Based on your observations, Maetzler seems to the same.
miepython
follows the convention used by Wiscombe and assumes absorbing particles have a negative imaginary refractive index.
Try rerunning the Matlab code using positive values for the imaginary index of refraction. I expect that you'll get a much better match.
I forgot to mention, normalization for scattering functions varies considerably across codes. The miepython
scattering function assumes that the integral of the scattering function over all 4pi steradians is equal to the single scattering albedo (see detailed documentation)
Thank you, this solves two issues at once :) With inversed sign, the end results are now consistent (altough the sign of the complex part of an is still inversed, but this may be an implementation detail).
I found this publication to be very informative (for others who might stumble across this): Sign Conventions in Electromagnetic (EM) Waves.
Yes, the signs of the imaginary parts of A_n and B_n differ in code bases that make different assumptions about the imaginary part of the refraction. I have never seen any place that this affects and observable quantity. It is just an implementation detail :-)
When I use your online calculator or this python module with following settings:
then I get the following results:
With the script of Maetzler (bottom of page https://omlc.org/software/mie/), if I do:
I get:
where ans(4) = qext = 1.0879 and ans(5) = qsca = 1.1556.
So it seems that the values of the extinction coefficient and of the scattering coefficent are interchanged.
I digged deeper in your code and found that the Python Mie coefficients
an
andbn
are different to that of Maetzler:Maezler (
an
):Python (
an
):Most numbers are equal but the signs are different. Same is true for
bn
values.I also tried this Java Applet (http://www.lightscattering.de/MieCalc/eindex.html), which is really hard to get it running and it provides confusing results. Sometimes it provides the same results as the Python script, sometimes it there are clearly wrong values. Therefore I also tried "bhmie Matlab" from this site: http://scatterlib.wikidot.com/mie
With this script, I get the same results as with the script of Maetzler.
This is very confusing. Do you know more about this issue?
Thanks Apollo3zehn