Skip to content

Latest commit

 

History

History
63 lines (41 loc) · 2.78 KB

general_section.md

File metadata and controls

63 lines (41 loc) · 2.78 KB

general_section

Syntax

general_section(object,variable,xref,zref)
general_section(object,variable,xref,zref,interpolate)
general_section(object,variable,xref,zref,interpolate,contours)

Description

general_section(object,variable,xref,zref) creates a section plot from object; where object is a struct created by any of the _build functions in ocean_data_tools (e.g. argo, cruise, hycom, mercator, woa, wod). The color field is specified by variable. xref and zref specify fields to use for the x-axis and z-axis. Alteratively pass xref = 'km' to plot in along-track distance, assuming spherical earth.

general_section(object,variable,xref,zref,interpolate) interpolates the plot using the MATLAB shading function. interpolate=1 for on, interpolate=0 for off.

general_section(object,variable,xref,zref,interpolate,contours) adds contours to the section plot. contours=1 for on, contours=0 for off.

variable is the string name of the field (of object) to be plotted as the color variable of the section plot

zref is the string name of the field (of object) to be plotted as the depth variable of the section plot

xref is the string name of the field (of object) to be plotted as the horizontal variable of the section plot, usually 'stn', 'lat', or 'lon'. Alteratively pass xref = 'km' to plot in along-track distance, assuming spherical earth.

Example 1

% Setup nctoolbox:

setup_nctoolbox

% Built a uniform struct from MOCHA climatology:

month = 10; % Month (1 through 12).
depth = 0;
variable = 'temperature'; %  'temperature' 'salinity'
region = [34 42  -80 -70]; % [30 48 -80 -58]
mocha_simple_plot(month,depth,variable,region)
[xcoords,ycoords] = transect_select('densify',10); % click desired transect on the figure, densify selection by 10x 
zgrid = 1; % vertical grid for linear interpolation in meters
[mocha] = mocha_build_profiles(month,xcoords,ycoords,zgrid); % zgrid optional, no interpolation if unspecified

% Make a temperature section:

object = mocha; % argo, cruise, hycom, mercator, woa, wod
variable = 'temperature'; % see particular struct for options
xref = 'stn';  % 'lat' 'lon' 'stn';
zref = 'depth;  See particular struct for options
interpolate = 1; % 1=on 0=off
contours = 1; % 1=on 0=off
general_section(object,variable,xref,zref,interpolate,contours)

Back