Skip to content

Commit

Permalink
24 hour precip diff issue (#3989)
Browse files Browse the repository at this point in the history
  • Loading branch information
dgboss authored Oct 8, 2024
1 parent 8aefeda commit 36387b7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions api/app/weather_models/precip_rdps_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,15 @@ 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)
(yesterday_data, _, _) = await read_into_memory(yesterday_key)
if yesterday_data is None:
raise ValueError("No precip raster data for %s" % yesterday_key)
raise ValueError("No precip raster data for yesterday_key: %s" % yesterday_key)

later_precip = TemporalPrecip(timestamp=timestamp, precip_amount=day_data)
earlier_precip = TemporalPrecip(timestamp=yesterday_time, precip_amount=yesterday_data)
Expand Down

0 comments on commit 36387b7

Please sign in to comment.