File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed
src/py_eddy_tracker/dataset Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ Changed
1414Fixed
1515^^^^^
1616
17+ - Check strictly increasing coordinates for RegularGridDataset.
18+
1719Added
1820^^^^^
1921
Original file line number Diff line number Diff line change @@ -1193,6 +1193,10 @@ def setup_coordinates(self):
11931193 raise Exception (
11941194 "Coordinates in RegularGridDataset must be 1D array, or think to use UnRegularGridDataset"
11951195 )
1196+ dx = self .x_bounds [1 :] - self .x_bounds [:- 1 ]
1197+ dy = self .y_bounds [1 :] - self .y_bounds [:- 1 ]
1198+ if (dx < 0 ).any () or (dy < 0 ).any ():
1199+ raise Exception ("Coordinates in RegularGridDataset must be strictly increasing" )
11961200 self ._x_step = (self .x_c [1 :] - self .x_c [:- 1 ]).mean ()
11971201 self ._y_step = (self .y_c [1 :] - self .y_c [:- 1 ]).mean ()
11981202
You can’t perform that action at this time.
0 commit comments