...
Step 3 - Plotting the cluster centres
The macro to use is 'plot_tr_step3.mv' and is basically the same as the one in Step 2 but contains an additional plot layer. In this plot layer we draw circles around the mean trajectory waypoints using the RMS (root mean square) of the horizontal distances of the particles to this waypoint. The code goes like this:
Code Block | ||
---|---|---|
| ||
#Get rms of the horizontal distances (in km) to the mean particle positions (i.e. waypoints)
mRms=values(tbl,"rmsHBefore")
#Draw an rms circle around every second waypoint
iStart=1
if mod(count(mRms),2)= 0 then
iStart=2
end if
pltRmsLst=nil
for i=iStart to count(mRms) by 2 do
if mRms[i] > 0 then
#input visualiser defining the circle
iv_rms=mvl_geocircle(mLat[i],mLon[i],mRms[i],100)
#circle line attributes
graph_rms=mgraph(
graph_line_colour: "magenta",
graph_line_thickness: "2",
graph_line_style: "dot",
graph_symbol: "off"
)
pltRmsLst=pltRmsLst & [iv_rms,graph_rms]
end if
end for |
Please note that we use mvl_geocircle() to construct the circle and plotted the circle around every second waypoint to avoid cluttering. The only other change with respect to Step 2 is that we need to extend the plot command with the new data layer (pltRmsLst
):
Code Block |
---|
plot(view,iv_track,graph_track,pltRmsLst,pltDateLst,title) |
Step 4 - Plotting the cluster centres
...
The macro to use is 'plot_tr_step3step4.mv'.
kk