爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 2781|回复: 2

读取rmaps数据,并进行了等距离转等经纬度处理

[复制链接]

新浪微博达人勋

发表于 2022-8-4 21:11:19 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册 新浪微博登陆

x
f = addfile("E:/rmaps/rmapsnow_anal_init-20220727070000_3d.nc.gz")
x = f['X'][:]
y = f['Y'][:]
lat = 39.34 + y/30.0*0.27778
lon = 116.5 + x/(30.0*cos(40.95890833/180.0*3.1415926))*0.27778
lon, lat = meshgrid(lon, lat)
figure(figsize=[900, 630], newfig=False)
axesm(position=[0,0.53,0.54,0.46],tickfontsize=12,tickbold=True)

udata = f['uwind'][0,18,:,:]
vdata = f['vwind'][0,18,:,:]
speed = sqrt(udata * udata + vdata * vdata)
rdata = f['rh'][0,4,:,:]
levs = arange(60,100,10)
cols = [(255,255,255),(0,229,238),(0,238,0),(0,205,0),(0,160,0),(0,130,0)]
layer1 = barbsm(lon[::12,::12],lat[::12,::12],
         udata[::12,::12],vdata[::12,::12],speed[::12,::12],
         color='k',size = 9)
#plot map
mlayer = shaperead('F:\Meteinfo\MeteoInfo\map\cn_province.shp')
geoshow(mlayer, edgecolor='black', size=1.2)
xticks([],fontsize=12,bold=True)
yticks([36,37,38,39,40,41,42,],fontsize=12,bold=True)
ylim(lat.min(),lat.max())
xlim(lon.min(),lon.max())

f = addfile("E:/rmaps/rmapsnow_anal_init-20220727080000_3d.nc.gz")
x = f['X'][:]
y = f['Y'][:]
lat = 39.34 + y/30.0*0.27778
lon = 116.5 + x/(30.0*cos(40.95890833/180.0*3.1415926))*0.27778
lon, lat = meshgrid(lon, lat)

axesm(position=[0.4,0.53,0.54,0.46],tickfontsize=12,tickbold=True)

udata = f['uwind'][0,18,:,:]
vdata = f['vwind'][0,18,:,:]
speed = sqrt(udata * udata + vdata * vdata)
rdata = f['rh'][0,4,:,:]
levs = arange(60,100,10)
cols = [(255,255,255),(0,229,238),(0,238,0),(0,205,0),(0,160,0),(0,130,0)]
layer1 = barbsm(lon[::12,::12],lat[::12,::12],
         udata[::12,::12],vdata[::12,::12],speed[::12,::12],
         color='k',size = 9)
#plot map
mlayer = shaperead('F:\Meteinfo\MeteoInfo\map\cn_province.shp')
geoshow(mlayer, edgecolor='black', size=1.2)
xticks([],fontsize=12,bold=True)
yticks([],fontsize=12,bold=True)
ylim(lat.min(),lat.max())
xlim(lon.min(),lon.max())

f = addfile("E:/rmaps/rmapsnow_anal_init-20220727090000_3d.nc.gz")
x = f['X'][:]
y = f['Y'][:]
lat = 39.34 + y/30.0*0.27778
lon = 116.5 + x/(30.0*cos(40.95890833/180.0*3.1415926))*0.27778
lon, lat = meshgrid(lon, lat)

axesm(position=[0,0.04,0.54,0.46],tickfontsize=12,tickbold=True)

udata = f['uwind'][0,18,:,:]
vdata = f['vwind'][0,18,:,:]
speed = sqrt(udata * udata + vdata * vdata)
rdata = f['rh'][0,4,:,:]
levs = arange(60,100,10)
cols = [(255,255,255),(0,229,238),(0,238,0),(0,205,0),(0,160,0),(0,130,0)]
layer1 = barbsm(lon[::12,::12],lat[::12,::12],
         udata[::12,::12],vdata[::12,::12],speed[::12,::12],
         color='k',size = 9)
#plot map
mlayer = shaperead('F:\Meteinfo\MeteoInfo\map\cn_province.shp')
geoshow(mlayer, edgecolor='black', size=1.2)
xticks([113,114,115,116,117,118,119,120],fontsize=12,bold=True)
yticks([36,37,38,39,40,41,42,],fontsize=12,bold=True)
ylim(lat.min(),lat.max())
xlim(lon.min(),lon.max())

f = addfile("E:/rmaps/rmapsnow_anal_init-20220727100000_3d.nc.gz")
x = f['X'][:]
y = f['Y'][:]
lat = 39.34 + y/30.0*0.27778
lon = 116.5 + x/(30.0*cos(40.95890833/180.0*3.1415926))*0.27778
lon, lat = meshgrid(lon, lat)

axesm(position=[0.4,0.04,0.54,0.46],tickfontsize=12,tickbold=True)

udata = f['uwind'][0,18,:,:]
vdata = f['vwind'][0,18,:,:]
speed = sqrt(udata * udata + vdata * vdata)
rdata = f['rh'][0,4,:,:]
levs = arange(60,100,10)
cols = [(255,255,255),(0,229,238),(0,238,0),(0,205,0),(0,160,0),(0,130,0)]
layer1 = barbsm(lon[::12,::12],lat[::12,::12],
         udata[::12,::12],vdata[::12,::12],speed[::12,::12],
         color='k',size = 9)
#plot map
mlayer = shaperead('F:\Meteinfo\MeteoInfo\map\cn_province.shp')
geoshow(mlayer, edgecolor='black', size=1.2)
xticks([113,114,115,116,117,118,119,120],fontsize=12,bold=True)
yticks([],fontsize=12,bold=True)
ylim(lat.min(),lat.max())
xlim(lon.min(),lon.max())

11.png
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2022-8-5 09:02:20 | 显示全部楼层
rmaps数据是什么投影?addfile生成的 f 对象,f.proj 可以看看投影信息,如果能正确读取可以用MeteoInfoLab中的投影函数来进行坐标转换。此外绘图时对于MeteoInfo自带的shape文件不需要shaperead,只要在geoshow中给出shape文件名即可,比如 geoshow('cn_province', edgecolor='k', size=1.2)
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

 楼主| 发表于 2022-8-5 09:32:03 | 显示全部楼层
应该是等经纬度数据,不带投影信息。
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表