MATLAB Examples

fopmap documentation

The fopmap function creates a map of a flight line from waypoints. Flight lines are placed in context of Bedmap2 gridded data (color), Bedmap2 surface (contours), and MOA2009 grounding lines and coast lines (dark red).

This function does NOT require Matlab's Mapping Toolbox but it does require Antarctic Mapping Tools and the Bedmap2 Toolbox.



h = fopmap(...)


fopmap(lat,lon) plots and labels waypoints of a flight line given geocoordinate waypoints lat,lon. Inputs lat and lon can be decimal degrees or two-column matrices where the first column is integer degrees and the second column is decimal minutes (e.g., [latdeg latmin],[londeg lonmin] ).

fopmap(x,y) specifies waypoints as ps71 meters.

fopmap(...,'turns',turns) specifies a vector of turn types for calculation by the fopturns function. Use zeros for each waypoint except 270 where at waypoints where you want big loopy turns and set turns to 180 at the at the beginning of a 180 degree turn. For more info see the fopturns documentation.

fopmap(...,'turns',turns,'radius',TurningRadius_m) specifies an aircraft turning radius in meters. Default turning radius is 5000 m.

fopmap(...,'base',basemap) specifies a basemap (the color-scaled map) as Bedmap2 'bed', 'thickness', 'surface', or 'none' . Default is 'bed'.

fopmap(...,'lakes') uses smithlakes to plot subglacial lakes. (requires Mapping Toolbox and the smithlakes function.

h = fopmap(...) returns handles of plotted objects as a structure h. Elements in the h structure are:

            base: handle of color-scaled base map (an |imagesc| object).
           lakes: handle of lake patch objects (if the |'lakes'| option is selected).
   minorcontours: handle of 200 meter contour intervals.
   majorcontours: handle of 1000 meter contour intervals.
   contourlabels: handles of contour labels (pre-R2014b only)
              gl: handle of MOA 2009 grounding line (if you have the underlying data).
              cl: handle of MOA 2009 coast line (if you have the underlying data).
      flightline: handle of flight line.
              wp: handle of waypoint markers.
           label: handle of waypoint text labels.
         labelbg: handle of waypoint text label background "outlines".
        scalebar: handle of scalebar.
    scalebartext: handle of scalebar text label.

Example 1: Simplest case

In this example waypoint coordinates are entered in degrees, decimalMinutes format to match this file: /disk/kea/WAIS/targ/xped/ICP6/plan/flight_plans/WSD-GIMBLE-INFILL1/waypoints.txt

lat = [ -79 28.06;
        -79 31.02;
        -75 14.95;
        -75 22.40;
        -79 41.67;
        -79 49.26;
        -78 01.02;
        -79 28.06];

lon = [ -112 05.16;
        -121 47.39;
        -131 01.17;
        -132 21.68;
        -123 33.53;
        -124 55.52;
        -129 14.01;
        -112 05.16];


Example 2: Estimate turns

Here we specify that we want ~270 degree turns at waypoints 3, 4, and 7. Begin a 180 degree turn at waypoint 5. Specify an aircraft turning radius of 8.5 km and plot flight lines on a map of ice thickness. Use the same waypoints as in Example 1, but declare them in ps71 coordinates:

x = [-1063266 -970737 -1215679 -1180454 -935503 -909082 -1012026 -1063266];
y = [-431445 -601644 -1057500 -1076443 -620578 -634782 -826374 -431445];
turns = [0 0 270 270 180 0 270 0];


Zoom in to check out those beautiful 270 degree turns:

axis([-1288582 -1118277 -1208931 -929398])

Example 3: Format the display.

Start by repeating Example 2. We'll specify waypoints in decimal degrees this time, return a handle of plotted objects, and use surface elevations as the base color. Also include Smith's active subglacial lakes:

[lat,lon] = ps2ll(x,y);
turns = [0 0 180 0 270 270 270 0];

h = fopmap(lat,lon,'turns',turns,'radius',12000,'base','surface','lakes');

Above we said a 180 turn should start at waypoint 3, see:

ax = axis;
axis([-1288582 -1118277 -1208931 -929398])

While we're zoomed in, let's change the color of our scalebar to red and make the grounding line fat and mauve:

set(,'color',[0.68 0.44 0.51],'linewidth',3)

Zoom back to our original axis limits:


Make the flight line a dashed blue line and turn the Smith lakes yellow:


Waypoint text labels are not actually made of a fancy font that has an outline. Instead, they're made of 8 white "background" text labels placed under each red label to create the appearance of an outline. Change the apparent outline color to green and change the label colors to black.


Author Info

The fopmap function and supporting documentation were written by Chad A. Greene of the University of Texas at Austin's Institute for Geophysics (UTIG), November 2015.