-
Let's say I have two datasets, both with the same two dimensions and the same n variables. One dimension is time and the other is gid. Some variables depend on both but some others depend only on gid (for instance lat/lon). Between the tow datasets the gid coordinates are the same but the time coordinates are complementary. What I would like is simply join these two datasets in order to have just one with all the time steps. I tried But the result is not the expected one. The variables depending only on the gid dim now depend on both time and gid dimension. For sur, I don't understand something and any help would be greatly appreciated |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Can you try |
Beta Was this translation helpful? Give feedback.
-
the new_ds = xr.concat([ds1, ds2], dim="time", data_vars="minimal", coords="minimal") |
Beta Was this translation helpful? Give feedback.
-
Thank you very much for your answers. I tried all the suggested methods and here are the results. Dataset 1
Dataset 2
Here is the result with combine_by_coords: did not provide the result I'm looking for
Here is the result with combine_nested with concat_dim = 'time': Uh! I don't really understand how the output happens with 6 additional time steps and all the dims applied to my lon/lat variables
Here is the result with concat using the "minimal" setting for both parameters as suggested: it looks like I got the expected result! Wouhou!
|
Beta Was this translation helpful? Give feedback.
the
coords
anddata_vars
parameters ofconcat
allow controlling what is concatenated. Usually, setting them to"minimal"
should be enough: