RuntimeError: Sequence argument must have length equal to input rank

Good morning everyone,
Good morning @umwilm,

I wanted to test the new sen2three but I receive an error message after some time. Does anyone has the same experience? Has anyone a solution?

I installed Anaconda, sen2cor (worked properly) and sen2three on a Windows 10 Home Laptop. I copied the L2A-Products to a separate directory (C:\S2\T) and processed as followed:

Cheers
Andreas

C:\SNAP_thirdParty\sen2three-1.0.0>L3_Process C:\S2\T

Sentinel-2 Level 3 Prototype Processor (SEN2THREE), 1.0.0, created: 2016.07.07 started ...
All tiles already processed.

Sentinel-2 Level 3 Prototype Processor (SEN2THREE), 1.0.0, created: 2016.07.07 started ...
Procedure L3_Tables: start import, elapsed time[s]: 0.499
Progress[%]: 0.06 : Procedure L3_Tables: Level L3 band B02 imported, elapsed time[s]: 10.201
Progress[%]: 1.28 : Procedure L3_Tables: Level L3 band B03 imported, elapsed time[s]: 8.771
Progress[%]: 2.34 : Procedure L3_Tables: Level L3 band B04 imported, elapsed time[s]: 8.755
Progress[%]: 3.39 : Procedure L3_Tables: Level L3 band B05 imported, elapsed time[s]: 8.624
Progress[%]: 4.42 : Procedure L3_Tables: Level L3 band B06 imported, elapsed time[s]: 8.782
Progress[%]: 5.48 : Procedure L3_Tables: Level L3 band B07 imported, elapsed time[s]: 8.927
Progress[%]: 6.55 : Procedure L3_Tables: Level L3 band B8A imported, elapsed time[s]: 8.848
Progress[%]: 7.61 : Procedure L3_Tables: Level L3 band B11 imported, elapsed time[s]: 7.795
Progress[%]: 8.54 : Procedure L3_Tables: Level L3 band B12 imported, elapsed time[s]: 7.705
Progress[%]: 9.47 : Procedure L3_Tables: Level L3 band AOT imported, elapsed time[s]: 6.095
Progress[%]: 10.20 : Procedure L3_Tables: Level L3 band SCL imported, elapsed time[s]: 2.028
Progress[%]: 10.44 : Procedure L3_Tables: start import, elapsed time[s]: 0.542
Progress[%]: 10.51 : Procedure L3_Tables: Level L3 band B02 imported, elapsed time[s]: 11.774
Progress[%]: 11.92 : Procedure L3_Tables: Level L3 band B03 imported, elapsed time[s]: 11.760
Progress[%]: 13.33 : Procedure L3_Tables: Level L3 band B04 imported, elapsed time[s]: 11.520
Progress[%]: 14.71 : Procedure L3_Tables: Level L3 band B05 imported, elapsed time[s]: 11.384
Progress[%]: 16.08 : Procedure L3_Tables: Level L3 band B06 imported, elapsed time[s]: 11.695
Progress[%]: 17.48 : Procedure L3_Tables: Level L3 band B07 imported, elapsed time[s]: 11.845
Progress[%]: 18.90 : Procedure L3_Tables: Level L3 band B8A imported, elapsed time[s]: 11.700
Progress[%]: 20.31 : Procedure L3_Tables: Level L3 band B11 imported, elapsed time[s]: 10.038
Progress[%]: 21.51 : Procedure L3_Tables: Level L3 band B12 imported, elapsed time[s]: 10.050
Progress[%]: 22.72 : Procedure L3_Tables: Level L3 band AOT imported, elapsed time[s]: 6.927
Progress[%]: 23.55 : Procedure L3_Tables: Level L3 band SCL imported, elapsed time[s]: 3.421
Progress[%]: 23.96 : Procedure L3_Tables: start import, elapsed time[s]: 0.073
Progress[%]: 23.97 : Procedure L3_Tables: Level L2A band B02 imported, elapsed time[s]: 8.960
Progress[%]: 25.04 : Procedure L3_Tables: Level L2A band B03 imported, elapsed time[s]: 9.067
Progress[%]: 26.13 : Procedure L3_Tables: Level L2A band B04 imported, elapsed time[s]: 9.175
Progress[%]: 27.23 : Procedure L3_Tables: Level L2A band B05 imported, elapsed time[s]: 9.073
Progress[%]: 28.32 : Procedure L3_Tables: Level L2A band B06 imported, elapsed time[s]: 9.682
Progress[%]: 29.48 : Procedure L3_Tables: Level L2A band B07 imported, elapsed time[s]: 9.791
Progress[%]: 30.66 : Procedure L3_Tables: Level L2A band B8A imported, elapsed time[s]: 9.645
Progress[%]: 31.82 : Procedure L3_Tables: Level L2A band B11 imported, elapsed time[s]: 8.784
Progress[%]: 32.87 : Procedure L3_Tables: Level L2A band B12 imported, elapsed time[s]: 9.479
Progress[%]: 34.01 : Procedure L3_Tables: Level L2A band AOT imported, elapsed time[s]: 6.305
Progress[%]: 34.76 : Procedure L3_Tables: Level L2A band SCL imported, elapsed time[s]: 2.272
Progress[%]: 35.04 : Procedure L3_Process: processing with resolution 20 m, elapsed time[s]: 0.021
Progress[%]: 35.04 : Procedure L3_Process: start of Pre Processing, elapsed time[s]: 0.003
Progress[%]: 35.04 : Procedure L3_Process: start of Spatio Temporal Processing, elapsed time[s]: 0.002
Progress[%]: 35.04 : Procedure L3_Synthesis: pre processing, elapsed time[s]: 0.003
Progress[%]: 35.04 : Procedure L3_Process: nr processed tiles: 1, elapsed time[s]: 0.003
Progress[%]: 35.04 : Procedure L3_Tables: start import, elapsed time[s]: 36.345
Progress[%]: 39.40 : Procedure L3_Tables: Level L3 band B02 imported, elapsed time[s]: 11.298
Progress[%]: 40.76 : Procedure L3_Tables: Level L3 band B03 imported, elapsed time[s]: 11.320
Progress[%]: 42.11 : Procedure L3_Tables: Level L3 band B04 imported, elapsed time[s]: 11.648
Progress[%]: 43.51 : Procedure L3_Tables: Level L3 band B05 imported, elapsed time[s]: 11.555
Progress[%]: 44.90 : Procedure L3_Tables: Level L3 band B06 imported, elapsed time[s]: 11.475
Progress[%]: 46.28 : Procedure L3_Tables: Level L3 band B07 imported, elapsed time[s]: 11.884
Progress[%]: 47.70 : Procedure L3_Tables: Level L3 band B8A imported, elapsed time[s]: 11.842
Progress[%]: 49.12 : Procedure L3_Tables: Level L3 band B11 imported, elapsed time[s]: 10.454
Progress[%]: 50.38 : Procedure L3_Tables: Level L3 band B12 imported, elapsed time[s]: 10.305
Progress[%]: 51.61 : Procedure L3_Tables: Level L3 band AOT imported, elapsed time[s]: 6.484
Progress[%]: 52.39 : Procedure L3_Tables: Level L3 band SCL imported, elapsed time[s]: 2.543
Progress[%]: 52.70 : Procedure L3_Process: start of Post Processing, elapsed time[s]: 0.021
Progress[%]: 52.70 : Procedure L3_Tables: start export, elapsed time[s]: 0.003
Progress[%]: 52.70 : Procedure L3_Tables: band B02 exported, elapsed time[s]: 9.923
Progress[%]: 53.89 : Procedure L3_Tables: band B03 exported, elapsed time[s]: 10.077
Progress[%]: 55.10 : Procedure L3_Tables: band B04 exported, elapsed time[s]: 10.054
Progress[%]: 56.31 : Procedure L3_Tables: band B05 exported, elapsed time[s]: 9.893
Progress[%]: 57.49 : Procedure L3_Tables: band B06 exported, elapsed time[s]: 10.807
Progress[%]: 58.79 : Procedure L3_Tables: band B07 exported, elapsed time[s]: 10.486
Progress[%]: 60.05 : Procedure L3_Tables: band B8A exported, elapsed time[s]: 10.580
Progress[%]: 61.32 : Procedure L3_Tables: band B11 exported, elapsed time[s]: 9.244
Progress[%]: 62.43 : Procedure L3_Tables: band B12 exported, elapsed time[s]: 9.145
Progress[%]: 63.52 : Procedure L3_Tables: band SCL exported, elapsed time[s]: 3.643
Progress[%]: 63.96 : Procedure L3_Tables: band MSC exported, elapsed time[s]: 2.888
Progress[%]: 64.31 : Procedure L3_Tables: stop export, elapsed time[s]: 0.067
Progress[%]: 64.31 : Procedure L3_Tables: start export, elapsed time[s]: 0.008
Progress[%]: 64.32 : Procedure L3_Tables: band B02 exported, elapsed time[s]: 12.713
Progress[%]: 65.84 : Procedure L3_Tables: band B03 exported, elapsed time[s]: 12.579
Progress[%]: 67.35 : Procedure L3_Tables: band B04 exported, elapsed time[s]: 12.262
Progress[%]: 68.82 : Procedure L3_Tables: band B05 exported, elapsed time[s]: 12.510
Progress[%]: 70.32 : Procedure L3_Tables: band B06 exported, elapsed time[s]: 12.685
Progress[%]: 71.85 : Procedure L3_Tables: band B07 exported, elapsed time[s]: 12.760
Progress[%]: 73.38 : Procedure L3_Tables: band B8A exported, elapsed time[s]: 12.826
Progress[%]: 74.92 : Procedure L3_Tables: band B11 exported, elapsed time[s]: 10.571
Progress[%]: 76.18 : Procedure L3_Tables: band B12 exported, elapsed time[s]: 10.596
Progress[%]: 77.45 : Procedure L3_Tables: band SCL exported, elapsed time[s]: 4.671
Progress[%]: 78.02 : Traceback (most recent call last):
  File "C:\Anaconda2\Scripts\L3_Process-script.py", line 11, in <module>
    load_entry_point('sen2three==1.0.0', 'console_scripts', 'L3_Process')()
  File "C:\Anaconda2\lib\site-packages\sen2three-1.0.0-py2.7.egg\sen2three\L3_Process.py", line 255, in main
    processor.postProcessing()
  File "C:\Anaconda2\lib\site-packages\sen2three-1.0.0-py2.7.egg\sen2three\L3_Process.py", line 124, in postProcessing
    res = self.tables.exportTile(tile)
  File "C:\Anaconda2\lib\site-packages\sen2three-1.0.0-py2.7.egg\sen2three\L3_Tables.py", line 604, in exportTile
    self.exportBandList('L3')
  File "C:\Anaconda2\lib\site-packages\sen2three-1.0.0-py2.7.egg\sen2three\L3_Tables.py", line 832, in exportBandList
    band = ndimage.filters.median_filter(band, (mf,mf))
  File "C:\Anaconda2\lib\site-packages\scipy\ndimage\filters.py", line 1127, in median_filter
    origin, 'median')
  File "C:\Anaconda2\lib\site-packages\scipy\ndimage\filters.py", line 1041, in _rank_filter
    sizes = _ni_support._normalize_sequence(size, input.ndim)
  File "C:\Anaconda2\lib\site-packages\scipy\ndimage\_ni_support.py", line 64, in _normalize_sequence
    raise RuntimeError(err)
RuntimeError: sequence argument must have length equal to input rank

Hi Andreas,

I can see where the problem is located: apparently you have a series of four products. From these four products only two have the the same TILE ID, two others are obviously only apparent as single tiles. Now, for the mosaic map it is currently necessary to have at least 2 tiles present, otherwise it will not be build and this leads to the error you observe. In my test products I always had at least two tiles of the same instance and thus the error did not occurr. I need to change the algorithm so that always a mosaic map will already be build, after the first tile is read in. A workaround for you is to remove those tiles, where only one instance is present, until I 've done the fix.
Cheers, Uwe

Hi Andreas,

I have the same problem (related to the abgbaumann post), could you tell us if you plan to deliver a patch or a new release.

Thanks a lot
Regards
Christophe

Hi umwilm

Do you know when to plan for this patch ?

Regards
Christophe

1 Like

It is in the pipeline but I cannot give you a release date right now.

Thank you for your feedback.

Iā€™m very interesting by the fix because I would like to process a lot of data.

Regards
Christophe

I will give priority on this, but I need to synchronize the release dates with ESA, I cannot simply work on call via the forum. Thanks for your understanding.