Skip to content

Sorted coordinates for combining #5194

Answered by TomNicholas
Zepeng-Mu asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @Zepeng-Mu , thank you for raising this, and apologies for not seeing this earlier.

is it a general rule that coordinates should be sorted so it's easier to combine them?

By using open_mfdataset with it's default values, the combining of datasets is delegated to the function xarray.combine_by_coords. The docstring for combine_by_coords says

"Will attempt to order the datasets such that the values in their dimension coordinates are monotonic along all dimensions. If it cannot determine the order in which to concatenate the datasets, it will raise a ValueError."

That's the source of the ValueError you're seeing. What combine_by_coords wants to do is arrange all your datasets so that …

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Zepeng-Mu
Comment options

Answer selected by max-sixty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants