打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
一文击穿气象可视化:micaps、python、meteoinfo、quickearth分别绘制风云...
micaps、meteoinfo、quickearth是国内气象信息综合分析处理自成体系的三大框架。python成长很快,但是还没看到体系化的针对气象可视化分析的方案出现。

本文通过风云卫星的可视化处理分析来展示这四种技术方案,各有优缺点。个人认为MeteoInfo是国产气象信息综合分析最具生命力,对于所有人都值得学习的一套框架。web系统建设quickearth绝对是首选,哪怕是学习一下设计思想,帮助都是非常巨大的。

Micaps

不用说了,国家队做的。可靠、专业,很多时候自己搞的对不对。都可以在micaps上面参考对照答案。而且文档写的非常好。

MeteoInfo

是由中国气象科学研究院王亚强研究员开发的一款适用于GIS应用程序和科学计算环境(尤其是气象界)的集成框架。

Quick Earth

是象辑南京研究院基于WEBGIS核心,结合以气象数据为主的时空数据的展示特性。二三维一体框架,三维绝对是气象可视化的巅峰。


Micaps
MeteoInfo
Quick Earth
使用场景
预报实际业务
科研、业务系统开发
web业务系统开发
优点
准确、可靠、文档精美
开源、功能全面
使用简单、效果炫酷
缺点
定制比较困难
文档太少,深入需要阅读源码
分析功能比较弱
使用人员
气象预报员
气象科研人员、开发人员
前端开发人员为主
我们就直接开始吧。之所以提一文击穿呢,是因为其实都是一个套路。就三招。Quick Earth做的就更加极致了。各种配置项,都写不了几行代码。

1、数据读取
2、颜色、效果配置
3、渲染成图

Micaps
为了保持效果统一,就直接把Micaps的调色板拿来用了。哈哈哈

python
附核心代码
    awx = FY4A_AWX.FY4A_AWX(file)
    # 读出数据
    data = awx.data_out()
    # 读出经纬度等信息
    lons, lats, lonmid, latmid = awx.geo_out()
    # 计算数据尺寸
    size1, size2 = (data.shape[1], data.shape[0])
    # 读取通道
    channel_number = awx.channel_number
    print('数据读取成功!')
    # 投影方式
    # proj = ccrs.LambertConformal(central_longitude=lonmid, central_latitude=latmid, standard_parallels=[35])
    # proj = ccrs.LambertConformal(central_longitude=lonmid, central_latitude=latmid, standard_parallels=[35])
    proj = ccrs.PlateCarree(central_longitude=0.) # 设置自定义color与量程
    colordict = color.colordict
    colorlevel = color.colorlevel
    cmap = mcolors.ListedColormap(np.array(colordict) / 255) # 产生颜色映射
    # cmap.set_over(np.array([(0, 0, 0, 255)]) / 255)
    # cmap.set_under(np.array([10, 10, 91, 255]) / 255)
    norm = mcolors.BoundaryNorm(colorlevel, cmap.N) # 生成索引
    plt.axis('off')

    # 自定义尺寸画图
    fig.set_size_inches(size1 / 110.6, size2 / 100)
    # 设置图片无边框
    plt.subplots_adjust(top=1, bottom=0, right=1, left=0, hspace=0, wspace=0)
    plt.margins(0, 0)
    ax = plt.axes(projection=proj)
    ax.background_patch.set_visible(False)
    ax.outline_patch.set_visible(False)
    plt.gca().xaxis.set_major_locator(plt.NullLocator())
    plt.gca().yaxis.set_major_locator(plt.NullLocator())
    plt.subplots_adjust(top=1, bottom=0, right=1, left=0, hspace=0, wspace=0)
    plt.margins(0, 0)

    imdat2 = ax.imshow(data, origin='upper', cmap=cmap, norm=norm,
                       transform=ccrs.PlateCarree(), \
                       alpha=.9)
    print('绘制完成')
    file_name = file.split('/')[-1] + '.png'
    # plt.savefig(file_name, bbox_inches='tight')
    plt.show()
    plt.close()
    plt.clf()


meteoinfo
注意颜色代码是反的,而且要多加一位。感谢安定老师的指点
fn =u'FY4A_B14_R040_20211130_0834.AWX'
f = addfile_awx(fn)
figure(figsize=[1200,800], newfig=False)
data = f['var'][:,:]
#Plot
axesm()

