python-xarray: open_mfdataset concat along two dimensions

前端 未结 3 1021
忘了有多久
忘了有多久 2020-12-17 00:26

I have files which are made of 10 ensembles and 35 time files. One of these files looks like:

>>> xr.open_dataset(\'ens1/CCSM4_ens1_07ic_19820701-19         


        
3条回答
  •  感情败类
    2020-12-17 00:38

    xarray does now support N-D concatenation. As your data has 1-D dimension coordinates, you can simply do

    ds = xr.open_mfdataset('ens*/*NPac*.nc', combine='by_coords')
    

    and it should combine them in order automatically! It should even work for the ensemble dimension, as you gave that a coordinate too.

    Also see this answer to a very similar question.

提交回复
热议问题