3D trajectory and terrain

Post Reply
Posts: 53
Joined: October 5th, 2015, 10:20 pm
Registered HYSPLIT User: Yes

3D trajectory and terrain

Post by yaqiang »

From MeteoInfo version 2.0, opengl supported 3D axes was implemented for better 3D data visualization. Following is an example to plot 3D trajectory and terrain.

Code: Select all

fn = 'D:/Temp/hysplit/output_850'
f = addfile_hytraj(fn)
tlayer = f.trajlayer()
ls = tlayer.legend()
for lb in ls.getLegendBreaks():
stlayer = f.trajsplayer()

lcountry = shaperead('country')
lchina = shaperead('cn_province')

#Relief data
fn = 'D:/Temp/nc/elev.0.25-deg.nc'
f = addfile(fn)
elev = f['data'][0,'15:40','90:115']
elev[elev<0] = 0

ax = axes3dgl()
cols = makecolors(20, cmap='MPL_terrain')
cols[0] = 'gray'
ls = ax.plot_surface(elev, 20, colors=cols, edge=False)
ax.plot_layer(stlayer, fill=False)
ax.plot_layer(lchina, offset=100)
ax.plot_layer(lcountry, edgecolor='k', offset=100)
xlim(90, 115)
ylim(15, 40)
zlim(0, 10000)
title('3D trajectory example')
Posts: 16
Joined: November 29th, 2019, 4:38 am
Registered HYSPLIT User: No

Re: 3D trajectory and terrain

Post by McP82 »

I can confirm that it helps a lot compared to the older versions (I recently upgraded to 2.1.1 as I had an ancient version), it required some work to represent the 3d models otherwise.
Post Reply