Skip to content

Commit

Permalink
Convert indexed times to UTC before performing solar day calculations…
Browse files Browse the repository at this point in the history
… in update_ranges.
  • Loading branch information
SpacemanPaul authored and omad committed Nov 30, 2023
1 parent 3361f56 commit 20717bb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion datacube_ows/product_ranges.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#pylint: skip-file

import math
from datetime import datetime
from datetime import datetime, timezone

import datacube
from psycopg2.extras import Json
Expand Down Expand Up @@ -199,6 +199,7 @@ def create_range_entry(dc, product, crses, time_resolution):
for result in results:
dt1, dt2, lon = result
dt = dt1 + (dt2 - dt1) / 2
dt = dt.astimezone(timezone.utc)

solar_day = datacube.api.query._convert_to_solar_time(dt, lon).date()
dates.add(solar_day)
Expand Down

0 comments on commit 20717bb

Please sign in to comment.