Snappy sentinel2 SNAP 6.0

I download the sentinel2 from copernicus esa or I am trying to read sentinel2 using snappy by reading the files first, but there is some error like this :

Python 3.4.4 (v3.4.4:737efcadf5a6, Dec 20 2015, 20:20:57) [MSC v.1600 64 bit (AMD64)] on win32
Type “help”, “copyright”, “credits” or “license” for more information.

from snappy import ProductIO
INFO: org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterIO: Initializing external tool adapters

from snappy import GPF
from snappy import jpy
_path1 = “F:\Sentinel data\S2A\1.S2A_OPER_PRD_MSIL1C\2018\20180901\”
sentinel1 = ProductIO.readProduct(path1)
Traceback (most recent call last):
File “”, line 1, in
NameError: name ‘path1’ is not defined

sentinel1 = ProductIO.readProduct(_path1)
Traceback (most recent call last):
File “”, line 1, in
RuntimeError: File not found: F:\Sentinel data\S2A.S2A_OPER_PRD_MSIL1C\x818\x8180901\

This product Is read using zip files. anyone can help? and also guidance step for sentinel2 imagery after reading the image whether need sen2cor or not? thank you.

1 Like

You should correct the path.
Either use slashes ‘/’ in your or put r in front of the string

r"F:\Sentinel data\S2A\1.S2A_OPER_PRD_MSIL1C\2018\20180901\"

In your case, the ‘\1’ was replaced. The same for ‘\2’. A backslash in combination with certain characters has special meanings.
With the prepended r the backslash is interpreted as a backslash.

1 Like

thank you for your help. It manages using slashes ‘/’. I thought it is python format.