Skip to content

ValueError: max() arg is an empty sequence #161

@geniusinaction

Description

@geniusinaction

This is a new error in burst2stack for me. A vertex search shows all of the burst files should be available for the target date (2017-07-12). I am searching for all the bursts inside a simple rectangular box. It seems to crash when assembling the SAFE directory.

regular.json

$ burst2stack --rel-orbit 81 --start-date 2021-07-11 --end-date 2021-07-13 --extent regular.json --pols VV --all-anns
Found 45 burst(s), comprising 1 SAFE(s).
Check burst group validities...
Downloading data...
Download complete.
Creating SAFEs...
Traceback (most recent call last):
  File "/home/gareth/miniforge3/envs/GEO244/bin/burst2stack", line 10, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/gareth/miniforge3/envs/GEO244/lib/python3.11/site-packages/burst2safe/burst2stack.py", line 118, in main
    burst2stack(
  File "/home/gareth/miniforge3/envs/GEO244/lib/python3.11/site-packages/burst2safe/burst2stack.py", line 83, in burst2stack
    safe_path = safe.create_safe()
                ^^^^^^^^^^^^^^^^^^
  File "/home/gareth/miniforge3/envs/GEO244/lib/python3.11/site-packages/burst2safe/safe.py", line 441, in create_safe
    self.create_safe_components()
  File "/home/gareth/miniforge3/envs/GEO244/lib/python3.11/site-packages/burst2safe/safe.py", line 304, in create_safe_components
    swath.assemble()
  File "/home/gareth/miniforge3/envs/GEO244/lib/python3.11/site-packages/burst2safe/swath.py", line 143, in assemble
    component.assemble()
  File "/home/gareth/miniforge3/envs/GEO244/lib/python3.11/site-packages/burst2safe/product.py", line 292, in assemble
    self.create_general_annotation()
  File "/home/gareth/miniforge3/envs/GEO244/lib/python3.11/site-packages/burst2safe/product.py", line 109, in create_general_annotation
    filtered = lol.create_filtered_list((self.min_anx, self.max_anx), buffer=timedelta(seconds=500))
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/gareth/miniforge3/envs/GEO244/lib/python3.11/site-packages/burst2safe/base.py", line 164, in create_filtered_list
    elements = self.get_unique_elements()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/gareth/miniforge3/envs/GEO244/lib/python3.11/site-packages/burst2safe/base.py", line 93, in get_unique_elements
    last_time = max([times[index] for index in keep_index])
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: max() arg is an empty sequence

I also get the same error in burst2safe:

$ burst2safe --orbit 27757 --extent regular.json --pols VV --all-anns
Using burst group search...
Found 45 burst(s).
Check burst group validity...
Downloading data...
Download complete.
Creating SAFE...
Traceback (most recent call last):
  File "/home/gareth/miniforge3/envs/GEO244/bin/burst2safe", line 10, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/gareth/miniforge3/envs/GEO244/lib/python3.11/site-packages/burst2safe/burst2safe.py", line 108, in main
    burst2safe(
  File "/home/gareth/miniforge3/envs/GEO244/lib/python3.11/site-packages/burst2safe/burst2safe.py", line 72, in burst2safe
    safe_path = safe.create_safe()
                ^^^^^^^^^^^^^^^^^^
  File "/home/gareth/miniforge3/envs/GEO244/lib/python3.11/site-packages/burst2safe/safe.py", line 441, in create_safe
    self.create_safe_components()
  File "/home/gareth/miniforge3/envs/GEO244/lib/python3.11/site-packages/burst2safe/safe.py", line 304, in create_safe_components
    swath.assemble()
  File "/home/gareth/miniforge3/envs/GEO244/lib/python3.11/site-packages/burst2safe/swath.py", line 143, in assemble
    component.assemble()
  File "/home/gareth/miniforge3/envs/GEO244/lib/python3.11/site-packages/burst2safe/product.py", line 292, in assemble
    self.create_general_annotation()
  File "/home/gareth/miniforge3/envs/GEO244/lib/python3.11/site-packages/burst2safe/product.py", line 109, in create_general_annotation
    filtered = lol.create_filtered_list((self.min_anx, self.max_anx), buffer=timedelta(seconds=500))
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/gareth/miniforge3/envs/GEO244/lib/python3.11/site-packages/burst2safe/base.py", line 164, in create_filtered_list
    elements = self.get_unique_elements()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/gareth/miniforge3/envs/GEO244/lib/python3.11/site-packages/burst2safe/base.py", line 93, in get_unique_elements
    last_time = max([times[index] for index in keep_index])
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: max() arg is an empty sequence

It does seem to download everything (all 45 bursts as expected, all three XML files), but can't put it together at the end:

$ ls -ld *20210712*
-rw-rw-r-- 1 gareth gareth 139391886 Jun  2 03:20 S1_172615_IW1_20210712T061515_VV_3F8D-BURST.tiff
-rw-rw-r-- 1 gareth gareth 163242202 Jun  2 03:20 S1_172615_IW2_20210712T061516_VV_3F8D-BURST.tiff
-rw-rw-r-- 1 gareth gareth 157481962 Jun  2 03:20 S1_172615_IW3_20210712T061517_VV_3F8D-BURST.tiff
-rw-rw-r-- 1 gareth gareth 139391886 Jun  2 03:19 S1_172616_IW1_20210712T061518_VV_3F8D-BURST.tiff
-rw-rw-r-- 1 gareth gareth 163242202 Jun  2 03:20 S1_172616_IW2_20210712T061519_VV_3F8D-BURST.tiff
-rw-rw-r-- 1 gareth gareth 157481962 Jun  2 03:20 S1_172616_IW3_20210712T061519_VV_3F8D-BURST.tiff
-rw-rw-r-- 1 gareth gareth 139391886 Jun  2 03:19 S1_172617_IW1_20210712T061520_VV_3F8D-BURST.tiff
-rw-rw-r-- 1 gareth gareth 163242202 Jun  2 03:20 S1_172617_IW2_20210712T061521_VV_3F8D-BURST.tiff
-rw-rw-r-- 1 gareth gareth 157481962 Jun  2 03:19 S1_172617_IW3_20210712T061522_VV_3F8D-BURST.tiff
-rw-rw-r-- 1 gareth gareth 139391886 Jun  2 03:19 S1_172618_IW1_20210712T061523_VV_FA58-BURST.tiff
-rw-rw-r-- 1 gareth gareth 163248278 Jun  2 03:19 S1_172618_IW2_20210712T061524_VV_FA58-BURST.tiff
-rw-rw-r-- 1 gareth gareth 157481962 Jun  2 03:19 S1_172618_IW3_20210712T061525_VV_FA58-BURST.tiff
-rw-rw-r-- 1 gareth gareth 139391886 Jun  2 03:19 S1_172619_IW1_20210712T061526_VV_FA58-BURST.tiff
-rw-rw-r-- 1 gareth gareth 163248278 Jun  2 03:19 S1_172619_IW2_20210712T061527_VV_FA58-BURST.tiff
-rw-rw-r-- 1 gareth gareth 157481962 Jun  2 03:19 S1_172619_IW3_20210712T061528_VV_FA58-BURST.tiff
-rw-rw-r-- 1 gareth gareth 139391886 Jun  2 03:19 S1_172620_IW1_20210712T061529_VV_FA58-BURST.tiff
-rw-rw-r-- 1 gareth gareth 163248278 Jun  2 03:19 S1_172620_IW2_20210712T061530_VV_FA58-BURST.tiff
-rw-rw-r-- 1 gareth gareth 157481962 Jun  2 03:19 S1_172620_IW3_20210712T061531_VV_FA58-BURST.tiff
-rw-rw-r-- 1 gareth gareth 139391886 Jun  2 03:19 S1_172621_IW1_20210712T061531_VV_FA58-BURST.tiff
-rw-rw-r-- 1 gareth gareth 163248278 Jun  2 03:20 S1_172621_IW2_20210712T061532_VV_FA58-BURST.tiff
-rw-rw-r-- 1 gareth gareth 157481962 Jun  2 03:19 S1_172621_IW3_20210712T061533_VV_FA58-BURST.tiff
-rw-rw-r-- 1 gareth gareth 139391886 Jun  2 03:19 S1_172622_IW1_20210712T061534_VV_FA58-BURST.tiff
-rw-rw-r-- 1 gareth gareth 163248278 Jun  2 03:19 S1_172622_IW2_20210712T061535_VV_FA58-BURST.tiff
-rw-rw-r-- 1 gareth gareth 157481962 Jun  2 03:19 S1_172622_IW3_20210712T061536_VV_FA58-BURST.tiff
-rw-rw-r-- 1 gareth gareth 139391886 Jun  2 03:19 S1_172623_IW1_20210712T061537_VV_FA58-BURST.tiff
-rw-rw-r-- 1 gareth gareth 163248278 Jun  2 03:20 S1_172623_IW2_20210712T061538_VV_FA58-BURST.tiff
-rw-rw-r-- 1 gareth gareth 157481962 Jun  2 03:20 S1_172623_IW3_20210712T061539_VV_FA58-BURST.tiff
-rw-rw-r-- 1 gareth gareth 139391886 Jun  2 03:19 S1_172624_IW1_20210712T061540_VV_FA58-BURST.tiff
-rw-rw-r-- 1 gareth gareth 163248278 Jun  2 03:20 S1_172624_IW2_20210712T061541_VV_FA58-BURST.tiff
-rw-rw-r-- 1 gareth gareth 157481962 Jun  2 03:20 S1_172624_IW3_20210712T061542_VV_FA58-BURST.tiff
-rw-rw-r-- 1 gareth gareth 139391886 Jun  2 03:20 S1_172625_IW1_20210712T061542_VV_FA58-BURST.tiff
-rw-rw-r-- 1 gareth gareth 163248278 Jun  2 03:20 S1_172625_IW2_20210712T061543_VV_FA58-BURST.tiff
-rw-rw-r-- 1 gareth gareth 157481962 Jun  2 03:20 S1_172625_IW3_20210712T061544_VV_FA58-BURST.tiff
-rw-rw-r-- 1 gareth gareth 139391886 Jun  2 03:20 S1_172626_IW1_20210712T061545_VV_FA58-BURST.tiff
-rw-rw-r-- 1 gareth gareth 163248278 Jun  2 03:20 S1_172626_IW2_20210712T061546_VV_FA58-BURST.tiff
-rw-rw-r-- 1 gareth gareth 157481962 Jun  2 03:20 S1_172626_IW3_20210712T061547_VV_FA58-BURST.tiff
-rw-rw-r-- 1 gareth gareth 139392894 Jun  2 03:19 S1_172627_IW1_20210712T061548_VV_CC89-BURST.tiff
-rw-rw-r-- 1 gareth gareth 163248278 Jun  2 03:20 S1_172627_IW2_20210712T061549_VV_CC89-BURST.tiff
-rw-rw-r-- 1 gareth gareth 157481962 Jun  2 03:20 S1_172627_IW3_20210712T061550_VV_CC89-BURST.tiff
-rw-rw-r-- 1 gareth gareth 139392894 Jun  2 03:19 S1_172628_IW1_20210712T061551_VV_CC89-BURST.tiff
-rw-rw-r-- 1 gareth gareth 163248278 Jun  2 03:20 S1_172628_IW2_20210712T061552_VV_CC89-BURST.tiff
-rw-rw-r-- 1 gareth gareth 157481962 Jun  2 03:19 S1_172628_IW3_20210712T061553_VV_CC89-BURST.tiff
-rw-rw-r-- 1 gareth gareth 139392894 Jun  2 03:19 S1_172629_IW1_20210712T061553_VV_CC89-BURST.tiff
-rw-rw-r-- 1 gareth gareth 163248278 Jun  2 03:20 S1_172629_IW2_20210712T061554_VV_CC89-BURST.tiff
-rw-rw-r-- 1 gareth gareth 157481962 Jun  2 03:20 S1_172629_IW3_20210712T061555_VV_CC89-BURST.tiff
-rw-rw-r-- 1 gareth gareth   6520827 Jun  2 03:18 S1B_IW_SLC__1SDV_20210712T061458_20210712T061525_027757_03500A_3F8D_VV.xml
-rw-rw-r-- 1 gareth gareth   6517291 Jun  2 03:18 S1B_IW_SLC__1SDV_20210712T061523_20210712T061550_027757_03500A_FA58_VV.xml
-rw-rw-r-- 1 gareth gareth   6602564 Jun  2 03:18 S1B_IW_SLC__1SDV_20210712T061548_20210712T061616_027757_03500A_CC89_VV.xml
drwxrwxr-x 6 gareth gareth      4096 Jun  2 03:20 S1B_IW_SLC__1SSV_20210712T061515_20210712T061555_027757_03500A_0000.SAFE

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions