使用xarray python组合空间netcdf文件 [英] combining spatial netcdf files using xarray python
问题描述
是否可以将两个或多个具有相同时间维度但空间域不同的netCDF文件合并到单个netCDF文件中?空间域由纬度和经度坐标指定?在有关xarray concat,merge等的文档中,他们说它们使用单一维度
Is there a way to merge 2 or more netCDF files with the same time dimension but different spatial domains into a single netCDF file? The spatial domains are specified by latitude and longitude coordinates? In the documentation for xarray concat, merge etc., they say that they work with a single dimension
推荐答案
我对您的问题的理解是,您想打开多个netcdf文件,这些文件包含数据的不同空间部分,其中整个数据集已被分解.沿着lat
和lon
.
My understanding of your question is that you want to want to open multiple netcdf files which contain different spatial sections of your data, where the overall dataset has been broken down along both lat
and lon
.
如果是这种情况,那么恐怕xarray目前不支持此功能,我在xarray github上问了完全相同的问题
If that's the case, then I'm afraid xarray doesn't support this at the moment, I asked about exactly the same issue on the xarray github here.
在此处..
在我的情况下,我想将连接的数据集保存到一个新的netcdf文件中,但是使用此方法最终将所有数据立即加载到内存中.为了解决这个问题,我最终不得不使用netcdf python库在较低的级别上解决此问题,但是这花费了大量的精力.
In my case I then wanted to save the concatenated dataset to a single new netcdf file, but using this method ended up loading all the data into memory at once. TO get around this I ended up having to use the netcdf python library to solve this at a lower level, but it took a lot of effort.
这篇关于使用xarray python组合空间netcdf文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!