Thanks for your advice. I defined the dimensions for the random variable. However, if I have to select the components using .sel, wouldn’t that create the problem that @cluhmann described?
Note that xarray explicitly states that assignment using
.sel()will fail silently, which is probably what is happening when you run your assignment code