- 积分
- 3454
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2021-4-11
- 最后登录
- 1970-1-1
|
楼主 |
发表于 2021-4-14 20:35:17
|
显示全部楼层
- df = pd.read_sql(sql_cmd, con)
- print(df)
- lons = df['lon']+180.5
- lats = 90.5-df['lat']
- Tem_Means= df['Tem_Mean']
- # lons = list(map(int, lons))
- # lats = list(map(int, lats))
- # Tem_Means = list(map(int, Tem_Means))
- l = [np.array(a) for a in np.broadcast_arrays(lons, lats)]
- print(lons,'\n@@@@@@@@@')
- # 自定义纬度范围 [np.array(a) for a in np.broadcast_arrays(x, y)]
- lat_B=10;lat_E=90;lon_B=30;lon_E=190 #这里选取欧亚
- # 新建地图并设定经纬度范围
- m = Basemap(llcrnrlat = lat_B, urcrnrlat = lat_E, llcrnrlon = lon_B, urcrnrlon = lon_E)
- # 网格化经纬度并形成坐标矩阵masked_b = ma.masked_array(*np.broadcast(b, ext_mask))
- lon, lat = np.meshgrid(l[0], l[1])
- xi, yi = m(lon, lat)
- print(xi.shape)
- print(yi.shape)
- print(Tem_Means.shape)
- m.drawmapboundary(fill_color='aqua')
- m.drawcoastlines(linewidth=0.2,color = '0.15')
- m.drawcountries(linewidth=0.2,color='0.15')
- m.contourf(xi,yi,Tem_Means.reshape())
- m.colorbar()
- plt.show()
复制代码
出现这个了
MemoryError: Unable to allocate 72.0 GiB for an array with shape (98322, 98322) and data type float64
|
|