Page 1 of 1

Sentinel-2 image processing

Posted: Tue Apr 12, 2022 7:49 pm
by wesley_fabricio
Hello,

I'm trying to run Polymer with a python script, but I'm getting some syntax error(SyntaxError: positional argument follows keyword argument ) that I can't identify.

Script:
from polymer.main import run_atm_corr, Level1, Level2
from polymer.level1_msi import Level1_MSI
from polymer.level2 import default_datasets
from polymer.ancillary_era5 import Ancillary_ERA5
from polymer.gsw import GSW
from glob import glob
from pathlib import Path

for filename in Path('/home/wesley/polymer-v4.13/dados/Nivel1/S2A_MSIL1C_20170803T133005.SAFE').glob('**/GRANULE/*'):
run_atm_corr(Level1_MSI(str(/home/wesley/polymer-v4.13/dados/Nivel1/S2A_MSIL1C_20170803T133005.SAFE/GRANULE/S2A_OPER_MSI_L1C_TL_MTI__20170803T194033_A011046_T22HCK_N02.05)), sline=4968, eline=7926, scol=8928, ecol=10980, resolution='10', ancillary=Ancillary_ERA5(), landmask=GSW(), Level2_NETCDF(outdir='dados/polymer_outputs/granules', datasets=default_datasets+['SPM']))

Thank you in advance,
Wesley.

Re: Sentinel-2 image processing

Posted: Fri May 06, 2022 8:42 am
by fsteinmetz
Dear Wesley,

Indeed, the arguments sline, eline, ..., landmask should be arguments to Level1_MSI, not run_atm_corr.
You have to move a closing parenthesis after these arguments.
Cheers,
François