uxarray icon indicating copy to clipboard operation
uxarray copied to clipboard

uxarray .isel should select multiple dimensions if isels indexers has multiple dimensions

Open ahijevyc opened this issue 1 year ago • 0 comments
trafficstars

Version

v2024.0.1

How did you install UXarray?

Source

What happened?

uxarray.DataArray.isel did not select Time dimension if isel indexers has TIme and grid dimension.

What did you expect to happen?

Select both time and grid dimension from isel indexers.

Can you provide a MCVE to repoduce the bug?

import uxarray

grid_path = "/glade/campaign/mmm/parc/schwartz/MPAS/15-3km_mesh/mpas_init/static.nc"
data_path = [
    "/glade/campaign/mmm/parc/schwartz/HWT2023/mpas/2023053100/post/mem_4/diag.2023-06-01_12.00.00.nc",
    "/glade/campaign/mmm/parc/schwartz/HWT2023/mpas/2023053100/post/mem_4/diag.2023-06-01_15.00.00.nc",
]
uxds = uxarray.open_mfdataset(grid_path, data_path, concat_dim="Time", combine="nested")
uxda = uxds["refl10cm_max"].isel(Time=[0], n_face=0)
assert uxda.Time.size == 1

ahijevyc avatar Jan 20 '24 18:01 ahijevyc