Problems encountered in processing sentinel2 data using polymer4.13

Post Reply
dingky
Posts: 37
Joined: Tue Jun 30, 2020 3:56 am
company / institution: China University of Geosciences
Location: China

Problems encountered in processing sentinel2 data using polymer4.13

Post by dingky »

Hello everyone,

When I run the following script

Code: Select all

from polymer.main import run_atm_corr
from polymer.level1_msi import Level1_MSI
from polymer.gsw import GSW
import polymer.level2_hdf
run_atm_corr(
    Level1_MSI('/home/ding/data/S2A_MSIL1C_20170402T024541_N0204_R132_T50RNV_20170402T025302/S2A_MSIL1C_20170402T024541_N0204_R132_T50RNV_20200727T095734.SAFE/GRANULE/L1C_T50RNV_A009281_20170402T025302', landmask=GSW(directory='/home/ding/data/outfile/gsw/')),
    polymer.level2_hdf(filename='20170402ss', outdir='/home/ding/data/outfile/')
)
Get the following error message

Code: Select all

Initialize MSI projection EPSG:32650
/home/ding/.local/lib/python3.8/site-packages/pyproj/crs/crs.py:280: FutureWarning: '+init=<authority>:<code>' syntax is deprecated. '<authority>:<code>' is the preferred initialization method. When making the change, be mindful of axis order changes: https://pyproj4.github.io/pyproj/stable/gotchas.html#axis-order-changes-in-proj-6
  projstring = _prepare_from_string(projparams)
Traceback (most recent call last):
  File "/home/ding/polymer-v4.13/Sentinel2_process.py", line 16, in <module>
    polymer.level2_hdf(filename='20170402ss', outdir='/home/ding/data/outfile/')
TypeError: 'module' object is not callable
How can i solve it


Kind regards,

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

Re: Problems encountered in processing sentinel2 data using polymer4.13

Post by fsteinmetz »

Hi,
polymer.level2_hdf is a module.
You have to import the Level2_HDF class like so : from polymer.level2_hdf import Level2_HDF
Cheers,
François
dingky
Posts: 37
Joined: Tue Jun 30, 2020 3:56 am
company / institution: China University of Geosciences
Location: China

Re: Problems encountered in processing sentinel2 data using polymer4.13

Post by dingky »

Hello,François


I modified it with reference to your suggestion, and then I got the following error message after running

Code: Select all

Traceback (most recent call last):
  File "/home/ding/polymer-v4.13/Sentinel2_process.py", line 12, in <module>
    from polymer.level2_hdf import Level2_hdf
ImportError: cannot import name 'Level2_hdf' from 'polymer.level2_hdf' (/home/ding/polymer-v4.13/polymer/level2_hdf.py)
Kind regards,

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

Re: Problems encountered in processing sentinel2 data using polymer4.13

Post by fsteinmetz »

Please mind the case sensitivity.
Cheers,
François
Post Reply