Your example works for me (using SNAP 8.0.8 on Windows 10, ) , after changing the file name in the script to the name of the example file. The edited script is called snappy_reproject.py
, and also sets the path to the ESA SNAP snappy directory so I don’t run into conflicts with one of the other “snappy” packages. Normally I would try your script in Ubuntu 18, but I’m in the process of reconfiguring my systems.
Without the NASA SeaDAS plugin SNAP fails to read the metadata because it tries to use the sttbx reader (I added the .nc
extension in the hope that SNAP would use a more generic NetCDF4-CF reader).
PS D:\SNAP_Forum\snappy_reproject> ren .\A2020_02_10_173000_nir.L2_LAC_OC .\A2020_02_10_173000_nir.L2_LAC_OC.nc
PS D:\SNAP_Forum\snappy_reproject> py -3.6 .\snappy_reproject.py
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.
INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: Internal GDAL 3.0.0 set to be used by SNAP.
SEVERE: org.esa.snap.core.dataio.ProductIO: Error attempting to read A2020_02_10_173000_nir.L2_LAC_OC.nc with plugin reader org.esa.s1tbx.io.risat1.Risat1ProductReaderPlugIn@365cdacf
java.lang.NullPointerException
at org.esa.s1tbx.io.risat1.Risat1ProductReaderPlugIn.findMetadataFile(Risat1ProductReaderPlugIn.java:61)
at org.esa.s1tbx.io.risat1.Risat1ProductReaderPlugIn.findMetadataFile(Risat1ProductReaderPlugIn.java:80)
at org.esa.s1tbx.io.risat1.Risat1ProductReaderPlugIn.getDecodeQualification(Risat1ProductReaderPlugIn.java:44)
at org.esa.snap.core.dataio.ProductIO.getProductReaderForInput(ProductIO.java:304)
at org.esa.snap.core.dataio.ProductIO.readProductImpl(ProductIO.java:255)
at org.esa.snap.core.dataio.ProductIO.readProduct(ProductIO.java:207)
Nombre de las bandas que contiene: ['Rrs_412', 'Rrs_443', 'Rrs_488', 'Rrs_555', 'Rrs_645', 'Rrs_667', 'Rrs_859', 'Rrs_869', 'angstrom', 'aot_412', 'aot_443', 'aot_488', 'aot_555', 'aot_667', 'aot_869', 'chl_oc2', 'chl_oc3', 'nLw_412', 'nLw_443', 'nLw_488', 'nLw_555', 'nLw_667', 'nLw_869', 'l2_flags', 'longitude', 'latitude']
INFO: org.hsqldb.persist.Logger: dataFileCache open start
100% done.
Nombre de las bandas que contiene: ['Rrs_412', 'Rrs_443', 'Rrs_488', 'Rrs_555', 'Rrs_645', 'Rrs_667', 'Rrs_859', 'Rrs_869', 'angstrom', 'aot_412', 'aot_443', 'aot_488', 'aot_555', 'aot_667', 'aot_869', 'chl_oc2', 'chl_oc3', 'nLw_412', 'nLw_443', 'nLw_488', 'nLw_555', 'nLw_667', 'nLw_869', 'l2_flags', 'longitude', 'latitude']type or paste code here
I then installed the NASA SNAP SeaDAS Toolbox which is meant for an earlier SNAP version. This appears to work, but there is a conflict due to different SL4J bindings.
PS D:\SNAP_Forum\snappy_reproject> py -3.6 .\snappy_reproject.py
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.
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Users/gwhite/AppData/Roaming/SNAP/modules/ext/org.esa.snap.snap-netcdf/org-slf4j/slf4j-simple.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/Users/gwhite/AppData/Roaming/SNAP/modules/ext/gov.nasa.gsfc.seadas.seadas-processing/org-slf4j/slf4j-log4j12.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]
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.
INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: Internal GDAL 3.0.0 set to be used by SNAP.
Nombre de las bandas que contiene: ['Rrs_412', 'Rrs_443', 'Rrs_488', 'Rrs_555', 'Rrs_645', 'Rrs_667', 'Rrs_859', 'Rrs_869', 'angstrom', 'aot_412', 'aot_443', 'aot_488', 'aot_555', 'aot_667', 'aot_869', 'chl_oc2', 'chl_oc3', 'nLw_412', 'nLw_443', 'nLw_488', 'nLw_555', 'nLw_667', 'nLw_869', 'l2_flags', 'longitude', 'latitude']
log4j:WARN No appenders could be found for logger (hsqldb.db.HSQLDB4AD417742A.ENGINE).
log4j:WARN Please initialize the log4j system properly.
100% done.
Nombre de las bandas que contiene: ['Rrs_412', 'Rrs_443', 'Rrs_488', 'Rrs_555', 'Rrs_645', 'Rrs_667', 'Rrs_859', 'Rrs_869', 'angstrom', 'aot_412', 'aot_443', 'aot_488', 'aot_555', 'aot_667', 'aot_869', 'chl_oc2', 'chl_oc3', 'nLw_412', 'nLw_443', 'nLw_488', 'nLw_555', 'nLw_667', 'nLw_869', 'l2_flags', 'longitude', 'latitude']
Can you try running snappy with OpenJDK JRE 8 and jpy-0.9.0?