ny, nx = 360, 720
data = np.fromfile('rsus.bin', dtype='float32').reshape(ny,nx)

lons = np.linspace(0+180./nx, 360-180./nx, nx)
lats = np.linspace(-90+90./ny, 90-90./ny, ny)
lons[lons > 180] -= 360    # slide 180~360 to -180~0
lons, lats = np.meshgrid(lons, lats)    # 1D -> 2D
data = maskoceans(lons, lats, data)

m = Basemap(llcrnrlon=0, urcrnrlon=360, llcrnrlat=-90, urcrnrlat=90,
            area_thresh=10000)
m.drawcoastlines(linewidth=0.4)
m.drawmeridians(np.arange(0,360,30), linewidth=0.5,
                color='gray', dashes=[2,1], labels=[0,0,0,1])
m.drawparallels(np.arange(-90,91,30), linewidth=0.5,
                color='gray', dashes=[2,1], labels=[1,0,0,0])
m.imshow(data, cmap=plt.cm.jet, interpolation='nearest')
plt.title('surface upward longwave radiation [W/m2]')
plt.show()
plt.close()