Sen2Cor 02.08.00 does not processing 10m bands

Hello,

The last couple of days I am trying to use Sen2Cor 02.08.00 to atmospherically correct Sentinel 2A-B data of 2019 (Around April to September) on Ubuntu 18.04. I am working with the standalone version of Sen2Cor. I get a python error AttributeError: ‘NoneType’ object has no attribute ‘box_id’
PVI image export failed but I couldn’t locate why the error appears.

Bellow I posted the whole output of the algorithm.

  1. Sentinel-2 Level 2A Processor (Sen2Cor). Version: 2.8.0, created: 2019.02.20, supporting Level-1C product version 14.2 - 14.5 started …
  2. Product version: 14.5
  3. Operation mode: TOOLBOX
  4. Processing baseline: 99.99
  5. Progress[%]: 0.00 : Generating datastrip metadata
  6. L1C datastrip found, L2A datastrip successfully generated
  7. No resolution specified, will process 20 and 10 m resolution
  8. 20 m resolution will be downsampled to 60 m
  9. Progress[%]: 0.08 : PID-15083, L2A_ProcessTile: processing with resolution 20 m, elapsed time[s]: 1.968, total: 0:00:09.861098
  10. Progress[%]: 0.08 : PID-15083, L2A_ProcessTile: start of pre processing, elapsed time[s]: 0.000, total: 0:00:09.861569
  11. Progress[%]: 0.08 : PID-15083, L2A_Tables: start import, elapsed time[s]: 0.068, total: 0:00:09.929293
  12. Progress[%]: 0.11 : PID-15083, L2A_Tables: band B01 imported, elapsed time[s]: 0.831, total: 0:00:10.760090
  13. Progress[%]: 0.56 : PID-15083, L2A_Tables: band B02 imported, elapsed time[s]: 11.405, total: 0:00:22.164700
  14. Progress[%]: 1.04 : PID-15083, L2A_Tables: band B03 imported, elapsed time[s]: 12.315, total: 0:00:34.479215
  15. Progress[%]: 1.70 : PID-15083, L2A_Tables: band B04 imported, elapsed time[s]: 16.756, total: 0:00:51.235464
  16. Progress[%]: 1.88 : PID-15083, L2A_Tables: band B05 imported, elapsed time[s]: 4.679, total: 0:00:55.914861
  17. Progress[%]: 2.08 : PID-15083, L2A_Tables: band B06 imported, elapsed time[s]: 4.987, total: 0:01:00.901776
  18. Progress[%]: 2.27 : PID-15083, L2A_Tables: band B07 imported, elapsed time[s]: 4.858, total: 0:01:05.759414
  19. Progress[%]: 2.48 : PID-15083, L2A_Tables: band B8A imported, elapsed time[s]: 5.416, total: 0:01:11.175229
  20. Progress[%]: 2.54 : PID-15083, L2A_Tables: band B09 imported, elapsed time[s]: 1.536, total: 0:01:12.711526
  21. Progress[%]: 2.56 : PID-15083, L2A_Tables: band B10 imported, elapsed time[s]: 0.485, total: 0:01:13.196804
  22. Progress[%]: 2.76 : PID-15083, L2A_Tables: band B11 imported, elapsed time[s]: 5.163, total: 0:01:18.359875
  23. Progress[%]: 3.09 : PID-15083, L2A_Tables: band B12 imported, elapsed time[s]: 8.348, total: 0:01:26.707977
  24. Progress[%]: 3.09 : PID-15083, L2A_ProcessTile: start of Scene Classification, elapsed time[s]: 0.006, total: 0:01:26.713596
  25. Progress[%]: 3.10 : PID-15083, L2A_Tables: band B02 must be resampled, elapsed time[s]: 0.257, total: 0:01:26.970478
  26. Progress[%]: 3.49 : PID-15083, Pre process , elapsed time[s]: 9.819, total: 0:01:36.789647
  27. Progress[%]: 3.49 : PID-15083, L2A_Tables: band B01 must be resampled, elapsed time[s]: 0.109, total: 0:01:36.898544
  28. Progress[%]: 3.71 : PID-15083, L2A_Tables: band B03 must be resampled, elapsed time[s]: 5.584, total: 0:01:42.483021
  29. Progress[%]: 3.87 : PID-15083, L2A_Tables: band B04 must be resampled, elapsed time[s]: 4.139, total: 0:01:46.621562
  30. Progress[%]: 4.03 : PID-15083, L2A_Tables: band B09 must be resampled, elapsed time[s]: 4.104, total: 0:01:50.725634
  31. Progress[%]: 4.14 : PID-15083, L2A_Tables: band B10 must be resampled, elapsed time[s]: 2.659, total: 0:01:53.384891
  32. Progress[%]: 4.26 : PID-15083, L2A_SC init , elapsed time[s]: 3.037, total: 0:01:56.421837
  33. Progress[%]: 4.37 : PID-15083, L2A_CSND_1_1 , elapsed time[s]: 2.924, total: 0:01:59.345994
  34. Progress[%]: 4.85 : PID-15083, L2A_CSND_1_2 , elapsed time[s]: 12.194, total: 0:02:11.540321
  35. Progress[%]: 4.87 : PID-15083, L2A_CSND_2_0 , elapsed time[s]: 0.659, total: 0:02:12.198941
  36. Progress[%]: 4.93 : PID-15083, L2A_CSND_2_1 , elapsed time[s]: 1.513, total: 0:02:13.712303
  37. Progress[%]: 4.96 : PID-15083, L2A_CSND_2_1_2, elapsed time[s]: 0.762, total: 0:02:14.474108
  38. Progress[%]: 4.99 : PID-15083, L2A_CSND_2_2 , elapsed time[s]: 0.584, total: 0:02:15.057730
  39. Progress[%]: 5.02 : PID-15083, L2A_CSND_2_3 , elapsed time[s]: 0.819, total: 0:02:15.877017
  40. Progress[%]: 5.08 : PID-15083, L2A_CSND_2_4 , elapsed time[s]: 1.503, total: 0:02:17.379761
  41. Progress[%]: 5.18 : PID-15083, L2A_CSND_2_5 , elapsed time[s]: 2.690, total: 0:02:20.070029
  42. Progress[%]: 5.18 : PID-15083, L2A_SnowPostProcessingCCI , elapsed time[s]: 0.002, total: 0:02:20.072035
  43. Progress[%]: 5.29 : PID-15083, L2A_CSND_3 , elapsed time[s]: 2.705, total: 0:02:22.777397
  44. Progress[%]: 5.37 : PID-15083, L2A_CSND_5_1 , elapsed time[s]: 2.119, total: 0:02:24.896869
  45. Progress[%]: 5.50 : PID-15083, L2A_CSND_5_2 , elapsed time[s]: 3.176, total: 0:02:28.073189
  46. Progress[%]: 5.59 : PID-15083, L2A_CSND_6 , elapsed time[s]: 2.368, total: 0:02:30.441582
  47. Progress[%]: 5.65 : PID-15083, L2A_CSND_6_2 , elapsed time[s]: 1.649, total: 0:02:32.090771
  48. Progress[%]: 5.71 : PID-15083, L2A_CSND_7 , elapsed time[s]: 1.498, total: 0:02:33.589076
  49. Progress[%]: 7.87 : PID-15083, L2A_SHD , elapsed time[s]: 54.886, total: 0:03:28.474593
  50. Progress[%]: 7.95 : PID-15083, DV recovery , elapsed time[s]: 2.078, total: 0:03:30.552502
  51. Progress[%]: 8.02 : PID-15083, WP recovery , elapsed time[s]: 1.828, total: 0:03:32.380040
  52. Progress[%]: 8.02 : PID-15083, WP recovery with CCI Water Bodies at 150m , elapsed time[s]: 0.002, total: 0:03:32.381777
  53. Progress[%]: 8.13 : PID-15083, Snow recovery , elapsed time[s]: 2.863, total: 0:03:35.244734
  54. Progress[%]: 8.17 : PID-15083, Soil recovery , elapsed time[s]: 0.949, total: 0:03:36.193394
  55. Progress[%]: 8.17 : PID-15083, Land recovery with B10, B09 and B8A , elapsed time[s]: 0.002, total: 0:03:36.195195
  56. Progress[%]: 8.17 : PID-15083, Cirrus recovery with B10 , elapsed time[s]: 0.001, total: 0:03:36.196600
  57. Progress[%]: 8.17 : PID-15083, Urban and Bare pixel recovery with CCI Land Cover Map at 300 m , elapsed time[s]: 0.001, total: 0:03:36.197930
  58. Progress[%]: 8.17 : PID-15083, Post process , elapsed time[s]: 0.000, total: 0:03:36.198265
  59. Progress[%]: 8.34 : PID-15083, L2A_ProcessTile: start of Atmospheric Correction, elapsed time[s]: 4.411, total: 0:03:40.609509
  60. Progress[%]: 8.42 : PID-15083, L2A_AtmCorr: end of calculation terrain maps, elapsed time[s]: 2.031, total: 0:03:42.640763
  61. Progress[%]: 8.42 : PID-15083, L2A_AtmCorr: start of AOT retrieval at 550nm, elapsed time[s]: 0.002, total: 0:03:42.642293
  62. Progress[%]: 8.73 : PID-15083, L2A_AtmCorr: end of internal classification, elapsed time[s]: 7.943, total: 0:03:50.585211
  63. Progress[%]: 8.77 : PID-15083, L2A_AtmCorr: end of interpolation LUTs, elapsed time[s]: 0.904, total: 0:03:51.489703
  64. Progress[%]: 9.66 : PID-15083, L2A_AtmCorr: end retrieving reference pixels for dark areas, elapsed time[s]: 22.664, total: 0:04:14.154147
  65. Progress[%]: 13.27 : PID-15083, L2A_AtmCorr: end of check for negative reflectance pixels, elapsed time[s]: 92.030, total: 0:05:46.183933
  66. Progress[%]: 13.45 : PID-15083, L2A_AtmCorr: the rescaling of path radiance in blue band has been disabled by configuration, elapsed time[s]: 4.657, total: 0:05:50.840731
  67. Progress[%]: 15.34 : PID-15083, L2A_AtmCorr: end of visibility index calculation, elapsed time[s]: 48.130, total: 0:06:38.971060
  68. Progress[%]: 15.34 : PID-15083, L2A_AtmCorr: end of AOT retrieval at 550nm, elapsed time[s]: 0.001, total: 0:06:38.971940
  69. Progress[%]: 15.34 : PID-15083, L2A_AtmCorr: start of water vapour retrieval, elapsed time[s]: 0.001, total: 0:06:38.972497
  70. Progress[%]: 15.42 : PID-15083, L2A_AtmCorr: end of water vapour retrieval preparation, elapsed time[s]: 2.057, total: 0:06:41.029340
  71. Progress[%]: 24.08 : PID-15083, L2A_AtmCorr: end of water vapour retrieval, elapsed time[s]: 220.944, total: 0:10:21.973717
  72. Progress[%]: 24.08 : PID-15083, L2A_AtmCorr: preparation of surface reflectance retrieval, elapsed time[s]: 0.001, total: 0:10:21.974221
  73. Progress[%]: 24.37 : PID-15083, L2A_AtmCorr: end of surface reflectance retrieval preparation, elapsed time[s]: 7.477, total: 0:10:29.450936
  74. Progress[%]: 24.37 : PID-15083, L2A_AtmCorr: start of surface reflectance retrieval, elapsed time[s]: 0.001, total: 0:10:29.451452
  75. Progress[%]: 30.34 : PID-15083, L2A_AtmCorr: end of surface reflectance retrieval, elapsed time[s]: 152.082, total: 0:13:01.533195
  76. Progress[%]: 30.39 : PID-15083, L2A_AtmCorr: start of rho retrieval step 2, elapsed time[s]: 1.424, total: 0:13:02.956908
  77. Progress[%]: 33.59 : PID-15083, L2A_AtmCorr: end of rho retrieval step 2, elapsed time[s]: 81.447, total: 0:14:24.404298
  78. Progress[%]: 33.59 : PID-15083, L2A_ProcessTile: start of post processing, elapsed time[s]: 0.123, total: 0:14:24.527634
  79. Progress[%]: 33.59 : PID-15083, L2A_Tables: start export for 20 m resolution, elapsed time[s]: 0.001, total: 0:14:24.528255
  80. Progress[%]: 34.00 : PID-15083, L2A_Tables: band B02 exported, elapsed time[s]: 10.294, total: 0:14:34.822449
  81. Progress[%]: 34.38 : PID-15083, L2A_Tables: band B03 exported, elapsed time[s]: 9.739, total: 0:14:44.561756
  82. Progress[%]: 34.76 : PID-15083, L2A_Tables: band B04 exported, elapsed time[s]: 9.737, total: 0:14:54.299027
  83. Progress[%]: 35.13 : PID-15083, L2A_Tables: band B05 exported, elapsed time[s]: 9.451, total: 0:15:03.749836
  84. Progress[%]: 35.50 : PID-15083, L2A_Tables: band B06 exported, elapsed time[s]: 9.481, total: 0:15:13.230688
  85. Progress[%]: 35.88 : PID-15083, L2A_Tables: band B07 exported, elapsed time[s]: 9.705, total: 0:15:22.935237
  86. Progress[%]: 36.27 : PID-15083, L2A_Tables: band B8A exported, elapsed time[s]: 9.719, total: 0:15:32.654182
  87. Progress[%]: 36.63 : PID-15083, L2A_Tables: band B11 exported, elapsed time[s]: 9.311, total: 0:15:41.965475
  88. Progress[%]: 37.00 : PID-15083, L2A_Tables: band B12 exported, elapsed time[s]: 9.331, total: 0:15:51.296922
  89. Progress[%]: 37.05 : PID-15083, L2A_Tables: band SCL exported, elapsed time[s]: 1.498, total: 0:15:52.794526
  90. Progress[%]: 37.10 : PID-15083, L2A_Tables: band SNW exported, elapsed time[s]: 1.173, total: 0:15:53.967250
  91. Progress[%]: 37.19 : PID-15083, L2A_Tables: band CLD exported, elapsed time[s]: 2.270, total: 0:15:56.236903
  92. Progress[%]: 37.25 : PID-15083, L2A_Tables: band AOT exported, elapsed time[s]: 1.549, total: 0:15:57.785675
  93. Progress[%]: 37.55 : PID-15083, L2A_Tables: band WVP exported, elapsed time[s]: 7.684, total: 0:16:05.469506
  94. Progress[%]: 37.59 : PID-15083, L2A_Tables: band VIS exported, elapsed time[s]: 1.037, total: 0:16:06.506956
  95. ‘NoneType’ object has no attribute ‘box_id’
  96. Traceback (most recent call last):
  97. File “/home/case/Sen2Cor-02.08.00-Linux64/lib/python2.7/site-packages/sen2cor/L2A_Tables.py”, line 2701, in createRgbImages
  98. self.glymurWrapper(pvi, dstack((r, g, b)))
    
  99. File “/home/case/Sen2Cor-02.08.00-Linux64/lib/python2.7/site-packages/sen2cor/L2A_Tables.py”, line 2616, in glymurWrapper
  100. jp2_L2A.wrap(file_L2A_geo, boxes=boxes_L2A)
    
  101. File “/home/case/Sen2Cor-02.08.00-Linux64/lib/python2.7/site-packages/glymur/jp2k.py”, line 866, in wrap
  102. self._validate_jp2_box_sequence(boxes)
    
  103. File “/home/case/Sen2Cor-02.08.00-Linux64/lib/python2.7/site-packages/glymur/jp2k.py”, line 1680, in _validate_jp2_box_sequence
  104. self._validate_jp2h(boxes)
    
  105. File “/home/case/Sen2Cor-02.08.00-Linux64/lib/python2.7/site-packages/glymur/jp2k.py”, line 1748, in _validate_jp2h
  106. self._check_jp2h_child_boxes(boxes, 'top-level')
    
  107. File “/home/case/Sen2Cor-02.08.00-Linux64/lib/python2.7/site-packages/glymur/jp2k.py”, line 1800, in _check_jp2h_child_boxes
  108. box_ids = set([box.box_id for box in boxes])
    
  109. AttributeError: ‘NoneType’ object has no attribute ‘box_id’
  110. PVI image export failed
  111. Progress[%]: 37.61 : PID-15083, L2A_Tables: PVI image export failed, elapsed time[s]: 0.441, total: 0:16:06.947659
  112. Progress[%]: 37.61 : PID-15083, L2A_Tables: stop export, elapsed time[s]: 0.000, total: 0:16:06.948095
  113. Progress[%]: 37.61 : PID-15083, L2A_Tables: preparing downsampled export for 60 m resolution, elapsed time[s]: 0.025, total: 0:16:06.972856
  114. Progress[%]: 37.61 : PID-15083, L2A_Tables: start export for 60 m resolution, elapsed time[s]: 0.032, total: 0:16:07.004661
  115. Progress[%]: 37.68 : PID-15083, L2A_Tables: band B01 exported, elapsed time[s]: 1.753, total: 0:16:08.757487
  116. Progress[%]: 37.75 : PID-15083, L2A_Tables: band B02 exported, elapsed time[s]: 1.886, total: 0:16:10.643766
  117. Progress[%]: 37.83 : PID-15083, L2A_Tables: band B03 exported, elapsed time[s]: 1.946, total: 0:16:12.589516
  118. Progress[%]: 37.91 : PID-15083, L2A_Tables: band B04 exported, elapsed time[s]: 2.033, total: 0:16:14.622558
  119. Progress[%]: 37.99 : PID-15083, L2A_Tables: band B05 exported, elapsed time[s]: 2.026, total: 0:16:16.648894
  120. Progress[%]: 38.07 : PID-15083, L2A_Tables: band B06 exported, elapsed time[s]: 2.058, total: 0:16:18.706988
  121. Progress[%]: 38.15 : PID-15083, L2A_Tables: band B07 exported, elapsed time[s]: 1.943, total: 0:16:20.650001
  122. Progress[%]: 38.23 : PID-15083, L2A_Tables: band B8A exported, elapsed time[s]: 2.029, total: 0:16:22.678607
  123. Progress[%]: 38.31 : PID-15083, L2A_Tables: band B09 exported, elapsed time[s]: 2.016, total: 0:16:24.694550
  124. Progress[%]: 38.38 : PID-15083, L2A_Tables: band B11 exported, elapsed time[s]: 1.952, total: 0:16:26.646806
  125. Progress[%]: 38.46 : PID-15083, L2A_Tables: band B12 exported, elapsed time[s]: 1.978, total: 0:16:28.625270
  126. Progress[%]: 38.46 : PID-15083, L2A_Tables: band DEM must be resampled, elapsed time[s]: 0.002, total: 0:16:28.627241
  127. Progress[%]: 38.58 : PID-15083, L2A_Tables: band SCL exported, elapsed time[s]: 3.049, total: 0:16:31.676017
  128. Progress[%]: 38.61 : PID-15083, L2A_Tables: band SNW exported, elapsed time[s]: 0.652, total: 0:16:32.328351
  129. Progress[%]: 38.63 : PID-15083, L2A_Tables: band CLD exported, elapsed time[s]: 0.716, total: 0:16:33.044404
  130. Progress[%]: 38.66 : PID-15083, L2A_Tables: band AOT exported, elapsed time[s]: 0.702, total: 0:16:33.746384
  131. Progress[%]: 38.73 : PID-15083, L2A_Tables: band WVP exported, elapsed time[s]: 1.656, total: 0:16:35.401906
  132. Progress[%]: 38.73 : PID-15083, L2A_Tables: band DDV must be resampled, elapsed time[s]: 0.002, total: 0:16:35.403644
  133. Progress[%]: 38.73 : PID-15083, L2A_Tables: band TCI must be resampled, elapsed time[s]: 0.005, total: 0:16:35.408448
  134. Progress[%]: 38.83 : PID-15083, L2A_Tables: band TCI exported, elapsed time[s]: 2.632, total: 0:16:38.039988
  135. Module L2A_T34SFJ_A012989_20190901T092744 failed
  136. Progress[%]: 100.00 : Application terminated with at least one error.

