Skip to content

Commit

Permalink
add check
Browse files Browse the repository at this point in the history
  • Loading branch information
Hgherzog committed Dec 20, 2024
1 parent 1631a63 commit 289a67f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions rslp/forest_loss_driver/inference/extract_alerts.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,10 @@ def extract_alerts_pipeline(
extract_alerts_args.days,
extract_alerts_args.prediction_utc_time,
)
# check if mask is all 0s
if np.all(forest_loss_mask == 0):
logger.warning(f"No forest loss events found for {fname}")
continue
logger.info(f"Create shapes from mask for {fname}")
# Rasterio uses True for features and False for background
ignore_mask = forest_loss_mask == 1
Expand Down

0 comments on commit 289a67f

Please sign in to comment.