python netCDF4 中的纬度和经度表示

Lat and Lon representation in python netCDF4

import netCDF4
import numpy as np

nc_data  = netCDF4.Dataset(out_nc, 'w', format='NETCDF4')
nc_data.description = 'Test'

# dimensions
nc_data.createDimension('lat', 720)
nc_data.createDimension('lon', 1440)
fl_res = 0.25

latitudes     = np.arange(90.0   - fl_res/2.0, -90.0, -fl_res)
longitudes    = np.arange(-180.0 + fl_res/2.0, 180.0,  fl_res)

我正在创建一个 0.25 度分辨率的 netCDF 文件。在我创建的纬度和经度中,它们代表每个网格单元的角还是中心?有什么方法可以选择它们代表什么?

坐标(应该)表示每个网格单元的中心。

在某些特殊情况下,变量(通常是风速)在网格单元的边缘求解。在这种情况下,变量附加到一组 lat/lon 对,这些对在 x 或 y 维度上有一个额外的对。尽管在 post-processing 中,这些基于边缘的变量通常被插值到每个网格单元的中心以遵循一组中心坐标,就像您在上面定义的那样。

编辑:来源

CF conventions - cell boundaries 本质上是说 lat/lon 位于网格单元的中心,以网格单元的顶点为界。对于大多数产品,仅提供了一组 lat/lon 坐标,可以假定这些坐标用于网格单元的中心(CH.4:"If bounds are not provided, an application might reasonably assume the gridpoints to be at the centers of the cells, but we do not require that in this standard.")

NOAA ioSSTv2 - 声明 "The latitude/longitude values in the netCDF coordinate variables are the centers of the grid cells."

的 NOAA 产品示例