コード例 #1
0
lon_parent = p_file['lon_rho'][:]
lat_parent = p_file['lat_rho'][:]
h = griddata((lon_parent.ravel(), lat_parent.ravel()), h_parent.ravel(),
             (Lonr.ravel(), Latr.ravel())).reshape(Lonr.shape)

#####################

hraw = h.copy()

h2 = h.copy()

####################### TESTING PROFILES
maskr = h * 0
maskr = np.abs(maskr)
maskr[np.where(h > 20.1)] = 1
maskr = process_mask(maskr)

ggg = np.ma.masked_where(maskr == 0, h2)
g = np.ma.masked_where(maskr == 0, h)
gg = np.ma.masked_where(maskr == 0, hraw)

plt.plot(-ggg[-1, :])
plt.show()
plt.plot(-g[-1, :])
plt.show()
plt.plot(-gg[-1, :])
plt.show()

plt.plot(-ggg[0, :])
plt.show()
plt.plot(-g[0, :])
コード例 #2
0
ファイル: make_grid_phd16.py プロジェクト: rsoutelino/sandbox
angle = get_angle(Latu, Lonu)

f0 = 4 * np.pi * np.sin( np.pi * Latr/180 ) / ( 24*3600 )


print ' \n' + '==> ' + '  ADDING TOPOGRAPHY ...\n' + ' '

h = add_topo(Lonr, Latr, pm, pn, run.topo_filename)
hraw = h.copy()
h[ np.where(h > run.hmax) ] = run.hmax

print ' \n' + '==> ' + '  COMPUTING THE MASK ...\n' + ' '

maskr = h*0
maskr[ np.where(h > 0) ] = 1 
maskr = process_mask(maskr)
[masku, maskv, maskp] = uvp_mask(maskr) 

print ' \n' + '==> ' + '  FILTERING THE TOPOGRAPHY ...\n' + ' '

h = smoothgrid(h, maskr, run.hmin, run.hmaxc,
             run.slope, run.npass, run.nfinal)


####################################################################
####################################################################

print ' \n' + '==> ' + '  WRITING NETCDF GRID FILE ...\n' + ' '

now = dt.datetime.now()
Lp = L + 1