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
评论列表
文章目录