prosail icon indicating copy to clipboard operation
prosail copied to clipboard

NaN leaf spectra outputted for reasonable input values

Open jigmegrs opened this issue 6 years ago • 6 comments

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.

jigmegrs avatar Apr 18 '18 02:04 jigmegrs

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 avatar Apr 18 '18 07:04 jgomezdans

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

jgomezdans avatar Apr 18 '18 07:04 jgomezdans

Hi J,

You're right it works fine with those values! Thank you for having a look.

I am still deciding on the input conditions, so I had just grabbed some values from the table on Pypi ( https://pypi.org/project/prosail/ ) and your Github page.

I'm a bit confused now, could you point me to where I can find out what the units for the Prosail inputs are?

On 18 April 2018 at 15:14, José Gómez-Dans [email protected] wrote:

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

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jgomezdans/prosail/issues/10#issuecomment-382287434, or mute the thread https://github.com/notifications/unsubscribe-auth/AdZi1AZr8gme_kk5GuGE_iBwccoh-e7cks5tpufVgaJpZM4TZWMF .

jigmegrs avatar Apr 18 '18 08:04 jigmegrs

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.

jigmegrs avatar Apr 18 '18 08:04 jigmegrs

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

jgomezdans avatar Apr 18 '18 09:04 jgomezdans

Yea I was just blindly trying stuff as a first attempt, trying to get anything other than NaNs or zeros... thank you!

For the parameter units, I guess from now on I'll base it on "PROSAIL: 15 Years of use for land surface characterization" Jacquemoud et al. 2006

On 18 April 2018 at 17:14, José Gómez-Dans [email protected] wrote:

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: image] https://user-images.githubusercontent.com/139304/38922827-0d963e96-42f1-11e8-88c9-f1d159c29513.png

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jgomezdans/prosail/issues/10#issuecomment-382320697, or mute the thread https://github.com/notifications/unsubscribe-auth/AdZi1KJC40WoIiCoSEp-E6eI658Fpe7zks5tpwQFgaJpZM4TZWMF .

jigmegrs avatar Apr 18 '18 10:04 jigmegrs