Skip to content

Commit 0110061

Browse files
committed
Merge branch 'main' into notebook_test
2 parents a5839ca + f359fc3 commit 0110061

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

src/post_processing/utils/core_utils.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,16 @@ def get_sun_times(
129129

130130
h_sunrise, h_sunset = [], []
131131

132-
for date in [ts.date() for ts in date_range(start.normalize(),
133-
stop.normalize(),
134-
freq="D",
135-
)]:
136-
dt_sunrise = sunrise(gps.observer, date=date, tzinfo=tz)
137-
dt_sunset = sunset(gps.observer, date=date, tzinfo=tz)
132+
for date in [
133+
ts.date()
134+
for ts in date_range(
135+
start.normalize(),
136+
stop.normalize(),
137+
freq="D",
138+
)
139+
]:
140+
dt_sunrise = Timestamp(sunrise(gps.observer, date=date)).tz_convert(tz)
141+
dt_sunset = Timestamp(sunset(gps.observer, date=date)).tz_convert(tz)
138142

139143
# Convert sunrise and sunset to decimal hours
140144
h_sunrise.append(dt_sunrise.hour + dt_sunrise.minute / 60 + dt_sunrise.second / 3600 + dt_sunrise.microsecond / 3_600_000_000)

0 commit comments

Comments
 (0)