@@ -221,6 +221,105 @@ def _create_mollw_ds():
221
221
222
222
mollwds = _create_mollw_ds ()
223
223
224
+
225
+ def _create_inexact_bounds ():
226
+ # Dataset that creates rotated pole curvilinear coordinates with CF bounds in
227
+ # counterclockwise order that have precision issues.
228
+ lon = np .array (
229
+ [
230
+ [64.21746363939087 , 64.42305921561967 , 64.62774455060337 ],
231
+ [64.38488380781622 , 64.5906340869802 , 64.79546745916944 ],
232
+ [64.55349991538067 , 64.75940009330206 , 64.96437666717893 ],
233
+ ]
234
+ )
235
+
236
+ lat = np .array (
237
+ [
238
+ [66.63852914622773 , 66.57692364510149 , 66.51510790697783 ],
239
+ [66.72632651121215 , 66.66454929137457 , 66.60256232699675 ],
240
+ [66.81394503895442 , 66.75199541041104 , 66.68983654206977 ],
241
+ ]
242
+ )
243
+
244
+ lon_bounds = np .array (
245
+ [
246
+ [
247
+ [64.03109895962405 , 64.23707042152387 , 64.44213290724275 ],
248
+ [64.19784426308645 , 64.40397614495 , 64.60919235424163 ],
249
+ [64.36578231818473 , 64.57206989228206 , 64.77743506492257 ],
250
+ ],
251
+ [
252
+ [64.23707042152385 , 64.44213290724275 , 64.64629053434521 ],
253
+ [64.40397614494998 , 64.60919235424163 , 64.81349710155956 ],
254
+ [64.57206989228204 , 64.77743506492257 , 64.98188214131258 ],
255
+ ],
256
+ [
257
+ [64.40397614494998 , 64.60919235424161 , 64.81349710155956 ],
258
+ [64.57206989228204 , 64.77743506492257 , 64.98188214131258 ],
259
+ [64.74136272095073 , 64.94687197648351 , 65.15145647131322 ],
260
+ ],
261
+ [
262
+ [64.19784426308645 , 64.40397614495 , 64.60919235424161 ],
263
+ [64.36578231818473 , 64.57206989228206 , 64.77743506492257 ],
264
+ [64.53492430330854 , 64.74136272095075 , 64.94687197648351 ],
265
+ ],
266
+ ]
267
+ )
268
+
269
+ lat_bounds = np .array (
270
+ [
271
+ [
272
+ [66.62524451217388 , 66.56383049714253 , 66.50220514181308 ],
273
+ [66.71321640554079 , 66.65163077691872 , 66.58983429068188 ],
274
+ [66.801010821918 , 66.73925288286632 , 66.67728458111449 ],
275
+ ],
276
+ [
277
+ [66.56383049714253 , 66.50220514181308 , 66.44037016643905 ],
278
+ [66.65163077691872 , 66.58983429068188 , 66.52782867442114 ],
279
+ [66.73925288286632 , 66.67728458111449 , 66.61510765153199 ],
280
+ ],
281
+ [
282
+ [66.6516307769187 , 66.58983429068185 , 66.52782867442114 ],
283
+ [66.73925288286632 , 66.67728458111449 , 66.61510765153199 ],
284
+ [66.82669478850752 , 66.76455398820585 , 66.702205074604 ],
285
+ ],
286
+ [
287
+ [66.71321640554079 , 66.6516307769187 , 66.58983429068185 ],
288
+ [66.801010821918 , 66.73925288286632 , 66.67728458111449 ],
289
+ [66.88862573342278 , 66.82669478850752 , 66.76455398820585 ],
290
+ ],
291
+ ]
292
+ )
293
+
294
+ rotated = xr .Dataset (
295
+ coords = dict (
296
+ lon = xr .DataArray (
297
+ lon ,
298
+ dims = ("x" , "y" ),
299
+ attrs = {"units" : "degrees_east" , "bounds" : "lon_bounds" },
300
+ ),
301
+ lat = xr .DataArray (
302
+ lat ,
303
+ dims = ("x" , "y" ),
304
+ attrs = {"units" : "degrees_north" , "bounds" : "lat_bounds" },
305
+ ),
306
+ ),
307
+ data_vars = dict (
308
+ lon_bounds = xr .DataArray (
309
+ lon_bounds , dims = ("bounds" , "x" , "y" ), attrs = {"units" : "degrees_east" }
310
+ ),
311
+ lat_bounds = xr .DataArray (
312
+ lat_bounds , dims = ("bounds" , "x" , "y" ), attrs = {"units" : "degrees_north" }
313
+ ),
314
+ ),
315
+ )
316
+
317
+ return rotated
318
+
319
+
320
+ rotds = _create_inexact_bounds ()
321
+
322
+
224
323
forecast = xr .decode_cf (
225
324
xr .Dataset .from_dict (
226
325
{
0 commit comments