Skip to content

ValueError: 'dem_to_be_aligned' had only NaNs when running fetch_and_coregister.py #1

@Jack-Hayes

Description

@Jack-Hayes

Running scripts/fetch_and_coregister.py can raise ValueError: 'dem_to_be_aligned' had only NaNs. This occurs when the fetch step produces one or more DEM COGs with no valid pixels (all masked/NaN) so the coregistration wrapper fails--you can't coregister a NaN-filled raster.

Reproduction

run from repo root, can edit local paths to your desire

python scripts/fetch_and_coregister.py \
  --bounds 161.18581265 56.60286466 161.19244308 56.60878054 \
  --fetch_output_dir /tmp/fetch_arcticdem/fetch \
  --coreg_output_dir /tmp/fetch_arcticdem/coregistered \
  --date_range 2015-10-01 2025-10-17

ValueError: 'dem_to_be_aligned' had only NaNs

The fetch step returned a DEM that are fully masked (all NaN). Need to double-check the valid-pixel masking and filtering logic. A quick fix is to just run the fetch tool and then move/delete the invalid DEM before you separately run the coregister tool

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions