Skip to content
Snippets Groups Projects
Commit f4897f7e authored by tomrink's avatar tomrink
Browse files

snapshot...

parent 5e9c47dc
No related branches found
No related tags found
No related merge requests found
...@@ -138,6 +138,19 @@ def upsample(tmp): ...@@ -138,6 +138,19 @@ def upsample(tmp):
return tmp return tmp
def upsample_nearest(grd):
bsize, ylen, xlen = grd.shape
grd = get_grid_cell_mean(grd)
up = np.zeros(bsize, ylen, xlen)
up[:, ::2, ::2] = grd[:, :, :]
up[:, 1::2, ::1] = grd[:, :, :]
up[:, ::2, 1::1] = grd[:, :, :]
up[:, 1::2, 1::2] = grd[:, :, :]
return up
# def get_label_data(grd_k): # def get_label_data(grd_k):
# grd_k = np.where(np.isnan(grd_k), 0, grd_k) # grd_k = np.where(np.isnan(grd_k), 0, grd_k)
# grd_k = np.where(grd_k < 0.5, 0, 1) # grd_k = np.where(grd_k < 0.5, 0, 1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment