Plots

Overview of all plotting functions

This page provides example calls and outputs for each of the plotting functions contained within agate. There are plotting functions that may be useful during mission planning, active piloting, and in post-processing and analysis, and the plots are grouped by those categories below.

Basic details for each plotting function are available within the standard MATLAB-type documentation in the header of each function and include a detailed description, info on input and output arguments, and examples. These details can be pulled up by typing doc <function> or help <function> within the MATLAB Command Window.

Initialization

To run any of the agate plotting functions, the toolbox must be initialized with a configuration file.

No configuration file yet? Go back to Get started - Create configuration files. At a minimum, the configuration file must include the top required portion, as well as the optional - plotting section.

% ensure agate is on the path

% initialize with specified configuration file, 'agate_config.cnf'
CONFIG = agate(agate_config.cnf);

% initialize with prompt to select configuration file
CONFIG = agate;

Most of the plotting functions rely on a pp (piloting parameters) variable that is a large table with various outputs from the .nc and .log files compiled in one place. If this has already be created, it can be loaded directly. If not, use extractPilotingParams to build it.

% load existing pp table
load(fullfile(CONFIG.path.mission, 'flightStatus', ['diveTracking_' CONFIG.glider '.mat']))

% create new pp table
pp = extractPilotingParams(CONFIG, fullfile(CONFIG.path.mission, 'basestationFiles'), fullfile(CONFIG.path.mission, 'flightStatus'), 0);
% zero as last argument creates it from scratch (does not load any previous tables)
save(fullfile(CONFIG.path.mission, 'flightStatus', ['diveTracking_' CONFIG.glider '.mat']), 'pp');

Back to top

Piloting plots

Some of the below piloting plots are also available within the Seaglider Piloting Tools, but agate allows for more automated plotting (without the GUI) and tries to improve on some of those existing plots, either with better labels, more detail, or addition of acoustic inputs.

Humidity and pressure

plotHumidityPressure(CONFIG, pp)

Example humidity and pressure plot.

Minimum voltage

Rev B gliders (e.g., SG639 - left side) will have two lines - one each for the ‘24V’ and ‘10V’ batteries (even if both are 15V), while Rev E gliders (e.g., SG679 - right side) will also have two lines, but the 10V line will primarily remain at 15V and only the 24V line will decrease over the mission.

plotMinVolt(CONFIG, pp)

Minimum voltage plot for SG639 (Rev B glider).

Minimum voltage plot for SG679 (Rev E glider).

Battery remaining and PAM free space

If the glider is using a PMAR acoustic system, the free space remaining on each SD card will plot with the remaining battery capacity.

The 30% battery line and 35 GB PMAR line are hard coded into the plot, but could be modified within the function. The ‘target mission duration’ line is defined by CONFIG.tmd, as set in the configuration file.

plotBattUseFreeSpace(CONFIG, pp)

Remaining battery and PAM storage space for SG639 with PMARXL installed and operating.Note glider battery was not full at start of mission so remaining battery starts at just over 60%.

Voltage use by device

If the glider is using a PMAR or WISPR acoustic system, power draw of the acoustic system will be included with measures of pitch, roll, and VBD (variable buoyancy device).

plotVoltagePackUse(CONFIG, pp)

Energy use by device, reported for each dive for SG639 (Rev B glider).

Energy use by device, reported for each dive for SG679 (Rev E glider).

Voltage use by device, normalized by dive duration

If the glider is using a PMAR or WISPR acoustic system, power draw of the acoustic system will be included with measures of pitch, roll, and VBD (variable buoyancy device).

plotVoltagePackUse_norm(CONFIG, pp)

Energy use by device, normalized by dive duration for SG639 (Rev B glider).

Energy use by device, normalized by dive duration for SG679 (Rev E glider).

Map

The map will include the waypoints and track from the targets file and will plot the surface positions of each dive (yellow dots), with red lines connecting surface positions, currents plotted as blue vector arrows, and the next target waypoint with a green circle.

Map extent (latitude and longitude limits), the location of the north arrow, and the location and scale of the scale bar are all set within the mission configuration file, with example values below. CONFIG.latLim and CONFIG.map.lonLim are required to make the map; the north arrow and scale bar are optional and if those settings do not exist in CONFIG they will not be included in the plot.

In this example, bathymetry is plotted, specified by CONFIG.map.bathyFile. That last argument can be left out to not plot bathymetry (which can be slow depending on the resolution of the selected bathymetry raster). If the last argument is set to 1, a prompt will appear to select the correct bathymetry file.

High resolution bathymetry TIFF files can be downloaded from NCEI. See Dependecies - Basemap rasters for more info on how to select and download bathymetry rasters.

targetsFile = fullfile(CONFIG639.path.mission, 'targets');

% map set up configurations - all should be specified in configuration file 
CONFIG.map.latLim = [19.0 22.75];
CONFIG.map.lonLim = [-160.0 -154.25];
CONFIG.map.naLat = 22.15;
CONFIG.map.naLon = -154.5;
CONFIG.map.scalePos = [-0.04 0.34];
CONFIG.map.scaleMajor = [0:50:100];
CONFIG.map.scaleMinor = [0:12.5:25];

% plot with bathymetry - file specified 
plotGliderPath_etopo(CONFIG, pp, targetsFile, CONFIG.map.bathyFile);

% plot with bathymetry - prompt for bathy file
plotGliderPath_etopo(CONFIG, pp, targetsFile, 1);

% plot without bathymetry
plotGliderPath_etopo(CONFIG, pp, targetsFile);

Example piloting map with planned track and waypoints in black, realized track in red with surface positions in yellow, and depth averaged currents as blue vector arrows. The current target waypoint is circled in green.

Back to top

Mission summary plots

Final trackline map

Dive profile

Sound speed profile

Analysis plots

Cetacean event maps