SBPLOT: Oceanographic data presentation
This is a small matlab toolbox to make different graphical
representations of oceanographic data using a graphical user
interface. The data is supposed to
be in Seabird CNV format (ascii or binary) or in netcdf Format
(essentially one profile per netcdf file). It should be easy to
include other formats.
Sbplot has been developped for Matlab 6 on Linux
operating systems, but do also work on Matlab 6 for Windows. It
definitely does not work under Matlab 4. For using sbplot
it is required to include the CSIRO Seawater
Toolbox in the matlab search path as well as the sbplot
directory itselves. Working with netcdf files the netcdf toolbox
Calling sbplot, a GUI opens (show
picture). This GUI is divided into three parts:
Datafiles, where the input data is defined
It is recommended to follow these steps one after the other.
Finally pressing the button ,
the GUI closes and the data is read in and drawn.
- Data manipulation, where some
simple data processing can be choosen.
- Plotstyle, where the the kind of graphics
can be choosen.
To select the datafiles, there are two possibilities. The
selection between both is done with switchbuttons
in the upper right corner. Although it is possible to switch back
and forth between both options, only the option that is active
when leaving the the GUI with
is used for
the actual data input.
- This option is intended for single cruise data, which is stored
within one directory, with filenames that just differ by the profile/
station number (e.g. CTD001.cnv, CTD002.cnv,...). The following mask
has to be filled out:
- In the box Verzeichnissangabe (directoryname), the complete path
of the directory containing the desired datafiles is demanded.
- In the box 1 Namensteil (first part of name), the first letters
of the filename has to be given. Usually those letters are
representing the short name of a cruise.
- In the box Dateinummern (file numbers), the second part of the
filename is asked for; the numerical identity of a station. The
input should follow the Matlab notation. Therefore input of [1
2 3 4 5] could be done like [1:5] in a shorter way.
- The extension is the third part of the filenames, in general
the extension. If this does not includes a point, one is added.
Including a point it is possible to adress also files, where the
extension doesn't follow right after the file number
(e.g. CTD001new.cnv). To supress the automatic inclusion of a point
use "*" as the first character of the extension.
- Within this option individual file names can be given manually,
browsed for. The input is a text mask which can be edited and shows the
It is also possible to include several files, using a comma separated
format as given below:
similar as in the optiion PATH above, this selects all files from
station number NR1 to station number NR2. (If NR1 is larger the
NR2 is just means NR1:-1:NR2).
The filenames will be read from the file FILELIST, one filename
The file FILELIST will be read, till a line beginning with *LABEL
is found. All following lines are then taken as names of datafiles,
until a line beginning with a * is found.
Another detail the user should notice is, following the
interaktive selection by , the option filelist is allways
active. A change to option now, causes sbplot to take the
path and the filename of the interactive selection (usually the
last line of the list) as settings for the input mask of option
path. If the structure of the filename is not a simple
common one, the settings must be corrected manually.
Some basic data processing can be choosen here. These are exluding
the up-profile or data near the surface and average to regular
In the box of Werte entfernen mit Druck kleiner als (db) one can choose to
exclude values with pressure less then the given value. This is
useful, if the values on deck or when the pump was still not working have not been
Checking Hievteile entfernen it can be determined to leave out upcast data.
If the value at Mitteln auf db is larger then zero, values are averaged onto
fixed pressure steps each given db. This is necessary for cross-sectional pictures.
The value of Druckfenster beim mitteln determines the size of pressure window
used in the averaging. A
value 5 for the pressure step and 10 for window size means,
average values are calculated for every 5 dbar. Further, the
calculation of the average for the depth of 25 dbar is based on
values between 15 and 35 dbar. In this case, the graph is
If no input happened, the plot will be made by default settings.
In sbplot, different styles
for plots are provided. A detailed description for the options
cross-sectional plots, "Gitter" ,
XY-Plots and XYZ-Plots is given here.
Cross-sectional plots/"Gitter"After choosing "Schnitt"
or "Gitter" for plotsyle, it is necessary to select a variable to display. Further, you can
select between colored drawings with isolines (show picture), just colored without
isolines (show picture) or
black&white drawings(show picture).
If necessary, it is also possible
to modify the presentation
The variable for the y-axis of a cross-sectional plot is
allways pressure. The pressure values must be the same on all
input files (best is to average them into equally spaced values,
see data manupilations. For the
x-axis you can choose between cumulative distances between
stations, geographic latitude, geographic longitude and a time
A Gitter is considerably the same
than a cross-section, except the difference, the y-axis may vary
from pessure. So, another variable for the
y-axis can be selected. In this case, reference values must
be given in the matlab command window (for example, input of
[27:.02:28] will be good values for sigma-theta).
When all settings are done, the window will be closed by
. After the
data have been read, a new window opens, displaying the
geographic position and waterdepth of each station (show picture). If necessary, the values
can be corrected now. Otherwise, the window is closed by
. If after
having done some corrections, these are not readable (for example
letters or a comma instead of a decimal point) the mask will be
shown again with the unreadable fields marked in red. These fields must
then be corrected.
After this step, two another windows opens. On the right handed
side a preview of the plot, on
the left handed side a GUI (show
picture) to modify isolines and colors.
Now, different settings for colors, lines and ranges may be
tested. Selecting colors manually, it is important to know, that
white color means transparency. This is made, to allow to plot a
isoline, without changing the background color. By pressing
plot is redrawn in regard to the current settings. If the user is
content with the presentation, the menue isolines might be
closed by .
Now, in the remaining window (showing the plot), the
positions of the inscriptions of the isolines have to be given by
a mouse-klick. This work is finished by a mouse-klick in the gray
shaded area around the plot or a [Enter] in the matlab command
window. Afterwards, in case of a cross-section plot, the bottom
contour will be drawn, before, in any case, a colorbar is added
and the plot is finished.
If the presentation is not
representing your expectations, it might be caused by several
frequently mistakes or you have to
modify the presentation
afterwards (adding labels etc.).
XY-PlotsXY-Plots often are simple profiles (pressure on
y-axis) (show picture), diagrams
of potential temperature versus salinity (show picture) or simmilar drawings. In this
case, you can chose a variable for the x-axis as well as for the
y-axis. In both cases, the GUI to select a
After closing the sbplot-GUI, another window opens
(show picture) to select
style, size and color of markers, representing the stations.
date were read and displayed.
As said for cross-section plots, it is possible, that the plot is
not representing your expectations. This might be caused by
several frequently mistakes or you have
to modify the presentation
afterwards (adding labels etc.).
XYZ-PlotsXYZ-Plots are three-dimensional illustrations
of several parameters. It is less used to display the
three-dimensional distribution in space of one parameter then to
analyze dependencies of two parameters in regard to a third one.
Those ilustrations are very special. Therefore, a further
description will not be given.
After pushing the button with the
variablename of the current setting, a window opens (show picture) with several parameters
to select. If the desired parameter does not exist in the
datafiles (for example oxygen) or a parameter which may
not be calculated by the measured ones (for example
AOU=apparent oxygen utilisation, when oxygen has
not been measured), the datafiles will be read but no data will
a new window opens (show
picture) displaying those parameters, which are provided by
the current datafile. The variable to be displayed can be
selected out of that list.
Most variablennames are self-explanatory. Concerning density,
values for sigma-theta, sigma-1, sigma-2, etc. may be selected,
corresponding to the potential density-1000, at 0,1000,2000,...
dbar . AOU is the Apparent Oxygen Utilization, N**2 the
Brunt-Väisälä frequenzy, P-Pmax the difference in pressure in
regard to the maximum pressure (for a better presentation of the
bottom layer from the denmarkoverflow).
Reading the datafiles, it may occur, that even standard
parameters (pressure, salinity, etc.) may not be found. Then, a
window opens (show picture) and
the name for this standard parameter in the current datafile is
asked for. If any variablename is fitting the standard parameter
is listed, button has to be selected. The
results to that procedure were stored in a global variable and
thus available for the folowing datafiles.
Modify isolines and colors [back]In this mask (show picture), settings concerning
isolines, schading colors etc. may be done. For colored
illustrations (show picture)
the color of the inscriptions to the isolines can be set. After
pressing the matlab-tool for selection
of colors (show picture) opens.
The text of the button is representing the
current setting. The background color of the button is
unimportant. In field isolines detailed information about
isolines may be given in matlab notation (for example
[0:3:30],but not more than 40 values). Pressing [ENTER], these
values are found in the upper part of this window. On the right
handed side, different colormaps may be selected. The choice is
applied to the isolines immediately (show picture). The properties of
the isolines (value, shading and linestyle) may also be modified
manually (show picture).
The result of the input given in the example is shown here. Each time when pushing , the current
settings were applied to the plot and the preview is refreshed up. The menue for
modifying iolines and colors is finished by pressing . The current
preview became valid for the presentation.
For black&white-plots (show
picture), the isolines may be defined in the same way as
described for colored figures. It is possible to declare all
isolines in matlab notation as well as to edit each isoline in
regard to value, linestyle (solid, dotted, dashed, dashdot) and
all sorts of sources to do mistakes, but only the most frequently
occuring are discussed here:
- Datafiles can't be found in path-mode because the
directoryname does not end with a slash! In this case, sbplot
looks for /dataSB001.dat instead of /data/SB001.dat.
- Drawing a cross-section, the plot is completely or
partially painted black. As a matter of principle, this is
correct, because the bottom topography should be plotted. This
is done by reading the waterdepth out of the header files. For
this reason, it is important that the informations of the
header file do correspond to the maximum pressure of a station.
If the header files provide wrong values, it is possible to
correct them in the window.
Another posibility is to go without bottom topograpy. To do
this, you have to choose "gitter" and take pressure as
- It is suspicious, if the colored area is smaller than the
space given by the axes. This may point to wrong values for
position or even the information for position is badly
analysed. This may be caused by missing or wrong signs, values
set to zero or missing or wrong interpreted nautical minutes
because of using a comma instead of a decimal point. For this
reason again, it is important to fill out the header
- Non colored areas in a colored cross-section indicate
missing data. In this case you should examine, if the data have
been recorded down to the bottom.
- Sometimes, the presentation of isolines on strong inclined
topography is wrong. This is caused by a faulty extrapolation
of data to this area. On the other hand, this extrapolation is
needed, to avoid unsightly non-colored areas next to the
topography. If you are interested in displaying especially
layers next to the bottom, it might be better to use "gitter"
for your presentation, with variable Pmax-P for the
After drawing a plot,
the data which have been used are stored in a variable "P".
The most used features to improve a presentation and how they
are used is described here.
- As long as variable "P" has not been cleared or changed,
you may do several plots of this data without reading them
again and again. This can be done entering mk4ins(P) in
the matlab command window.
- To draw aditional non-colored isolinies over a colored
cross-section, enter mk4ins(P,[0.005 0.015],2,,1) in
the matlab command. In this synthax, the second parameter gives
the values for the desired isoline(s). The third has to be set
to "2" meaning "no-colored". The fourth is empty and must be
set in the way "". The fifth parameter must be set to "1" to
care for plotting the isolines over an existing plot. (further
information on mk4ins is given by help mk4ins in the
- Inscriptions: whith title('TEXT'),
xlabel('TEXT') and ylabel('TEXT') the text of
title and labels may be changed.
- To show smaller parts of the plot, you can change the
maximum and minimum values of the axes with the command
axis([440 580 0 2000]). Another possibility is to do an
interactive selection either with the command zoom on or
with the button in the menubar.
- With command axis you can switch between y-axis in
ascending order (axis('xy')) or descending order
- Manipulations of single graphical elements of the plot may
also be done by the editing-tool in the figures menubar.
- A mark for the positions of the stations you get with the
command plot(P.X,27.7,'rh','markersize',15). In this
case, along y=27.7, the positions of the stations are marked
with a bigger red hexagon.
Further matlab routines created especially
to work with SeaBird data are:
Last modified: Fri Mar 5 18:17:04 CET 2004