levs=[119.3, 126.59, 131.8, 136.1, 139.69, 142.8, 145.6, 148.1, 150.5, 152.6, 154.6, 156.5, 158.3, 160.0,
              161.69, 163.19,
              164.69, 166.1, 167.5, 168.8, 170.1, 171.39, 172.6, 173.8, 174.89, 176.0, 177.1, 178.19, 179.19, 180.19,
              181.19,
              182.19, 183.1, 184.0, 185.0, 185.8, 186.69, 187.6, 188.39, 189.3, 190.1, 190.89, 191.69, 192.5, 193.3,
              194.0,
              194.8, 195.5, 196.3, 197.0, 197.69, 198.39, 199.1, 199.8, 200.5, 201.19, 201.8, 202.5, 203.19, 203.8,
              204.39,
              205.1, 205.69, 206.3, 206.89, 207.5, 208.1, 208.69, 209.3, 209.89, 210.5, 211.1, 211.69, 212.19, 212.8,
              213.3,
              213.89, 214.39, 215.0, 215.5, 216.1, 216.6, 217.1, 217.69, 218.19, 218.69, 219.19, 219.69, 220.19, 220.69,
              221.19,
              221.69, 222.19, 222.69, 223.19, 223.69, 224.19, 224.69, 225.1, 225.6, 226.1, 226.6, 227.0, 227.5, 227.89,
              228.39,
              228.89, 229.3, 229.8, 230.19, 230.69, 231.1, 231.5, 232.0, 232.39, 232.8, 233.3, 233.69, 234.1, 234.6,
              235.0,
              235.39, 235.8, 236.3, 236.69, 237.1, 237.5, 237.89, 238.3, 238.69, 239.1, 239.5, 239.89, 240.3, 240.69,
              241.1,
              241.5, 241.89, 242.3, 242.69, 243.1, 243.5, 243.89, 244.19, 244.6, 245.0, 245.39, 245.8, 246.1, 246.5,
              246.89,
              247.3, 247.6, 248.0, 248.39, 248.69, 249.1, 249.5, 249.8, 250.19, 250.6, 250.89, 251.3, 251.6, 252.0,
              252.39,
              252.69, 253.1, 253.39, 253.8, 254.1, 254.5, 254.8, 255.19, 255.5, 255.8, 256.2, 256.5, 256.89, 257.2,
              257.6,
              257.89, 258.2, 258.6, 258.89, 259.2, 259.6, 259.89, 260.2, 260.6, 260.89, 261.2, 261.5, 261.89, 262.2,
              262.5,
              262.79, 263.2, 263.5, 263.79, 264.1, 264.5, 264.79, 265.1, 265.39, 265.7, 266.0, 266.39, 266.7, 267.0,
              267.29,
              267.6, 267.89, 268.2, 268.5, 268.79, 269.1, 269.5, 269.79, 270.1, 270.39, 270.7, 271.0, 271.29, 271.6,
              271.89,
              272.2, 272.5, 272.79, 273.1, 273.39, 273.7, 274.0, 274.29, 274.6, 274.89, 275.2, 275.5, 275.7, 276.0,
              276.29,
              276.6, 276.89, 277.2, 277.5, 277.79, 278.1, 278.39, 278.6, 278.89, 279.2, 279.5, 279.79, 280.1, 280.29,
              280.6]
