jgomezdans / prosail

Python bindings for the PROSAIL canopy reflectance model
130 stars 66 forks source link

Why is this code not working for new version python? #23

Open Dash-RSer opened 7 months ago

Dash-RSer commented 7 months ago

When work with python=3.7 or later, the code will sometimes give reflectance different from that in python =3.6. Why?

jgomezdans commented 7 months ago

Hello,

Can you provide a full example that shows this discrepancy? Also note that those two versions of Python are EOL'ed

Jose


From: Dash @.> Sent: Wednesday, April 24, 2024 03:44 To: jgomezdans/prosail @.> Cc: Subscribed @.***> Subject: [jgomezdans/prosail] Why is this code not working for new version python? (Issue #23)

When work with python=3.7 or later, the code will sometimes give reflectance different from that in python =3.6. Why?

— Reply to this email directly, view it on GitHubhttps://github.com/jgomezdans/prosail/issues/23, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AABCAKFTOWPHLHLSW4FVZFLY64L7LAVCNFSM6AAAAABGWBQO3KVHI2DSMVQWIX3LMV43ASLTON2WKOZSGI3DAMJWHAZDONA. You are receiving this because you are subscribed to this thread.Message ID: @.***>

Dash-RSer commented 6 months ago

For example,
prosail.run_prosail(n=1.5, cab = 40, cbrown = 0, car = 8, cw = 0.01, cm = 0.01, lai = 2, lidfa = 60, hspot = 0.3, tts = 30, tto = 10, psi = 0, psoil = 0.2, rsoil = 0.8) return array([ 0.02534463, 0.02533004, 0.02530949, ..., 0.03163064, 0.03149598, 0.03150244]) with python = 3.6.8 but return all nan with python = 3.7.16.

Also, if set tto to be 0, the code return array([ 0.02271773, 0.02270381, 0.02268457, ..., 0.02893265, 0.02880744, 0.02881312]) with python = 3.6.8 but return array([0.02052408, 0.02048877, 0.02045012, ..., 0.03262565, 0.03253539, 0.03250874]) with python = 3.7.16, which is different from the above ref.