using snappy in OLCI Sentinel 3 images

Hi, i’m new in the snappy world, i work with python 3.4 in windows 10, after struggling with the snappy configuration, it was achieved. On the SNAP platform, work with color images (S3A_OL_1_EFR) to obtain chlorophyll. Until there, all good. Now I want to start working with Python to automate the methodology and increase the number of images. Therefore I am practicing in building my scripts and running the program.

In this examples

import snappy
jpy = snappy.jpy
from snappy import ProductIO
File = jpy.get_type(‘java.io.File’)
archi=File(“S3A_OL_1_EFR____20190615T064725_20190615T065025_20190616T105435_0179_046_020_3060_LN1_O_NT_002.SEN3”)
product = ProductIO.readProduct(archi)
reader = snappy.ProductIO.getProductReader(SEN3)

show me this error

python prueba.py
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.
SEVERE: org.esa.snap.core.dataio.ProductIO: Error attempting to read S3A_OL_1_EFR____20190615T064725_20190615T065025_20190616T105435_0179_046_020_3060_LN1_O_NT_002.SEN3 with plugin reader org.csa.rstb.io.rcm.RCMProductReaderPlugIn@3df77dfa: null
java.lang.NullPointerException
at org.esa.s1tbx.io.ceos.alos2.Alos2GeoTiffProductReaderPlugIn.checkFileName(Alos2GeoTiffProductReaderPlugIn.java:124)
at org.esa.s1tbx.io.ceos.alos2.Alos2GeoTiffProductReaderPlugIn.getDecodeQualification(Alos2GeoTiffProductReaderPlugIn.java:108)
at org.esa.snap.core.dataio.ProductIO.getProductReaderForInput(ProductIO.java:263)
at org.esa.snap.core.dataio.ProductIO.readProductImpl(ProductIO.java:214)
at org.esa.snap.core.dataio.ProductIO.readProduct(ProductIO.java:206)
Traceback (most recent call last):
File “prueba.py”, line 7, in
reader = snappy.ProductIO.getProductReader(SEN3)
NameError: name ‘SEN3’ is not defined

i did really read about

ProductIO.readProduct and reader.readProductNodes

but i don’t have success

i hope you can help me, and I would also be very grateful if you can guide me to perform

-reprojections
-subsets
-C2CRR
-colour palette /colorbar
-log10
-min/max

from each OLCI image in snappy.

Thank you very much for readme!

Regards.

Hello,

There is the NullPointerException which should not happen. I’ve created an issue for this in our bug database.

Besides this, it is strange that the RCMProductReaderPlugIn is used to read the OLCI product. Maybe it is related to the path you provide.
Could you try to provide the full path to the product directory, if this still doesn’t work try to point to the xfdumanifest.xml file within the folder.

In addition the line

reader = snappy.ProductIO.getProductReader(SEN3)

is not correct. It should be

reader = snappy.ProductIO.getProductReader('SEN3')

Another hint, you don’t need to import File as you do. You can simply do:

from snappy import File

or

from snappy import ProductIO, File