Skip to content

Raise clear error when no flight images present for ILS correction - #78

Open
BeesualDrone wants to merge 1 commit into
SenteraLLC:mainfrom
BeesualDrone:patch-1
Open

Raise clear error when no flight images present for ILS correction#78
BeesualDrone wants to merge 1 commit into
SenteraLLC:mainfrom
BeesualDrone:patch-1

Conversation

@BeesualDrone

Copy link
Copy Markdown

Add error handling for empty image DataFrame in ILS correction.

What?

Raises an explicit FileNotFoundError when image_df is empty after the calibration/non-calibration split in io.create_cal_df, before reaching the ILS merge step.

Why?

If ils_present=True and the Input Path contains only calibration panel images (no flight images), image_df ends up empty after the split. The subsequent merge with band_avg_ils produces 0 rows, and DataFrame.apply(axis=1) on that empty, multi-column frame returns the original DataFrame instead of an empty Series — causing band_df["ils_scaling_factor"] = ... to fail with a confusing internal pandas error instead of a clear, actionable message.

Full reproduction and root-cause writeup: Closes #77

PR Checklist

  • Merged latest master
  • Updated version number
  • All private git packages are at their newest version in both pyproject.toml and environment.yml
  • All git package version numbers match between pyproject.toml and environment.yml
  • dist/ImageryCorrector.exe and dist/GetCorrectionsCsv.exe have been rebuilt

Breaking Changes

None. This only adds a new, earlier validation error for an input configuration that previously failed anyway, just with a less clear message.

Add error handling for empty image DataFrame in ILS correction.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ILS correction crashes with cryptic pandas error when Input Path contains only calibration images (no flight images)

1 participant