我正在尝试从hdf5文件以散景形式绘制雷达数据。我已将数据存储到1800 * 3600的2d数组中。当我尝试使用p.image
绘制数据时,它显示出带有一些斑点的黑色,我认为这是数据大于0的地方,但它不符合我指定的调色板。我不确定为什么会这样。
f = h5py.File(fname, 'r')
lat = f['Grid']['lat']
lon = f['Grid']['lon']
precip = f['Grid']['precipitationCal']
precip = np.transpose(precip)
d = np.empty((1800,3600))
for (x,y), value in np.ndenumerate(precip):
if value <= 0:
d[x,y]=np.nan
else:
d[x,y]=value
output_file("testimage.html", title="image.py example")
p = figure(x_range = [0, 3600], y_range=[0, 1800])
p.image(image=[d],x=[0],y=[0],dw=[3600], dh=[1800], pallete="Spectral-256")
show(p)
<< img src =“ https://image.soinside.com/eyJ1cmwiOiAiaHR0cHM6Ly9pLnN0YWNrLmltZ3VyLmNvbS96czhRdy5wbmcifQ==” alt =“在此处输入图像描述”>
两件事: