oras_grid.py 文件源码

python
阅读 16 收藏 0 点赞 0 评论 0

项目:esmgrids 作者: DoublePrecision 项目源码 文件源码
def __init__(self, grid_def, description=''):

        with nc.Dataset(grid_def) as f:

            # Select points from double density horizontal grid. Only
            # need t-points.
            try:
                x_t = f.variables['nav_lon'][:]
                y_t = f.variables['nav_lat'][:]
                z = f.variables['deptht'][:]
            except KeyError:
                x_t = f.variables['lon'][:]
                y_t = f.variables['lat'][:]
                z = f.variables['depth'][:]

            mask = np.zeros_like(f.variables['tmask'], dtype=bool)
            mask[f.variables['tmask'][:] == 0.0] = True

        super(OrasGrid, self).__init__(x_t, y_t, mask_t=mask,
                                       levels=zdescription)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号