I'd like to draw a shape similar to the following example (from the Naval Research Laboratory TC page). The shape is defined by 4 radii, one for each quadrant.
I have multiple track centers in latitude and longitude coordinates of which I plot using Basemap:
def m_plot_wind_speeds(x,y, mps):
# There's a switch-like statement here to determine the color of the
# line based on wind speed which I ignored. This is passed to the
# color kwarg in m.plot as cur_color.
m.plot(x,y, '.-', markersize=ms, linewidth=lw, color=cur_color, \
mew=1.5, markerfacecolor='k')
m = Basemap(projection='cyl',area_thresh=1000, \
llcrnrlat=southLat,urcrnrlat=northLat,llcrnrlon=westLong,urcrnrlon=eastLong,resolution='h')
parallels = np.arange(southLat,northLat+10,10.) # make latitude lines ever 5 degrees from 30N-50N
meridians = np.arange(westLong,eastLong+30,30.) # make longitude lines every 5 degrees from 95W to 70W
m.drawparallels(parallels,labels=[1,0,0,0],labelstyle="+/-", linewidth=0, fontsize=6)
m.drawmeridians(meridians,labels=[0,0,0,1],labelstyle="+/-", linewidth=0, fontsize=6)
m.drawcountries(linewidth=0.25)
m.bluemarble()
# data is a [10]x[~]x[10] list. There are 10 trajectories, each with
# varying lengths. Each trajectory has 10 attributes.
for traj in data:
lat = []
lon = []
wind_speed=[]
for i in traj:
lat.append(float(i[1]))
lon.append(float(i[0]))
wind_speed.append(float(i[2]))
for j,var in enumerate(traj):
if j > 0:
x,y = m([lon[j], lon[j-1]], [lat[j], lat[j-1]])
else:
x,y = m([lon[j], lon[j]],[lat[j], lat[j]])
m_plot_wind_speeds(x,y,wind_speed[j])
# TODO: Insert a function here that takes in a 4 radii and plots them
# in each quadrant.