Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions imgcorrect/corrections.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,12 @@ def compute_reflectance_correction(
)

if ils_present:
if image_df.empty:
raise FileNotFoundError(
"ILS correction requires non-calibration images to compute the average "
"scene ILS, but none were found in the input path. Either include flight "
"images alongside the calibration panel images, or disable ILS Correction."
)
band_avg_ils = image_df.groupby("band").ILS.mean().reset_index()
band_df["ils_scaling_factor"] = band_df.merge(band_avg_ils, on="band").apply(
_get_ils_scaling, axis=1
Expand Down