I try to use Polymer 4.13 to process MSI data. I work with Python 3.4, I change some function to use Polymer 4.13 with Python 3.4 (f-string in .format). I'm trying to launch the example.py program which only launch the following command:
Code: Select all
run_atm_corr(
Level1_MSI("/mount/internal/home/users/samaaouch/_unix/Test img/S2B_MSIL1C_20190716T110629_N0208_R137_T30UVV_20190716T131056.SAFE/GRANULE/L1C_T30UVV_A012318_20190716T111721/",
resolution='60' # if not provided, use the 60m resolution
),
Level2_NETCDF() # by default, output in the same folder as input
)
Code: Select all
Initialize MSI projection EPSG:32630
Starting processing at 2020-06-30 15:53:46.903814
Initializing output file "/mount/internal/home/users/samaaouch/_unix/Test img/S2B_MSIL1C_20190716T110629_N0208_R137_T30UVV_20190716T131056.SAFE/GRANULE/L1C_T30UVV_A012318_20190716T111721.nc"
/mount/internal/home/users/samaaouch/_unix/.local/lib/python3.4/site-packages/glymur/jp2box.py:196: UserWarning: Encountered an unrecoverable ValueError while parsing a XML box at byte offset 142. The original error message was "Unicode strings with encoding declaration are not supported. Please use bytes input or XML fragments without declaration."
warnings.warn(msg, UserWarning)
Traceback (most recent call last):
File "/mount/internal/home/users/samaaouch/_unix/.local/lib/python3.4/site-packages/glymur/jp2k.py", line 1155, in _read_openjpeg
data = extract_image_cube(image)
File "/mount/internal/home/users/samaaouch/_unix/.local/lib/python3.4/site-packages/glymur/jp2k.py", line 1847, in extract_image_cube
ncomps = image.contents.numcomps
ValueError: NULL pointer access
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "example.py", line 120, in <module>
example_msi()
File "example.py", line 47, in example_msi
Level2_NETCDF() # by default, output in the same folder as input
File "/usr/local/polymere/polymer-v4.13/polymer/main.py", line 517, in run_atm_corr
for block in block_iter:
File "/usr/local/polymere/polymer-v4.13/polymer/main.py", line 434, in blockiterator
for block in level1.blocks(params.bands_read()):
File "/usr/local/polymere/polymer-v4.13/polymer/level1_msi.py", line 402, in blocks
yield self.read_block(size, offset, bands_read)
File "/usr/local/polymere/polymer-v4.13/polymer/level1_msi.py", line 333, in read_block
raw_data = self.read_TOA(band, size, offset)
File "/usr/local/polymere/polymer-v4.13/polymer/level1_msi.py", line 280, in read_TOA
int(xrat*(xoffset+self.scol)) : int(xrat*(xoffset+self.scol+xsize))
File "/mount/internal/home/users/samaaouch/_unix/.local/lib/python3.4/site-packages/glymur/jp2k.py", line 1020, in __getitem__
data = self._read(area=area, rlevel=rlevel)
File "/mount/internal/home/users/samaaouch/_unix/.local/lib/python3.4/site-packages/glymur/jp2k.py", line 1041, in _read
img = self._read_openjpeg(**kwargs)
File "/mount/internal/home/users/samaaouch/_unix/.local/lib/python3.4/site-packages/glymur/jp2k.py", line 1158, in _read_openjpeg
opj2.check_error(0)
File "/mount/internal/home/users/samaaouch/_unix/.local/lib/python3.4/site-packages/glymur/lib/openjp2.py", line 591, in check_error
raise IOError(msg)
OSError: OpenJPEG library error: Integer overflow in box->length
OpenJPEG library error: Failed to decode jp2 structure
I think it is maybe a problem of OpenJPEG version but I don't find any solutions on the web.
Any ideas?
Thank you
Kind regards
Sonia