luts.py error

Post Reply
lq17865155322
Posts: 4
Joined: Fri Dec 04, 2020 1:13 am
company / institution: DLMU
Location: NO.1 Linghai road

luts.py error

Post by lq17865155322 »

Hello everyone, hello Francois,
I want to process OLCI with polymer v4.13, but when I run the following command

Code: Select all

sudo python polymer_cli.py S3A_OL_1_EFR____20170919T020939_20170919T021239_20180713T211640_0180_022_217_2340_LR2_R_NT_002.SEN3
The processing results are as follows:

Code: Select all

Traceback (most recent call last):
  File "polymer_cli.py", line 11, in <module>
    from polymer.main import run_atm_corr, Level1, Level2
  File "/home/l/polymer-v4.13/polymer/main.py", line 8, in <module>
    from polymer.luts import read_mlut_hdf, Idx
  File "/home/l/polymer-v4.13/polymer/luts.py", line 999
    else f'dim_{next(idim)}'
                            ^
SyntaxError: invalid syntax
I configured the operating environment according to "readme.md" and compiled it with "make all". I am confused about where the problem is.

Thank you!
User avatar
fsteinmetz
Site Admin
Posts: 306
Joined: Fri Sep 07, 2018 1:34 pm
company / institution: Hygeos
Location: Lille, France
Contact:

Re: luts.py error

Post by fsteinmetz »

Hello,
I suspect you are using a python version older than 3.6, can you confirm ?
Python 3.6 or newer is required.
Cheers,
François
lq17865155322
Posts: 4
Joined: Fri Dec 04, 2020 1:13 am
company / institution: DLMU
Location: NO.1 Linghai road

Re: luts.py error

Post by lq17865155322 »

Hello Francois,
Thank you so much for your suggestion.
I confirmed that my python version is 3.7.0, and the above error still occurs.
Thank you!
User avatar
fsteinmetz
Site Admin
Posts: 306
Joined: Fri Sep 07, 2018 1:34 pm
company / institution: Hygeos
Location: Lille, France
Contact:

Re: luts.py error

Post by fsteinmetz »

Can you check that luts.py has not been modified ?
The line 999 of this file is part of a multi-line statement, and I don't see why there would be an invalid syntax here.
Or double-check that you are not using python2 by accident, I think this might be the most likely issue. Just type $ python --version to check
lq17865155322
Posts: 4
Joined: Fri Dec 04, 2020 1:13 am
company / institution: DLMU
Location: NO.1 Linghai road

Re: luts.py error

Post by lq17865155322 »

Hello Francois,
Thank you so much for your suggestion.
It is indeed due to my negligence that the python version is not configured correctly, and now it can run normally.
Thank you for providing such an excellent atmospheric correction algorithm!
cheers!
Post Reply