CNES / MAJA

Level-2A processor used for atmospheric correction and cloud-detection. The active repository is the one below, this one is kept to leave access to the older issues.
https://gitlab.orfeo-toolbox.org/maja/maja
Apache License 2.0
137 stars 25 forks source link

[reprog-rc1] DTM: jp2 not recognized as a supported file format. #49

Closed jerome-colin closed 4 years ago

jerome-colin commented 4 years ago

Fails to get DTM for tile 32TPR: error on jp2 file format raises an error in Common/ImageIO.py

2020-03-11 16:42:48,842 [DEBUG] Searching for DTM
2020-03-11 16:42:48,847 [DEBUG] Cannot find DTM. Will attempt to download it...
2020-03-11 16:42:48,847 [INFO ] Attempting to download DTM...
ERROR 4: /work/datalake/S2-L1C/32TPR/2018/05/02/S2A_MSIL1C_20180502T102031_N0206_R065_T32TPR_20180502T154426.SAFE/GRANULE/L1C_T32TPR_A014934_20180502T102434/IMG_DATA/T32TPR_20180502T102031_B02.jp2 not recognized as a supported file format.
Traceback (most recent call last):
  File "Start_maja.py", line 567, in <module>
    s.run()
  File "Start_maja.py", line 497, in run
    self.avail_input_l1[0].get_mnt(dem_dir=self.rep_mnt)
  File "/work/scratch/colinj/sandbox/Start-MAJA/Chain/Product.py", line 187, in get_mnt
    return MNTFactory(site=self.mnt_site, platform_id=self.platform_str,
  File "/work/scratch/colinj/sandbox/Start-MAJA/Chain/S2Product.py", line 71, in mnt_site
    return Site.from_raster(self.tile, band_b2)
  File "/work/scratch/colinj/sandbox/Start-MAJA/prepare_mnt/mnt/SiteInfo.py", line 83, in from_raster
    raster, driver = ImageIO.tiff_to_array(raster, array_only=False)
  File "/work/scratch/colinj/sandbox/Start-MAJA/Common/ImageIO.py", line 41, in tiff_to_array
    tiff_array = np.array(gdo.ReadAsArray(lon_offset_px, lat_offset_px))
AttributeError: 'NoneType' object has no attribute 'ReadAsArray'
petket-5 commented 4 years ago

This is working fine on my machine and the ci. This is not an error with prepare_mnt but with your gdal installation.: You seem to be missing the JPEG driver. Which gdal version are you using?

jerome-colin commented 4 years ago

Gdal 2.3. That was indeed a JPEG driver issue. Problem solved, thanks