SEN-ET: Problem with 3.3.5 Estimate leaf reflectance and transmittance

Hi,

Im trying to process step 3.3.5 but get an error:

This is new to me, because in the past this step worked fine. I upgraded to SNAP 8, meanwhile. I´m using SEN-ET 1.0.1.
Can someone give an advice, perhaps?

Best regards
Rainer

[It would be easier to respond if you had posted the messages as text.] Your processing is using a SEN-ET supplied Python program: %USERPROFILE%\.snap\auxdata\sen-et-conda\Win64\python.exe to run snappy. Was snappy configured using a different python.exe?

To eliminate some other SEN-ET issue, try running the above Python program in a terminal to see if the example from Configure Python to use the SNAP Python snappy interface gives the same error. If so, try reconfiguring snappy using the SEN-ET Python program with snappy-conf as described in the above link.

Thank You. I already configured SNAP at the end of the installation process to run with Python 3.6 - like it is described in Your link. Nevertheless I did it again using the command line and got the following error (snappyuitl.log):

INFO: Installing from Java module ‘C:\Program Files\snap\snap\modules\org-esa-snap-snap-python.jar’
INFO: Installing jpy…
INFO: Extracting ‘lib/jpy-0.9.0-cp36-cp36m-win_amd64.whl’ from ‘C:\Program Files\snap\snap\modules\org-esa-snap-snap-python.jar’
INFO: Unzipping ‘C:\Users\Schlepphorst.snap\snap-python\snappy\lib\jpy-0.9.0-cp36-cp36m-win_amd64.whl’
INFO: Configuring jpy…
INFO: jpy Python API configuration written to ‘C:\Users\Schlepphorst.snap\snap-python\snappy\jpyconfig.py’
INFO: jpy Java API configuration written to ‘C:\Users\Schlepphorst.snap\snap-python\snappy\jpyconfig.properties’
INFO: Configuring snappy…
INFO: snappy configuration written to ‘C:\Users\Schlepphorst.snap\snap-python\snappy\snappy.ini’
INFO: Importing snappy for final test…
ERROR: Configuration failed with exit code 30

Is it perhaps because I´m using python 3.6 and not 3.4?

Now I made a complete new-installation of SNAP 8.0, Python 3.6.3 and SEN-ET. I configured SNAP to run with Python. But I get the same error as shown above:

Y:\EIP\Datenauswertung\Evapotranspirationmodellierung\Dahlhausen_20200702\Outputs\S2B_MSIL2A_20200625T101559_N0214_R065_T33UUU_OUTPUT_biophysical.dim --output_file Y:\EIP\Datenauswertung\Evapotranspirationmodellierung\Dahlhausen_20200702\Outputs\S2B_MSIL2A_20200625T101559_N0214_R065_T33UUU_OUTPUT_leaf_reflectance_transmittance.dim
Traceback (most recent call last):
File “C:\Users\Schlepphorst.snap\auxdata\sen-et-conda-Win64\sen-et-snap-scripts\leaf_spectra.py”, line 4, in
import snappy_utils as su
File “C:\Users\Schlepphorst.snap\auxdata\sen-et-conda-Win64\sen-et-snap-scripts\snappy_utils.py”, line 12, in
from snappy import ProductIO, Product, ProductData, ProductUtils, String
File “C:\Users\Schlepphorst.snap\auxdata\sen-et-conda-Win64\sen-et-snap-scripts…\snap-python\snappy_init_.py”, line 381, in
Engine.start()
RuntimeError: java.lang.ExceptionInInitializerError
Process exited with value 1
Finished tool execution in 10 second

Before that, I tried to get it work with Python 3.4, but it didn´t function, because SEN-ET requires P3.6.

It looks like your problem is not really related to Sen-ET but to snappy and/or java. @marpet are there any known issues with snappy for SNAP 8 and Python 3.6 on Windows?

Just for testing I switched back to SNAP7 and did not have that problem.

As @radosuav mentions, there is a problem with snappy. Python 3.6 (from Python.org) “works for me”:

PS C:\Users\<user>\.snap\snap-python> C:\Python36\python.exe
Python 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 24 2018, 00:16:47) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import snappy
INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: GDAL not found on system. Internal GDAL 3.0.0 from distribution will be used. (f1)
INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: Internal GDAL 3.0.0 set to be used by SNAP.
INFO: org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterIO: Initializing external tool adapters
INFO: org.esa.snap.core.util.EngineVersionCheckActivator: Please check regularly for new updates for the best SNAP experience.
>>>

There are many reasons that Python 3.6 can fail to import snappy, so we need to find some error messages. Look for C:\Users\Schlepphorst.snap\.snap\snap-python\snappy\snappy-util.log. Try the above import using C:\Users\Schlepphorst.snap\.snap\auxdata\sen-et-conda\Win64\python.exe. You might also look at the Reliability Monitor
(Control Panel/Security and Maintenance) for system problems.

Ok, I follow your approach:

C:\Users\Schlepphorst.snap\snap-python>py
Python 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 24 2018, 00:16:47) [MSC v.1916 64 bit (AMD64)] on win32
Type “help”, “copyright”, “credits” or “license” for more information.

import snappy

