nasa / RtRetrievalFramework

Other
47 stars 38 forks source link

Python wrapper import error #4

Open happysky19 opened 5 years ago

happysky19 commented 5 years ago

Hi,

I am still working this version because meet some environment errors during compiling ReFRACtor on our server...

For this version, I have passed all test run, now I am trying to work on the python wrapper.

I following the instruction here http://nasa.github.io/RtRetrievalFrameworkDoc/python_wrappers.html.

from full_physics import *

But got "NameError: name 'L2FpConfigurationLua' is not defined",

I check the full_physics directory, (for me is /home/thl/04.OCO2/RtRetrievalFramework/build_fp/install/lib/python2.7/site-packages/full_physics ). There are no function called 'L2FpConfigurationLua'.

However, I can find this function under "full_physics_swig" directory,

Then I try to import full_physics_swig in python, then got following error:

import full_physics_swig as fps Traceback (most recent call last): File "", line 1, in File "/home/thl/04.OCO2/RtRetrievalFramework/build_fp/install/lib/python2.7/site-packages/full_physics_swig/init.py", line 9, in exec('from .%s import ' % mname) File "", line 1, in File "/home/thl/04.OCO2/RtRetrievalFramework/build_fp/install/lib/python2.7/site-packages/full_physics_swig/init.py", line 9, in exec('from .%s import ' % mname) File "", line 1, in File "/home/thl/04.OCO2/RtRetrievalFramework/build_fp/install/lib/python2.7/site-packages/full_physics_swig/oco_noise_model.py", line 32, in _oco_noise_model = swig_import_helper() File "/home/thl/04.OCO2/RtRetrievalFramework/build_fp/install/lib/python2.7/site-packages/full_physics_swig/oco_noise_model.py", line 24, in swig_import_helper import _oco_noise_model ImportError: No module named _oco_noise_model

Any suggestions?

Thanks, Tianhao

rocheseb commented 5 years ago

Hi Tianhao,

I was having the same issue, oco_noise_level.py was added in the last commit: https://github.com/nasa/RtRetrievalFramework/commit/3ce96f0768c909c41b75e80573d946b4a074891d

I reverted that last commit and the python imports worked.

cshsgy commented 5 years ago

Hi Tianhao,

I was having the same issue, oco_noise_level.py was added in the last commit: 3ce96f0

I reverted that last commit and the python imports worked.

Hi Rocheseb, I am also having a similar problem with Pythonwrapper. By having build 8.1.00 instead, I was able to import successfully. However, when I tried to set up the configuration, it shows:

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-12-f8cf9bc78d6c> in <module>()
----> 1 conf = L2FpConfigurationLua('/home/shc/RtRetrievalFramework-B8.1.00_sdosesting_1/input/oco/config/config.lua')

/home/shc/RtRetrievalFramework-B8.1.00_sdos_testing_1/build_pythonwrapper/installib/python2.7/site-packages/full_physics_swig/l2_fp_configuration_lua.pyc in __it__(self, *args)
    194
    195         """
--> 196         _l2_fp_configuration_lua.L2FpConfigurationLua_swiginit(self, _l2p_configuration_lua.new_L2FpConfigurationLua(*args))
    197
    198     def _v_lua_state(self):

RuntimeError: Lua error: ...onwrapper/install/etc/full_physics/config/oco_configua:168: attempt to index local 'l1b_hdf_file' (a nil value)

Have you run the Python wrapper successfully? If so, do you have any idea about how I can properly set up the configuration in python? Thanks!