主要使用xarray库处理
首先是安装库
依赖较多使用anaconda方便一些
在anaconda环境中
pip install h5py
conda install -c anaconda netcdf4
用到了两个方法,读取和拼接
f_new = []
t1 = xr.open_dataset('./data/1.nc4')
t2 = xr.open_dataset('./data/2.nc4')
new_nc4=xr.concat(f_new, dim='time')
new_nc4.to_netcdf('./out/new.nc4')