Traceback (most recent call last):
File “”, line 1, in
File “C:\Users\Schlepphorst.snap\snap-python\snappy_init_.py”, line 64, in
jpyutil.preload_jvm_dll()
File “C:\Users\Schlepphorst\AppData\Local\Programs\Python\Python36\lib\site-packages\jpyutil.py”, line 344, in preload_jvm_dll
return ctypes.CDLL(jvm_dll_file, mode=ctypes.RTLD_GLOBAL)
File “C:\Users\Schlepphorst\AppData\Local\Programs\Python\Python36\lib\ctypes_init_.py”, line 348, in init
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] Das angegebene Modul wurde nicht gefunden

This is a screenshot of my snappy folder:

I get the same error, as in the first post, on a Linux system:

Traceback (most recent call last):
File “/home/sarah/.snap/auxdata/sen-et-conda-Linux64/sen-et-snap-scripts/leaf_spectra.py”, line 4, in
import snappy_utils as su
File “/home/sarah/.snap/auxdata/sen-et-conda-Linux64/sen-et-snap-scripts/snappy_utils.py”, line 12, in
from snappy import ProductIO, Product, ProductData, ProductUtils, String
ModuleNotFoundError: No module named ‘snappy’
Process exited with value 1
Finished tool execution in 0 seconds

here is the log from C:\Users\Schlepphorst.snap\snap-python\snappy:

INFO: Installing from Java module ‘C:\Program Files\snap\snap\modules\org-esa-snap-snap-python.jar’
INFO: Installing jpy…
INFO: Extracting ‘lib/jpy-0.9.0-cp36-cp36m-win_amd64.whl’ from ‘C:\Program Files\snap\snap\modules\org-esa-snap-snap-python.jar’
INFO: Unzipping ‘C:\Users\Schlepphorst.snap\snap-python\snappy\lib\jpy-0.9.0-cp36-cp36m-win_amd64.whl’
INFO: Configuring jpy…
INFO: jpy Python API configuration written to ‘C:\Users\Schlepphorst.snap\snap-python\snappy\jpyconfig.py’
INFO: jpy Java API configuration written to ‘C:\Users\Schlepphorst.snap\snap-python\snappy\jpyconfig.properties’
INFO: Configuring snappy…
INFO: snappy configuration written to ‘C:\Users\Schlepphorst.snap\snap-python\snappy\snappy.ini’
INFO: Importing snappy for final test…
ERROR: Configuration failed with exit code 30

The linux problem seems different: python didn’t find the snappy module, but it isn;t the same test as the Windows example. On linux you should check that snappy can be loaded when python is run in the snap-python directory.

In your first post, the module named snappy was found, but couldn’t be initialized. In the Windows test you have:

C:\Users\Schlepphorst.snap\snap-python>py
Python 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 24 2018, 00:16:47) [MSC v.1916 64 bit (AMD64)] on win32
[...]
File “C:\Users\Schlepphorst\AppData\Local\Programs\Python\Python36\lib\site-packages\jpyutil.py”, line 344, in preload_jvm_dll

which appears to be a different Python installation than the SEN-ET supplied Python program: %USERPROFILE%\.snap\auxdata\sen-et-conda\Win64\python.exe. Your problem may be caused by a configuration error that results in mixing components from multiple Python installs using different compilers and run-time libraries. You could try creating a new user account where you only have SEN-ET’s Python. If this works you should look for help on Python-specific forums.

For your linux problem, you should start a new topic and include the snappyutil.log.

Ok, thanks - I try to understand this (the problem on Windows).

I think, no I´m quite shure, that my only “stand alone” Python interpreter is 3.6.8, which is located at C:\Users\Schlepphorst\AppData\Local\Programs\Python\Python36. For SEN-ET SNAP must be configured for use with Python 3.6 and when it comes to this point in the SNAP installation process I refered to the Python36-directory.

What do You mean with “where you only have SEN-ET’s Python”? Python 3.6.8?

However, I´m also using QGIS and GRASS QIS, which also use Python scripts (in their own directories?) And also, I had some older versions, like 3.4 or even 2.7, in the past. Do You think there could be fragments of this older versions, which are confusing SNAP/SEN-ET?

The image in your initial indicates that C:\Users\Schlepphorst.snap\.snap\auxdata\sen-et-conda\Win64\python.exe was used. You need to configure snappy to work with this Python executable.
Other python executables with the same version may not work, depending on how they were compiled.

More and more packages are installing a python.exe (and GDAL) because they can’t rely on Python executables and packages installed independently.
This can create problems if you are writing python scripts to run from a command line. On linux you can specify the python interpreter to be used by a Python script using the “hash-bang” (aka “shebang”) construct.

WinErr 126 has been discussed before. I have two Windows 10 systems, both using Python 3.6.8 from python.org. On one, snappy configured and runs simple tests On the other, snappy configured, but gives WinErr 126 for the import snappy test.

The <Dependencies program> reports that
snap\jre\jre\bin\server\jvm.dll fails to find MSVCR100.dll.

This .dll is present in snap\jre\jre\bin\, but can also be installed “system-wide” using the <Microsoft Visual C++ 2010 SP1 Redistributable Package (x64)>.

After running vcredist_x64.exe, the simple test runs.

Hi,
i am syam
I am working on SENET plugin for ET estimation.in that i struck at ECMWF ERA5 reanalysis data download and processing steps. I am not able to create netcdf file for supporting to download meteorological data. so any one please help me out from this problem. please share any source or any previous netcdf file (with variables) which will work. it will great help for my research.

thanks,

Hi, here is an example, that works (Northern German region).
Regards
Dahlhausen_Meteodaten_20200529_1.nc (94.4 KB)