Combine multiple NetCDF files into timeseries multidimensional array python

后端 未结 3 1328
轮回少年
轮回少年 2021-02-10 13:37

I am using data from multiple netcdf files (in a folder on my computer). Each file holds data for the entire USA, for a time period of 5 years. Locations are referenced based on

3条回答
  •  北恋
    北恋 (楼主)
    2021-02-10 14:20

    You can easily merge multiple netCDF files into one using netCDF4 package in Python. See example below:

    I have four netCDF files like 1.nc, 2.nc, 3.nc, 4.nc. Using command below all four files will be merge into one dataset.

    import netCDF4
    from netCDF4 import Dataset
    
    dataset = netCDF4.MFDataset(['1.nc','2.nc','3.nc','4.nc'])
    

提交回复
热议问题