Skip to content

Commit 99c92fc

Browse files
committed
fix velocity_hourly time scrambling issue
fixes #157
1 parent 2a891b5 commit 99c92fc

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

aodntools/timeseries_products/velocity_hourly_timeseries.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,12 @@ def append_resampled_values(nc_cell, ds, slice_start, binning_functions):
5757
df_cell = nc_cell.squeeze().to_dataframe()
5858
# shift the index forward 30min to centre the bins on the hour
5959
df_cell.index = df_cell.index + pd.Timedelta(minutes=30)
60-
# TODO: shift timestamps to centre of sampling interval
6160

6261
df_cell_1H = df_cell.resample('1H')
6362
slice_end = len(df_cell_1H) + slice_start
6463

6564
# set binned timestamps
66-
time_slice = (np.fromiter(df_cell_1H.groups.keys(), dtype='M8[ns]') - TIME_EPOCH) / ONE_DAY
65+
time_slice = (np.fromiter(df_cell_1H.min().index, dtype='M8[ns]') - TIME_EPOCH) / ONE_DAY
6766
ds['TIME'][slice_start:slice_end] = time_slice
6867

6968
# take the mean of the variables

0 commit comments

Comments
 (0)