Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NaN leaf spectra outputted for reasonable input values #10

Open
jigmegrs opened this issue Apr 18, 2018 · 6 comments
Open

NaN leaf spectra outputted for reasonable input values #10

jigmegrs opened this issue Apr 18, 2018 · 6 comments

Comments

@jigmegrs
Copy link

jigmegrs commented Apr 18, 2018

Hi, thanks for sharing your wrappers!

I have a strange issue with PROSPECT. If I run it with any leaf structure parameter N value, other than 1, I get NaN results.

If I run this

n = 2
cab = 10
car = 1
cbrown = 0.5
cw = 10
cm = 20
out_spectrum = prosail.run_prospect(n, cab, car, cbrown, cw, cm, ant=0.0, prospect_version='D', nr=None, kab=None, kcar=None, kbrown=None, kw=None, km=None, kant=None, alpha=40.0)

I get several Runtime Warnings, this one plus some other ones for different equations:

C:\Users\Jigme\Anaconda2\envs\Pythonv2Prosail\lib\site-packages\prosail\prospect_d.py:150: RuntimeWarning: divide by zero encountered in divide
  b       = (1-rq+tq+D)/(2*t)

However if I run with n = 1 I get no problems. Any other value of n seems to give me this problem.

Does this have something to do with my installation or is it a bug? All values are within the typical ranges, as per the parameter table in the docs.

@jgomezdans
Copy link
Owner

I think your cm and cw have the wrong units. I'm not in front of my computer to check properly, buy try cw=0.001 and cm=0.02 (numbers from memory!), and see whether that works.

@jgomezdans
Copy link
Owner

Also, just tested in python 3and got it to work (master branch)...

@jigmegrs
Copy link
Author

jigmegrs commented Apr 18, 2018 via email

@jigmegrs
Copy link
Author

P.S. With leaf structure parameter N fixed at 1 (for the time being) I have been running Prosail just fine for cm and cw values of 200 each. Not sure what to make of that haha.

@jgomezdans
Copy link
Owner

Oops, I hadn't realised those values were there... I've just had a quick look through papers as to what sensible min/max values might be (see figure below). Cbrown is hard to tell: it's a spectrum that is put into PROSPECT as a pigment, so I have seen all sorts of boundaries for this. I tend to use 0-1, but in some cases, 0-3 might be reasonable (I think...)... Worth checking that the spectra actually look like ;)

image

@jigmegrs
Copy link
Author

jigmegrs commented Apr 18, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants