mom_grid.py 文件源码

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

项目:ocean-regrid 作者: nicjhan 项目源码 文件源码
def make_corners(self):

        # Uses double density grid to figure out corners.
        x = self.x_vt
        y = self.y_vt

        # Corners of t points. Index 0 is bottom left and then
        # anti-clockwise.
        clon = np.empty((self.x_t.shape[0], self.x_t.shape[1], 4))
        clon[:] = np.NAN
        clon[:,:,0] = x[0:-1:2,0:-1:2]
        clon[:,:,1] = x[0:-1:2,2::2]
        clon[:,:,2] = x[2::2,2::2]
        clon[:,:,3] = x[2::2,0:-1:2]
        assert(not np.isnan(np.sum(clon)))

        clat = np.empty((self.x_t.shape[0], self.x_t.shape[1], 4))
        clat[:] = np.NAN
        clat[:,:,0] = y[0:-1:2,0:-1:2]
        clat[:,:,1] = y[0:-1:2,2::2]
        clat[:,:,2] = y[2::2,2::2]
        clat[:,:,3] = y[2::2,0:-1:2]
        assert(not np.isnan(np.sum(clat)))

        self.clon_t = clon
        self.clat_t = clat
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号