Closed lopezvoliver closed 1 year ago
Thanks, this looks great. I've only had a quick look so far, but I'll aim to review it properly as soon as I get chance.
In the meantime, if you have any time to implement a couple of simple tests for the new functionality then that'd be great.
Ok, I will work on implementing the new tests when I get a chance, which will likely require comparing some generated .mie
text files. I also just pushed a new commit that fixes the failed test when using an integer s.aero_profile
(e.g. from a predefined type). I also now ran python -m unittest
locally.. last time I only tested the examples manually.
Sorry for the massive delay in dealing with this, and thanks for adding the tests.
I've merged now, and I'll aim to get a new release out shortly.
Hi, this pull request adds two features to Py6S:
(1) The ability to save a text file with the
.mie
extension containing the results of theMIE.f
subroutine (applies only for aerosol profile options 8, 9, 10, and 11).To use this, we simply set a new attribute to the SixsS object called
mie
(which by default is set toNone
). By setting it to a string value other than None, then the inputs file will have1 results saved in X.mie
(where X is the value set to themie
attribute) instead of0 no results saved
, and the following line will have the name of the file (e.g. X). Its value is ignored if the aerosol profile is user-defined (iaer=4) or a predefined type.(2) A new classmethod for the
AeroProfile
calledFromMieFile
which will setiaer
to 12 followed by the name of the text file (provided by the parametermie_file
).Caveat:
Using a pre-computed MIE file compared to using the options used to create the MIE file will result in some small differences in the output. This is expected because the
AEROSO.f
subroutine writes the text file with a fixed set of precision.