Closed csarantos-ceres closed 3 years ago
It looks like maybe gaseous transmission is correclty calculated but aerosol coupling is NaN? Not sure, though.
Hi @csarantos-ceres.
Unfortunately I don't have any further information on this.
It's definitely an issue with the underlying 6S model, as it occurs when 6S is run outside of Py6S too. It also seems to be platform related, as it doesn't occur on my OS X machine, but occurs for you and the person in the original forum message, who were both using Windows. I think it must be something related to the compilation of the 6S code on Windows and some sort of floating point error - but beyond that I can't really say.
I don't have access to a Windows machine at the moment for testing - but is there any chance you could run this code on a different platform?
I've contacted the original author of 6S about this before, but haven't had any luck with a response. Feel free to contact him yourself (he's Eric Vermote) and do let me know if you hear anything.
Thanks, Robin! That's still very helpful to know that it doesn't happen in OSX. I'm ultimately intending to run this in Linux and this work is just an intermediate step. So if the Linux versions don't have this issue, that would be excellent! If I end up running it in Linux, I'll report back what happens.
Thanks! Chris Sarantos
Whoops, I realize that I never reported back what happened. My recollection is that I ran it natively in Linux and this issue went away.
@csarantos-ceres @robintw: I spotted this problem today and it is indeed coming from 6S itself.
Having looked through the source code, the problem is in interp.f
.
If you change line 66 of that file from:
if(wl.gt.wldis(ll).and.wl.le.wldis(ll+1)) linf=ll
To:
if(wl.ge.wldis(ll).and.wl.lt.wldis(ll+1)) linf=ll
Then the code will output good results (no NaNs, output data looks OK). I've let Eric know via email.
Good find! Thanks for notifying Eric.
Hello @robintw and @simonrp84 ,
Do you know if this issue has been corrected in 6S?
In addition if I well understand, Py6S is based on 6SV1.1. However the last version of 6S seems to be the 2.1 (https://salsa.umd.edu/6spage.html). Maybe this bug is not in 6SV2.1. Do you plan to update Py6S with 6S2.1?
Thank you in advance for your support.
No, to my knowledge this has not been corrected. I emailed several times and never got a response from any of the team. Perhaps you could drop them a mail in case mine are getting caught by their junk filter?
Hi @simonrp84 , thanks a lot for your response. Good idea, I will send a mail and keep you informed.
I also haven't heard anything from the 6S team, despite contacting them multiple times.
There may be a fix for this in version 2.1, but I haven't yet been able to update Py6S to work with the new version. I now work as a freelancer, and would really need some proper funding to be able to do the upgrade work (which is more complex than it first seems).
Hi @robintw and thanks a lot for your response. I understand your situation.
As I said I will send a mail and keep you informed.
@robintw Out of interest (and somewhat offtopic), what's the blocker with upgrading to support V2.1? I simply changed 1.1
to 2.1
in the Py6S
code and the results are as expected across all the tests I tried. I presume there's some kind of niche example where it doesn't work?
Certain wavelengths such as 761 nm are returning NaN irradiance (in some cases over a 1.2 nm range corresponding to two sampling points at the 10 cm^-1 resolution?). I am putting in 30% broadband surface albedo and moderate AOT and water content, have not experimented with reducing those yet to see if this still occurs.
I found this 2014 thread here that implies this may be a 6S issue. I'm not sure if there is more up to date information or a fix for this, or if this is still a fundamental 6S issue?
https://groups.google.com/forum/m/#!topic/py6s/vUwoQ_DWBTk
Wavelengths at which I'm getting NaN irradiance (grid with 1 nm spacing):![image](https://user-images.githubusercontent.com/46458517/84534300-89818b00-ac9e-11ea-86f8-0954e74c581c.png)
Full debug report and output full text
Output full text: