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

Problems in generating lookup tables #27

Closed ghost closed 5 years ago

ghost commented 5 years ago

You know, we need a range of solar zenith angles and sensor zenith angles to generate a lookup table. When i change solar zenith angle, problem arise.

1 No Output file

When i run the following code, it works normally.

import numpy as np
import pyOSOAA
from pyOSOAA.osoaahelpers import RunWavelengths

s = pyOSOAA.OSOAA()
view = 0
wavelengths = np.array([412, 443, 490, 510, 555, 670, 765, 865])/1000

s.view.phi = 90
s.ang.thetas = 60

# Sea bottom configuration
s.sea.depth = 0.05
s.sea.bottype = 1
s.sea.botalb = 0

# Sea particles configuration
s.phyto.chl = 0
s.sed.csed = 0
s.det.abs440 = 0
s.ys.abs440 = 0

# Sea surface configuration
s.sea.wind = 10

# Small optical thickness
s.aer.aotref = 0.00001

s.ap.SetPressure(1013.25)

# Set view level at TOA
s.view.level = 1
rhor = RunWavelengths(s, wavelengths, view)/np.cos(np.pi*view/180.0)

I change the s.ang.thetas = 40. The output is :arrow_down:

==> Angles calculation
 ==> Aerosols radiative properties computation
 Aerosols --> Mie files repertory : /usr/local/OSOAA/DATABASE/MIE_AER
 Aerosols --> Mie files repertory : /usr/local/OSOAA/DATABASE/MIE_AER
 ==> Hydrosols radiative properties computation
 ==> Atmospheric and sea profiles computation
 ==> Sea / atmosphere interface matrices computation
 Surface matrices repertory : /usr/local/OSOAA/DATABASE/SURF_MATR
 Matrix RAA : RAA-1.340-10.0-RadMU48-NB80
 -- RAA Matrix file is being calculated
   OSOAA_MISE_FORMAT : ERROR_991 on a file opening
   OSOAA_SURFACE_CASE : ERROR_998  
       on subroutine OSOAA_MISE_FORMAT
       for case : RAA
   OSOAA_SURFACE : ERROR_3000  
       on subroutine OSOAA_SURFACE_RAA
   OSOAA_MAIN : ERROR_8000 on subroutine OSOAA_SURFACE
Traceback (most recent call last):
  File "/home/qiaofeng/.vscode/extensions/ms-python.python-2019.6.24221/pythonFiles/ptvsd_launcher.py", line 43, in <module>
    main(ptvsdArgs)
  File "/home/qiaofeng/.vscode/extensions/ms-python.python-2019.6.24221/pythonFiles/lib/python/ptvsd/__main__.py", line 434, in main
    run()
  File "/home/qiaofeng/.vscode/extensions/ms-python.python-2019.6.24221/pythonFiles/lib/python/ptvsd/__main__.py", line 312, in run_file
    runpy.run_path(target, run_name='__main__')
  File "/usr/lib/python3.6/runpy.py", line 263, in run_path
    pkg_name=pkg_name, script_name=fname)
  File "/usr/lib/python3.6/runpy.py", line 96, in _run_module_code
    mod_name, mod_spec, pkg_name, script_name)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/qiaofeng/Documents/Atmospheric-correction-for-GOCI/test.py", line 81, in <module>
    results = RunWavelengths(s, wavelengths, view)/np.cos(np.pi*view/180.0)
  File "/usr/local/lib/python3.6/dist-packages/pyOSOAA-1.1-py3.6.egg/pyOSOAA/osoaahelpers.py", line 75, in RunWavelengths
  File "/usr/local/lib/python3.6/dist-packages/pyOSOAA-1.1-py3.6.egg/pyOSOAA/osoaa.py", line 1311, in run
  File "/usr/local/lib/python3.6/dist-packages/pyOSOAA-1.1-py3.6.egg/pyOSOAA/outputs.py", line 429, in __init__
  File "/usr/local/lib/python3.6/dist-packages/pyOSOAA-1.1-py3.6.egg/pyOSOAA/outputs.py", line 68, in __init__
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/OSOAA/results/M39N3x3dFo0ULQV4/Standard_outputs/LUM_vsVZA.txt'

When i change s.ang.thetas = 40 to s.ang.thetas = 80, the problem still exists. I don't know why and how to do.

2 RunWavelengths(s, wavelengths, view) not support numpy

I use this sensor_zenith_angles = np.arange(60,90,2) to create a range of sensor zenith angles. Then in the for loop run RunWavelengths(s, wavelengths, view)

for solar_zenith_angle in solar_zenith_angles:
    s.ang.thetas = solar_zenith_angle
    results = RunWavelengths(s, wavelengths, view)

Errors are reported as follows :arrow_down::

 ==> Angles calculation
 ==> Aerosols radiative properties computation
 Aerosols --> Mie files repertory : /usr/local/OSOAA/DATABASE/MIE_AER
 Aerosols --> Mie files repertory : /usr/local/OSOAA/DATABASE/MIE_AER
 ==> Hydrosols radiative properties computation
 ==> Atmospheric and sea profiles computation
 ==> Sea / atmosphere interface matrices computation
 Surface matrices repertory : /usr/local/OSOAA/DATABASE/SURF_MATR
 ==> Radiative transfer computation
Note: The following floating-point exceptions are signalling: IEEE_INVALID_FLAG IEEE_DENORMAL
Traceback (most recent call last):
  File "/home/qiaofeng/.vscode/extensions/ms-python.python-2019.6.24221/pythonFiles/ptvsd_launcher.py", line 43, in <module>
    main(ptvsdArgs)
  File "/home/qiaofeng/.vscode/extensions/ms-python.python-2019.6.24221/pythonFiles/lib/python/ptvsd/__main__.py", line 434, in main
    run()
  File "/home/qiaofeng/.vscode/extensions/ms-python.python-2019.6.24221/pythonFiles/lib/python/ptvsd/__main__.py", line 312, in run_file
    runpy.run_path(target, run_name='__main__')
  File "/usr/lib/python3.6/runpy.py", line 263, in run_path
    pkg_name=pkg_name, script_name=fname)
  File "/usr/lib/python3.6/runpy.py", line 96, in _run_module_code
    mod_name, mod_spec, pkg_name, script_name)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/qiaofeng/Documents/Atmospheric-correction-for-GOCI/test.py", line 83, in <module>
    results = RunWavelengths(s, wavelengths, view)/np.cos(np.pi*view/180.0)
  File "/usr/local/lib/python3.6/dist-packages/pyOSOAA-1.1-py3.6.egg/pyOSOAA/osoaahelpers.py", line 80, in RunWavelengths
**IndexError: invalid index to scalar variable.**

3 Can your boss let you share the code that generates the lookup table?