Plot trajectories on 3D earth

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

Plot trajectories on 3D earth

Post by yaqiang »

3D earth axes is supported from MeteoInfo 3.2.7. This is an example to plot trajectories on 3D earth surface.

Code: Select all

fn = os.path.join(migl.get_sample_folder(), 'HYSPLIT', 'tdump')
f = addfile_hytraj(fn)
lon = f['lon'][:]
lat = f['lat'][:]
alt = f['height'][:] * 1    #scale the height from earth surface
pr = f['PRESSURE'][:]

#Plot
ax = axes3d(earth=True)
ax.lonlat(color='gray')
geoshow('us_states', edgecolor='lightgray')
levs = arange(860, 1030, 10)
traj = plot3(lon, lat, alt, mvalues=pr, levels=levs)
scatter3(lon[:,0], lat[:,0], alt[:,0], s=8, c='c')
colorbar(traj, tickcolor='w', aspect=30, label='Pressure (hPa)', xshift=80)

ax.set_rotation(342)
ax.set_elevation(-51)
ax.set_head(0)
ax.set_pitch(-90)

v = 630
axis([-v,v,-v,v,-v,v])
earth_traj-1.png
Post Reply

Return to “MeteoInfo Software”