Page 1 of 1

Problems encountered in processing sentinel2 data using polymer4.13

Posted: Sat Sep 19, 2020 2:53 am
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

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

Posted: Mon Sep 21, 2020 7:59 am
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

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

Posted: Mon Sep 21, 2020 1:18 pm
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

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

Posted: Tue Sep 22, 2020 10:04 am
by fsteinmetz
Please mind the case sensitivity.
Cheers,
François