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

Incorrect value handling with scientific notation #35

Open
fnemina opened this issue Apr 9, 2021 · 1 comment
Open

Incorrect value handling with scientific notation #35

fnemina opened this issue Apr 9, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@fnemina
Copy link
Owner

fnemina commented Apr 9, 2021

When writing values to the albedo variables (s.sea.botalb y s.sea.surfalb) the values are written in scientific notation by the script if they are small enough. If this happens but the number of number in the mantissa is to big OSOAA code doesn't read the value of the exponent and only the mantissa.

A general solution for this should be implemented by changing the precision of the written number in OSOAA.

Here a minimal example is shown

import pyOSOAA
import numpy as np
s = pyOSOAA.OSOAA()
s.sea.surfalb = np.pi/1e5
s.view.level = 1
s.run()
print(s.outputs.vsvza.I.max())

give us 5.68087 which is greater than 1 the maximum expected value. If we do

import pyOSOAA
import numpy as np
s = pyOSOAA.OSOAA()
s.sea.surfalb = np.round(np.pi/1e5,8)
s.view.level = 1
s.run()
print(s.outputs.vsvza.I.max())

we have 0.342374, the real value we were looking for.

@fnemina fnemina added the bug Something isn't working label Apr 9, 2021
@Tianfeng-Pink
Copy link

Hi fnemina,
I would like to ask whether the "Incorrect input value" problem would happen to the setting of observation parameters and aerosol parameters, like s.view.phi, s.ang.thetas and s.aer.lnb.cmiwa, and why this happens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants