Polymer running on Sentinel-2 images

Post Reply
dfrgttn
Posts: 2
Joined: Sat Jun 22, 2019 10:30 am
company / institution: Vilnius University
Location: Lithuania

Polymer running on Sentinel-2 images

Post by dfrgttn »

Hello!

I installed anaconda, created an environment and installed required dependencies.
I am trying to run Polymer on Sentinel-2 images, however, this does not work to me:

Code: Select all

./polymer_cli.py S2A_MSIL1C_20170502T093041_N0205_R136_T35UMB_20170502T093358.SAFE
I received an error message:

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/dalia/Documents/polymer-v4.12/polymer/main.py", line 18, in <module>
    from polymer.polymer_main import PolymerMinimizer
ImportError: /home/dalia/Documents/polymer-v4.12/polymer/polymer_main.so: undefined symbol: _Py_ZeroStruct
Then I tried to run through python:

Code: Select all

Level1_MSI('S2A_MSIL1C_20170502T093041_N0205_R136_T35UMB_20170502T093358.SAFE')
I received an error about a line 122 in file level1_msi.py as there are two xmls in current S2 products. So I removed this line and changed the line 123 to

Code: Select all

xmlfile = xmlfiles[1]
But then I get errors about the line 125 where Sensing time should be retrieved and I tried inserting "Product_start_time" that is found in the MTD_MSIL1C.xml file.

Could you help me? Or maybe you have old formatted metadata file?
I use linux 18.04.3 LTS and Polymer 4.12.

Kind regards,
Dalia
User avatar
fsteinmetz
Site Admin
Posts: 54
Joined: Fri Sep 07, 2018 1:34 pm
company / institution: Hygeos
Location: Lille, France
Contact:

Re: Polymer running on Sentinel-2 images

Post by fsteinmetz »

Dear Dalia,

It seems that you may be using different versions of python for the compilation and the execution. Please make sure you are using python3 for both and use the following commands :
  • python --version (to verify that you are using python 3)
  • make rebuild
  • python polymer_cli.py (Just in case ./polymer_cli.py would use another interpreter for some reason)
If this still fails, could you send the output of conda list ?

Kind regards,
François
dfrgttn
Posts: 2
Joined: Sat Jun 22, 2019 10:30 am
company / institution: Vilnius University
Location: Lithuania

Re: Polymer running on Sentinel-2 images

Post by dfrgttn »

Thank you, François, for an answer.
I managed to run Polymer in python. It runs well and produces a result, but I get a warning like this:

Code: Select all

FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use `arr[tuple(seq)]` instead of `arr[seq]`. In the future this will be interpreted as an array index, `arr[np.array(seq)]`, which will result either in an error or a different result.
Should I be worried?
I use python 3.8.0.

Best regards,
Dalia
User avatar
fsteinmetz
Site Admin
Posts: 54
Joined: Fri Sep 07, 2018 1:34 pm
company / institution: Hygeos
Location: Lille, France
Contact:

Re: Polymer running on Sentinel-2 images

Post by fsteinmetz »

Good news !
No, this is just a warning, you can safely ignore it.
Cheers,
François
Post Reply