cf-xarray icon indicating copy to clipboard operation
cf-xarray copied to clipboard

wrongly shaped bounds from add_bounds method

Open MuellerSeb opened this issue 2 years ago • 1 comments

Hey there,

was tinkering around with the add_bounds method and got this (from dump):

float yc_bounds(bounds, yc) ;

From the CF-conventions, I found the following example for cell boundaries:

float A_bnds(eta, 2) ;

Here the shape is transposed.

Also ncview complains about the bounds with:

Error, compiled with max number of vertices for bounds var of 50!  But found a var with n=600

So I guess, the bounds should be transposed.

MuellerSeb avatar Jul 06 '22 10:07 MuellerSeb

I think, adding a .transpose() in this line should solve this: https://github.com/xarray-contrib/cf-xarray/blob/b031b45838a0c6c7ece71d9324face2e346cf360/cf_xarray/accessor.py#L483

MuellerSeb avatar Jul 06 '22 11:07 MuellerSeb