Skip to content

Automatic burst search & download sometimes fails [due to ASF burst download] #149

@Shima-shoki

Description

@Shima-shoki

Hi, I'm using sweets & dolphin combination for a while, and it is extremely convenient!
However, I noticed that sometimes automatic burst search & download sometimes fails due to "ValueError: All bursts must have consecutive burst IDs.".

A very similar issue was reported in the ASFHyP3 (ASFHyP3/burst2safe#240), and it looks like there are still no solid ways to resolve the problem as far as I read the discussion.

Interestingly, it happens in case of specific setttings of the date.

For example;

bbox = [-91.70138553620093, -0.5323904569267195,  -91.35, -0.2581644880351383]
start = "2017-06-01"
end = "2018-06-01"

import subprocess
from pathlib import Path

repo_dir = Path("/content/sweets")

region='Fernandina'

work_dir = repo_dir / f"{region}_demo"
out_dir = repo_dir / f"{region}_data"
config_path = work_dir / "sweets_config.yaml"

work_dir.mkdir(exist_ok=True)
out_dir.mkdir(exist_ok=True)

cmd_config = [
    "pixi", "run", "sweets", "config",
    "--bbox", str(bbox[0]), str(bbox[1]), str(bbox[2]), str(bbox[3]),
    "--start", start,
    "--end", end,
    "--track", "128",
    "--swaths", "IW1","IW2",
    "--out-dir", str(out_dir),
    "--work-dir", str(work_dir),
    "--output", str(config_path),

    "--no-gpu-enabled",
    "--n-workers", "20",
    "--threads-per-worker", "10",

    "--dolphin.strides", "3", "6",
    "--dolphin.n-parallel-bursts", "6",
    "--dolphin.n-parallel-unwrap", "6",
]

subprocess.run(cmd_config, check=True, cwd=repo_dir)
!pixi run sweets run Fernandina_demo/sweets_config.yaml

It resulted in the following error messages

 WARN the lock file is up-to-date but uses an older format (v6), run `pixi lock` to upgrade to v7 for improved reproducibility
[05/23 12:49:59] [INFO dem.py] Bounds: -92.70138553620093 -1.5323904569267195 -90.35 0.7418355119648616
2026-05-23 12:49:59.888 | INFO     | sweets._water_mask:create_water_mask:149 - Building water mask from 1 tile(s): ['s05w095.tif']
2026-05-23 12:49:59.889 | INFO     | sweets._burst_db:get_burst_db:42 - Using cached burst DB at /root/.cache/sweets/burst_map_bbox_only.sqlite3
[05/23 12:49:59] [INFO cop_dem.py] Creating /content/sweets/Fernandina_demo/dem.tif
[05/23 12:49:59] [INFO cop_dem.py] Fetching remote tiles...
[05/23 12:49:59] [INFO cop_dem.py] Running GDAL command:
[05/23 12:49:59] [INFO cop_dem.py] gdalwarp /vsicurl/https://raw.githubusercontent.com/scottstanie/sardem/master/sardem/data/cop_global.vrt /content/sweets/Fernandina_demo/dem.tif -of GTiff -ot Float32 -te -92.7013855362009309 -1.53239045692671949 -90.3499999999999943 0.741835511964861638 -tr 0.000277777777777777778 0.000277777777777777778 -s_srs "epsg:4326+3855" -t_srs "epsg:4326" -wo NUM_THREADS=4 -r nearest -wm 5000 -multi
Creating output file that is 8465P x 8187L.
0...10...20...30...40...502026-05-23 12:50:06.417 | INFO     | sweets._water_mask:create_water_mask:220 - Created water mask: /content/sweets/Fernandina_demo/watermask.tif
2026-05-23 12:50:06.417 | INFO     | sweets._log:wrapper:39 - Total elapsed time for sweets.dem.create_water_mask : 0.11 minutes (6.53 seconds)
...60...70...80...90...100 - done.
2026-05-23 12:50:07.780 | INFO     | sweets._log:wrapper:39 - Total elapsed time for sweets.dem.create_dem : 0.13 minutes (7.89 seconds)
2026-05-23 12:50:07.956 | INFO     | sweets.download:download:249 - BurstSearch:
  AOI bounds : (-91.70138553620093, -0.5323904569267195, -91.35, -0.2581644880351383)
  Dates      : 2017-06-01 -> 2018-06-01
  Track      : 128
  Direction  : any
  Pols       : ['VV']
  Swaths     : ['IW1', 'IW2']
  Output     : /content/sweets/Fernandina_data
Found 178 burst(s), comprising 30 SAFE(s).
Check burst group validities...
Traceback (most recent call last):
  File "/content/sweets/src/sweets/download.py", line 61, in _call_off_running_loop
    asyncio.get_running_loop()
RuntimeError: no running event loop

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/content/sweets/.pixi/envs/default/bin/sweets", line 10, in <module>
    sys.exit(main())
             ^^^^^^
  File "/content/sweets/src/sweets/cli.py", line 399, in main
    cmd.execute()
  File "/content/sweets/src/sweets/cli.py", line 384, in execute
    workflow.run(starting_step=self.starting_step)
  File "/content/sweets/src/sweets/_log.py", line 36, in wrapper
    result = f(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^
  File "/content/sweets/src/sweets/core.py", line 733, in run
    self._download()
  File "/content/sweets/src/sweets/_log.py", line 36, in wrapper
    result = f(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^
  File "/content/sweets/src/sweets/core.py", line 563, in _download
    return self.search.download()
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/content/sweets/src/sweets/_log.py", line 36, in wrapper
    result = f(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^
  File "/content/sweets/src/sweets/download.py", line 251, in download
    result = _call_off_running_loop(
             ^^^^^^^^^^^^^^^^^^^^^^^
  File "/content/sweets/src/sweets/download.py", line 63, in _call_off_running_loop
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "/content/sweets/.pixi/envs/default/lib/python3.12/site-packages/burst2safe/burst2stack.py", line 70, in burst2stack
    Safe.check_group_validity(burst_set)
  File "/content/sweets/.pixi/envs/default/lib/python3.12/site-packages/burst2safe/safe.py", line 105, in check_group_validity
    Swath.check_burst_group_validity(burst_subset)
  File "/content/sweets/.pixi/envs/default/lib/python3.12/site-packages/burst2safe/swath.py", line 96, in check_burst_group_validity
    raise ValueError(f'All bursts must have consecutive burst IDs. Found: {burst_ids}.')
ValueError: All bursts must have consecutive burst IDs. Found: [273866, 273868].

However, the following date-range settings work

start = "2018-06-01"
end = "2019-06-01"

I believe that it is not due to the sweets issue, but it would be worth mention here :)

※Wouldn't it be possible to have an option to just skip the invalid burst scenes to proceed for the later steps? Currently all the processings just stop working at this stage, and it is hard to tell beforehand whether we may have the burst error or not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions