I am trying to open a Sentinel 2 image using python. But snappy cannot read the xml. I get the following error
path:F:/hydromerit/Hydromedit/images/sentinel_2/SR/S2A_MSIL2A_20180404T092031_N0206_R093_T34TFK_20180404T105118.SAFE
Image processed:S2,20180404
Traceback (most recent call last):
File “F:\seo_dwarf\chl_scripts\Ocean_colour.py”, line 36, in
product=ProductIO.readProduct(path+’/MTD_MSIL2A.xml’)
RuntimeError: java.io.IOException: No valid tiles associated to product [MTD_MSIL2A.xml]
Any ideas?
marpet
July 31, 2018, 7:47am
2
Do you have the latest SNAP version? See:
Hi @antonio19812 ,
yes, you have to update your SNAP installation. The L2A product format has changed and it is supported since SNAP v6.0.1
I have already updated the snap desktop (snap 6.0.0) i was using. Then i reinstalled the snappy in the python using https://senbox.atlassian.net/wiki/spaces/SNAP/pages/50855941/Configure+Python+to+use+the+SNAP-Python+snappy+interface .
But i get the same error. Is there any other way to update snappy?
marpet
July 31, 2018, 9:01am
4
After reinstalling SNAP you should open the desktop app and do
Help / Check for Updates.
Then you get the latest module updates.
When i open the same image using snap desktop i don t have any problems only snappy can not open it. Also i used sen2cor to correct it atmoshperically.
marpet
July 31, 2018, 9:12am
6
Probably you stumbled upon the same error as reported here:
Hi Maxim,
I tried installing snappy. My conclusion is that you can use snappy only if your start the script from the snappy interface folder. For example I have installed snappy on C:\Users…snappy\snappy-python, if I run the script anywhere on c:\ the script is working, if I move on D:\ then I can’t use snappy and the script is not working. I’m using an anaconda 3 py34 environment.
Do you have any other opinion ?
In the last post of the thread, I describe a workaround.