File tree Expand file tree Collapse file tree 2 files changed +625
-48
lines changed
Expand file tree Collapse file tree 2 files changed +625
-48
lines changed Original file line number Diff line number Diff line change 5050 PolygonNotIntersectingError ,
5151)
5252
53- __version__ = "0.2.7 "
53+ __version__ = "0.2.8 "
5454
5555REGION : Final [str ] = "ap-southeast-2"
5656ENDPOINT_URL = "https://s3.ap-southeast-2.amazonaws.com"
@@ -2049,7 +2049,13 @@ def get_data(
20492049 lat_is_dim = lat_var_name in ds .dims
20502050
20512051 if lat_is_dim :
2052- selectors [lat_var_name ] = slice (lat_min , lat_max )
2052+ # Check the direction of the latitude values, very important for the slicing
2053+ lat_values = ds [lat_var_name ].values
2054+ if lat_values [0 ] > lat_values [- 1 ]:
2055+ # latitude is descending (north to south)
2056+ selectors [lat_var_name ] = slice (lat_max , lat_min )
2057+ else :
2058+ selectors [lat_var_name ] = slice (lat_min , lat_max )
20532059 else :
20542060 if lat_min is not None :
20552061 mask_conditions .append (ds [lat_var_name ] >= lat_min )
You can’t perform that action at this time.
0 commit comments