MATLAB Examples

sodb documentation

The sodb function plots Southern Ocean Database data on maps or polar stereographic cartesian coordinates. Station locations are plotted as markers and gridded data are plotted as pcolor or contours.

Contents

Syntax

sodb('stations')
sodb('stations',MarkerSpec)
sodb(gridvar,zval)
sodb(...,'contour')
sodb(...,'contour',ContourSpec)
sodb(...,'xy')
sodb(...,'xy','km')
[h,C] = sodb(...)

Description

sodb('stations') plots locations of over 93,000 SODB-contributing station locations.

sodb('stations',MarkerSpec) specifies marker properties by name-value pairs.

sodb(gridvar,zval) plots the gridded variable gridvar, which can be 'ptm', 'oxy', 'gam', 'sal'. zval is a depth value in meters and must be one of the following:

   'max', 'min', 10,25,50,75,100,125,150,175,200,250,300,350,400,450,500,550,600,700,
   800,900,1000,1100,1200,1300,1400,1500,1600,1800,2000,2200,2400,2600,2800,3000,
   3250,3500,3750,4000,4250,4500,4750,5000,5250,5500.

sodb(...,'contour') plots gridvar as a contour plot instead of the default pcolor.

sodb(...,'contour',ContourSpec) specifies any contour preferences (e.g., levels, colors, etc.)

sodb(...,'xy') plots in polar stereographic cartesian coordinates. If you do not have the Mapping Toolbox, the 'xy' option is selected automatically.

sodb(...,'xy','km') plots in polar stereographic cartesian kilometers instead of the default meters.

[h,C] = sodb(...) returns a handle h of plotted object. If plot is a contour plot, contour matrix C may also be returned. The contour matrix is helpful for labeling contours with clabel(C,h).

Example 1: Station locations

To plot station locations, just type

sodb 'stations'

Example 2: Formatted station locations

Station locations may be formatted with any of the MarkerSpec properties you might use with plot. Let's zoom a map to the Amundsen Sea region with mapzoom, plot the continent and ice shelves as patch objects with bedmap2, and then show SODB station locations as large red pentagrams. Here I'm using rgb to get the RGB values of ocean blue:

figure
mapzoom('amundsen sea',1000,'inset','ne')
bedmap2 'patchshelves'
bedmap2('patchgl','oceancolor',rgb('ocean blue'))
sodb('stations','rp','markersize',12)

Example 3: Stations in cartesian coordinates

If you have some other data in polar stereographic (71) coordinates and you want to plot SODB station locations alongside that data, include the 'xy' tag to plot in polar stereographic eastings and northings. If you do not have Matlab's Mapping toolbox, the 'xy' option is selected automatically:

figure
sodb('stations','xy')
xlabel 'eastings (m)'
ylabel 'northings (m)'

Example 4: Formatted stations in cartesian coordinates

As with geo coordinates, formatting station locations is easy. Here we'll use 'kx' to specify black x markers and 'km' to plot in polar stereographic kilometers:

figure
sodb('stations','kx','markersize',5,'xy','km')
xlabel 'eastings (km)'
ylabel 'northings (km)'

Example 5: Gridded fields

Let's plot maximum temperature around the Antarctic Peninsula. I'm specifying Jan Brewer's Reds colormap with Stephen Cobeldick's excellent brewermap function:

figure
mapzoom('antarctic peninsula',2000)
bedmap2 patchshelves
bedmap2 patchgl
caxis([-2 4])
cb = colorbar;
ylabel(cb,'max potential temperature {\circ}C')
colormap(brewermap(256,'reds'))
sodb('ptm','max')
scalebar

Example 6: Surface salinity contours

Plot near-surface (10 m depth) salinity as a contour plot:

figure
antmap('northernlimit',-40)
sodb('sal',10,'contour')
cb = colorbar;
ylabel(cb,'10 m salinity')

Example 7: Formatted contour lines

Plot near-surface temperature as black contour lines every 5 degrees C in polar stereographic kilometers:

figure
[h,C] = sodb('ptm',10,'contour','xy','km',0:5:30,'black');
clabel(C,h,'color','b') % blue contour labels
axis tight

Citing these datasets

If you use SODB data, please cite: Orsi, A. H., T. Whitworth III, Hydrographic Atlas of the World Ocean Circulation Experiment (WOCE). Volume 1: Southern Ocean (eds. M. Sparrow, P. Chapman, and J. Gould), International WOCE Project Office, Southampton, U.K. More info on SODB here: http://wocesoatlas.tamu.edu/

Author Info:

This function was written by Chad A. Greene of the Institute for Geophysics at the University of Texas in Austin and David E. Gwyther of the Institute for Marine and Antarctic Studies, University of Tasmania in July 2015. If you have any questions, feel free to contact Chad. You can probably find him through is website here: