Page 1 of 1

Polymer processing MSI images

Posted: Thu May 28, 2020 3:49 pm
by UanGQ1009
Hi,

I used Polymer 4.10 to process a MSI image by the following codes:
def Polymer_MSI_EU():

FName = '/mnt/share/data/msi_data/S2A_MSIL1C_20150806T102016_N0204_R065_T33VVE_20150806T102012.SAFE/GRANULE/L1C_T33VVE_A000634_20150806T102012/'
run_atm_corr(
Level1_MSI(FName, resolution='20', landmask=GSW()), # if not provided, use the 60m resolution
Level2_NETCDF() # by default, output in the same folder as input
)

But I got the following message:

File "polymer_msi_EU.py", line 18, in polymer_MSI_EU
Level1_MSI(FName, resolution='20', landmask=GSW()), # if not provided, use the 60m resolution
File "/media/sf_data/polymer-v4.10/polymer-v4.10/polymer/level1_msi.py", line 122, in __init__ assert len(xmlfiles) == 1
AssertionError

What should I do to deal with this error message?

Re: Polymer processing MSI images

Posted: Thu May 28, 2020 9:42 pm
by fsteinmetz
Hi,
Although the message is, I agree, not very explicit, it means that the required xml file is not found, but I see nothing wrong with your script.
Could you check in your directory FName, that there is a single xml file named MTD_TL.xml ?
Cheers,
François

Re: Polymer processing MSI images

Posted: Fri May 29, 2020 3:24 pm
by UanGQ1009
Hi,

Thanks a lot. I made a mistake about FName. But I have another question about landmask. When I input parameter of landmask as GSW. But I got an error message as follows:

'Data directory for GSW data (global surface water) does not exist: mkdir -p {}'

What does it mean? Should I download global surface water masks before or not?

Re: Polymer processing MSI images

Posted: Fri May 29, 2020 3:29 pm
by fsteinmetz
No, you just have to create the directory that appears in the error message with the provided command.
The mask will be downloaded automatically when you run the code again.

Re: Polymer processing MSI images

Posted: Fri May 29, 2020 7:57 pm
by UanGQ1009
Thanks a lot for your helps.