nansencenter / nansat

Scientist friendly Python toolbox for processing 2D satellite Earth observation data.
http://nansat.readthedocs.io
GNU General Public License v3.0
182 stars 66 forks source link

Windows path too long, even when the S1 file is directly on C:\ #520

Open FlashThunder opened 2 years ago

FlashThunder commented 2 years ago

Can't open Sentinel-1 image, because it says that path is too long on Windows...

12:30:39|40|nansat|_get_dataset_metadata|GDAL could not open C:\S1B_EW_GRDM_1SDH_INPUTFILE.zip, trying to read with Nansat mappers...
Traceback (most recent call last):
  File "C:\Users\xxx\anaconda3\envs\s1denoise3.6\Scripts\s1_correction.py", line 19, in <module>
    s1 = run_correction(args.ifile)
  File "C:\Users\xxx\anaconda3\envs\s1denoise3.6\lib\site-packages\s1denoise\tools.py", line 46, in run_correction
    s1 = Sentinel1Image(ifile)
  File "C:\Users\xxx\anaconda3\envs\s1denoise3.6\lib\site-packages\s1denoise\sentinel1image.py", line 29, in __init__
    Nansat.__init__( self, filename, mapperName=mapperName, logLevel=logLevel)
  File "C:\Users\xxx\anaconda3\envs\s1denoise3.6\lib\site-packages\nansat\nansat.py", line 159, in __init__
    self.vrt = self._get_mapper(mapper, **kwargs)
  File "C:\Users\xxx\anaconda3\envs\s1denoise3.6\lib\site-packages\nansat\nansat.py", line 1164, in _get_mapper
    tmp_vrt = nansatMappers[iMapper](self.filename, gdal_dataset, metadata, **kwargs)
  File "C:\Users\xxx\anaconda3\envs\s1denoise3.6\lib\site-packages\nansat\mappers\mapper_sentinel1_l1.py", line 103, in __init__
    self.annotation_data = self.read_annotation(annotation_files)
  File "C:\Users\xxx\anaconda3\envs\s1denoise3.6\lib\site-packages\nansat\mappers\mapper_sentinel1_l1.py", line 435, in read_annotation
    xml = Node.create(xml)
  File "C:\Users\xxx\anaconda3\envs\s1denoise3.6\lib\site-packages\nansat\node.py", line 307, in create
    if os.path.exists(dom):
  File "C:\Users\xxx\anaconda3\envs\s1denoise3.6\lib\genericpath.py", line 19, in exists
    os.stat(path)
ValueError: stat: path too long for Windows

Any fix for that?