def __init__(self, filename):
self.filename = filename
self.file = netCDF4.Dataset(self.filename, 'r')
proj = pyproj.Proj(self.proj)
if "latitude" not in self.file.variables or "longitude" not in self.file.variables:
x, y = np.meshgrid(self.x, self.y)
self._lons, self._lats = proj(x, y, inverse=True)
else:
self._lats = self.file.variables["latitude"][:]
self._lons = self.file.variables["longitude"][:]
self._field_cache = dict()
评论列表
文章目录