Skip to content

Commit faaeaa0

Browse files
committed
Fix index computation
1 parent fdc7dfe commit faaeaa0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

isimip_files_api/netcdf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def get_index(path, point):
2222
dx = ds.variables['lon'][1] - ds.variables['lon'][0]
2323
dy = ds.variables['lat'][1] - ds.variables['lat'][0]
2424

25-
ix = round((lon - ds.variables['lon'][0]) / dx)
26-
iy = round((lat - ds.variables['lat'][0]) / dy)
25+
ix = int(round((lon - ds.variables['lon'][0]) / dx))
26+
iy = int(round((lat - ds.variables['lat'][0]) / dy))
2727

2828
return ix, iy

0 commit comments

Comments
 (0)