Skip to content

Commit

Permalink
Small updates to GV code
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiggi committed Jan 28, 2025
2 parents a2f6c88 + 48e9528 commit 53e9615
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions gpm/bucket/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def get_list_overpass_time(timesteps, interval=None):
# Check interval
if interval is None:
interval = np.array(60, dtype="m8[m]")

# Check timesteps
# - Ensure numpy.datetime64
timesteps = np.unique(timesteps)
Expand All @@ -48,16 +48,16 @@ def get_list_overpass_time(timesteps, interval=None):
# Deal with edge cases
if len(timesteps) == 0:
raise ValueError("No timesteps available.")

if len(timesteps) == 1:
return [(timesteps[0], timesteps[0])]

# Compute time difference
time_diff = np.diff(timesteps)

# Initialize
list_time_periods = []
current_start_time = timesteps[0]
current_start_time = timesteps[0]
for i, dt in enumerate(time_diff):
if i == 0:
continue
Expand All @@ -66,8 +66,8 @@ def get_list_overpass_time(timesteps, interval=None):
time_period = (current_start_time, end_time)
list_time_periods.append(time_period)
# Update
current_start_time = timesteps[i+1]
current_start_time = timesteps[i + 1]

# Add the final group

Check notice on line 71 in gpm/bucket/analysis.py

View check run for this annotation

codefactor.io / CodeFactor

gpm/bucket/analysis.py#L71

Unresolved comment '# TODO: drop column with missing time'. (C100)
list_time_periods.append((current_start_time, timesteps[-1]))
return list_time_periods
Expand Down

0 comments on commit 53e9615

Please sign in to comment.