Sentinel-2 image processing

Post Reply
wesley_fabricio
Posts: 1
Joined: Sun Apr 10, 2022 6:54 pm
company / institution: Universidade Federal do Rio Grande
Location: Rio Grande, RS - Brasil

Sentinel-2 image processing

Post 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.
User avatar
fsteinmetz
Site Admin
Posts: 306
Joined: Fri Sep 07, 2018 1:34 pm
company / institution: Hygeos
Location: Lille, France
Contact:

Re: Sentinel-2 image processing

Post 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
Post Reply