fnemina / pyOSOAA

pyOSOAA is a python interface for the Ocean Successive Orders with Atmosphere - Advanced (OSOAA) radiative transfer.
GNU General Public License v3.0
20 stars 6 forks source link

Incorrect value handling with scientific notation #35

Open fnemina opened 3 years ago

fnemina commented 3 years ago

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.

Tianfeng-Pink commented 1 year ago

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.