Skip to content

Commit

Permalink
Handle missing precip raster for today
Browse files Browse the repository at this point in the history
  • Loading branch information
dgboss committed Oct 7, 2024
1 parent 8aefeda commit 54de915
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/app/weather_models/precip_rdps_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ async def generate_24_hour_accumulating_precip_raster(timestamp: datetime):
"""
(yesterday_key, today_key) = get_raster_keys_to_diff(timestamp)
(day_data, day_geotransform, day_projection) = await read_into_memory(today_key)
if day_data is None:
raise ValueError("No precip raster data for today_key: %s" % today_key)
if yesterday_key is None:
if day_data is None:
raise ValueError("No precip raster data for %s" % today_key)
return (day_data, day_geotransform, day_projection)

yesterday_time = timestamp - timedelta(days=1)
Expand Down

0 comments on commit 54de915

Please sign in to comment.