I get the same error when I am trying the default all or 10 meters resolution.

Thank you for any help you can offer,

Alexandros

How did you call the sen2cor form the terminal?

Hello,

I am calling the Sen2Cor using python and os library (Check my code https://github.com/alekfal/Auto-Sen2Cor) so basically yes.

Thank you

I didn’t call it before from python, I’m sorry I didn’t try up your code before, I think you could call it directly from terminal, in the following way,

Navigate to the directory, where the granular is existed and then, implement L2A_ Process as below

L2A_Process ./S2A_MSIL1C_XXXXXXXXXXXXXXXXXXXXXX.SAFE -–resolution=10

Also you could remove the resolution in case you’d not want to specify any and apply to all.

I have a similar problem with 20 and 60 m output being generated but no 10 m output.
I use

/projects/eko/fs3/nateko/bin/Sen2Cor-02.08.00-Linux64/bin/L2A_Process --output_dir /projects/eko/fs3/S2L2/ --GIP_L2A /projects/eko/fs3/S2L2/T34WDS/L2A_GIPP.xml /projects/eko/fs1/S2/L1/T34WDS/S2A_MSIL1C_20190206T102211_N0207_R065_T34WDS_20190206T104259.SAFE

and get

Progress []: 33.27 : PID-6943, L2A_Tables: band VIS exported, elapsed time[s]: 0.781, total: 0:13:37.204163
‘NoneType’ object has no attribute ‘box_id’
Traceback (most recent call last):
File “/projects/eko/fs3/nateko/bin/Sen2Cor-02.08.00-Linux64/lib/python2.7/site-packages/sen2cor/L2A_Tables.py”, line 2701, in createRgbImages
self.glymurWrapper(pvi, dstack((r, g, b)))
File “/projects/eko/fs3/nateko/bin/Sen2Cor-02.08.00-Linux64/lib/python2.7/site-packages/sen2cor/L2A_Tables.py”, line 2616, in glymurWrapper
jp2_L2A.wrap(file_L2A_geo, boxes=boxes_L2A)
File “/projects/eko/fs3/nateko/bin/Sen2Cor-02.08.00-Linux64/lib/python2.7/site-packages/glymur/jp2k.py”, line 866, in wrap
self._validate_jp2_box_sequence(boxes)
File “/projects/eko/fs3/nateko/bin/Sen2Cor-02.08.00-Linux64/lib/python2.7/site-packages/glymur/jp2k.py”, line 1680, in _validate_jp2_box_sequence
self._validate_jp2h(boxes)
File “/projects/eko/fs3/nateko/bin/Sen2Cor-02.08.00-Linux64/lib/python2.7/site-packages/glymur/jp2k.py”, line 1748, in _validate_jp2h
self._check_jp2h_child_boxes(boxes, ‘top-level’)
File “/projects/eko/fs3/nateko/bin/Sen2Cor-02.08.00-Linux64/lib/python2.7/site-packages/glymur/jp2k.py”, line 1800, in _check_jp2h_child_boxes
box_ids = set([box.box_id for box in boxes])
AttributeError: ‘NoneType’ object has no attribute ‘box_id’
PVI image export failed
Progress[%]: 33.28 : PID-6943, L2A_Tables: PVI image export failed, elapsed time[s]: 0.345, total: 0:13:37.548968

I run a script (identical call) processing 250 tiles and about 40 percent is OK (10,20 and 60m) whereas 60 percent only produce 20 & 60m output.
Any suggestions?
Regards
/Jonas