color=[(0, 0, 0),(0, 0, 0), (10, 10, 10), (34, 33, 34), (46, 45, 46), (59, 56, 59), (71, 68, 71), (83, 80, 83),
             (95, 92, 96), (108, 103, 108), (120, 115, 120), (132, 127, 133), (145, 138, 145), (157, 150, 157),
             (169, 162, 170), (181, 174, 182), (194, 185, 194), (206, 197, 207), (218, 209, 219), (231, 221, 232),
             (233, 182, 219), (234, 171, 203), (235, 166, 195), (236, 160, 187), (237, 155, 179), (238, 150, 171),
             (239, 144, 163), (240, 139, 155), (241, 134, 147), (242, 128, 139), (243, 123, 131), (244, 118, 123),
             (245, 113, 115), (245, 98, 100), (245, 78, 80), (245, 69, 70), (245, 54, 55), (218, 81, 70), (205, 95, 77),
             (192, 109, 85), (179, 123, 93), (166, 137, 101), (152, 116, 74), (165, 129, 76), (172, 136, 78),
             (179, 143, 79), (186, 149, 81), (193, 156, 82), (199, 163, 84), (206, 170, 85), (213, 176, 87),
             (220, 183, 88), (227, 190, 90), (234, 197, 91), (241, 204, 93), (240, 201, 83), (231, 203, 103),
             (226, 205, 114), (222, 206, 124), (218, 208, 135), (213, 209, 145), (209, 211, 156), (205, 212, 166),
             (200, 214, 177), (196, 215, 187), (192, 217, 198), (187, 218, 208), (183, 220, 219), (179, 221, 229),
             (175, 223, 240), (169, 221, 240), (165, 216, 237), (164, 214, 235), (162, 212, 234), (161, 210, 232),
             (159, 208, 231), (157, 205, 230), (156, 203, 228), (154, 201, 227), (153, 199, 225), (151, 197, 224),
             (149, 195, 223), (148, 193, 221), (146, 190, 220), (145, 188, 218), (143, 186, 217), (141, 184, 216),
             (140, 182, 214), (138, 180, 213), (137, 177, 211), (135, 175, 210), (133, 173, 209), (132, 171, 207),
             (130, 169, 206), (129, 167, 204), (127, 165, 203), (125, 162, 202), (124, 160, 200), (122, 158, 199),
             (121, 156, 197), (119, 154, 196), (117, 152, 195), (116, 149, 193), (114, 147, 192), (113, 145, 190),
             (111, 143, 189), (109, 141, 188), (108, 139, 186), (106, 137, 185), (105, 134, 183), (103, 132, 182),
             (101, 130, 181), (100, 128, 179), (98, 126, 178), (97, 124, 176), (95, 121, 175), (93, 119, 174),
             (92, 117, 172), (90, 115, 171), (89, 113, 169), (87, 111, 168), (85, 109, 167), (84, 106, 165),
             (82, 104, 164), (81, 102, 162), (79, 100, 161), (77, 98, 160), (76, 96, 158), (74, 93, 157), (73, 91, 155),
             (71, 89, 154), (69, 87, 153), (68, 85, 151), (66, 83, 150), (65, 81, 148), (63, 78, 147), (61, 76, 146),
             (60, 74, 144), (58, 72, 143), (57, 70, 141), (55, 68, 140), (54, 66, 139), (53, 65, 138), (51, 63, 136),
             (50, 62, 135), (49, 61, 134), (49, 60, 133), (48, 59, 132), (47, 58, 132), (46, 57, 131), (46, 56, 130),
             (45, 55, 129), (44, 54, 128), (43, 53, 127), (43, 52, 127), (42, 51, 126), (41, 50, 125), (40, 49, 124),
             (40, 48, 123), (39, 47, 122), (38, 46, 122), (37, 45, 121), (36, 44, 120), (36, 43, 119), (35, 42, 118),
             (34, 41, 117), (33, 40, 117), (33, 39, 116), (32, 38, 115), (31, 37, 114), (30, 36, 113), (30, 35, 112),
             (29, 34, 112), (28, 33, 111), (27, 32, 110), (27, 31, 109), (26, 30, 108), (25, 29, 107), (24, 28, 107),
             (23, 27, 106), (23, 26, 105), (22, 25, 104), (21, 24, 103), (20, 23, 102), (20, 22, 102), (19, 21, 101),
             (18, 20, 100), (17, 19, 99), (17, 18, 98), (16, 17, 97), (15, 16, 97), (14, 15, 96), (14, 14, 95),
             (13, 13, 94), (12, 12, 93), (11, 11, 92), (11, 11, 92), (10, 11, 91), (10, 11, 91), (10, 11, 91),
             (10, 11, 91), (10, 11, 91), (10, 11, 91), (10, 11, 91), (10, 11, 91), (10, 11, 91), (10, 11, 91),
             (10, 11, 91), (10, 11, 91), (10, 11, 91), (10, 11, 91), (10, 11, 91), (10, 11, 91), (11, 12, 92),
             (11, 12, 92), (11, 11, 92), (11, 11, 92), (10, 11, 91), (10, 10, 91), (10, 10, 91), (10, 10, 91),
             (12, 13, 93), (12, 13, 93), (11, 12, 92), (11, 12, 92), (11, 11, 92), (11, 11, 92), (10, 11, 91),
             (10, 10, 91), (10, 10, 91), (10, 10, 91), (12, 12, 93), (12, 12, 93), (12, 12, 93), (12, 12, 93),
             (11, 11, 92), (11, 11, 92), (11, 11, 92), (11, 11, 92), (10, 10, 91), (10, 10, 91), (10, 10, 91),
             (10, 10, 91), (12, 12, 93), (12, 12, 93), (11, 12, 92), (11, 11, 92), (11, 11, 92), (11, 11, 92),
             (10, 10, 91), (10, 10, 91), (10, 10, 91), (10, 10, 91), (10, 10, 91), (10, 10, 91), (10, 10, 91),
             (10, 10, 91)]
color.reverse()
print color
layer = imshowm(data, levs,colors=color)
colorbar(layer)
title(u'风云4')
savefig(u'/Users//Desktop/MeteoInfo/sample/气象可视化fy4_awx.png',dpi=300)

quickearth

因为qe是一套前端的框架,所以我们把数据处理成zip包的二进制格式加载会快很多哈。
uti.readBinary('public/data/demo/FY4A_.zip', 'get', undefined, buffer => {
            const provider = new GridCustomProvider3d(buffer);
            // (provider.getGrid() as ScalableGridData).dataOffset = 273.15;
            this.colorLayer = new RasterLayer3d({
                dataSource: provider,
                styleKey: 'demo/sate.fy4.3d',
                interp: true
            });
            this.map.add(this.colorLayer);
            this.colorLayer.meteoStyle = ioc.get<IStyleService>(consts.styleService).getStyle('demo/sate.ir.3d').gridStyle;
            this.extrudeLayer = new CustomElevationLayer({
                dataSource: provider,
                scale: 500,
                interp: true,
                turScale: 1
            });
            this.map.ground.layers.add(this.extrudeLayer);
            evt.fire(consts.evtQLayerAdded, { firer: this, data: this.colorLayer });
        });

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
MeteoInfo介绍
国内气象可视化巅峰之作QE免费用!
awx
这些空间地图都可以做?!这个一键式工具太赞了~~
干货:12个案例教你用Python玩转数据可视化(建议收藏)
Python数据可视化
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服