Skip to content

Commit b3a467a

Browse files
authored
Merge pull request #165 from aodn/velocity_hourly_indexerror
Fix velocity hourly IndexError
2 parents 35e0167 + 7ee2483 commit b3a467a

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

aodntools/timeseries_products/velocity_hourly_timeseries.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,8 @@ def velocity_hourly_aggregated(files_to_agg, site_code, input_dir='', output_dir
193193

194194
## process in chunks
195195
## in water only
196-
chunk_start = np.datetime64(nc.attrs['time_deployment_start'])
197-
chunk_end = np.datetime64(nc.attrs['time_deployment_end'])
198-
196+
chunk_start = max(np.datetime64(nc.attrs['time_deployment_start']), nc.TIME.data.min())
197+
chunk_end = min(np.datetime64(nc.attrs['time_deployment_end']), nc.TIME.data.max())
199198
time_increment = 60*60*24*chunk_size ## secs x mins x hours x days
200199
chunk_increment = np.timedelta64(time_increment, 's')
201200
chunk_partial = chunk_start + chunk_increment

0 commit comments

Comments
 (0)