Matlab GUI for NetCDF visualization
| intro | gui | tutorial | snapshots | download |
NCDView GUI:

Data Range and Graphics

NCDView is composed by several menus, pushbuttons,... and one axes
Let me start by describing this image at right

First notice that image is divided in four sections.
After loading a file and selecting one variable (explained bellow), in the first line of the first section will appear the name of the variable, its scale and offset.
In the case we have: h(1) x -1 + 0 ; variable(filenumber) * scale + offset. Variable is the selected variable from the loaded NetCDF file number filenumber.
Filenumber is increased per each file loaded.
Scale is the NetCDF attributescale_factor (1 if not present);
Offset is the NetCDF attribute add_offset (0 if not present).

The next line (where we read 360 280 ) appears the size of the variable if it is a N-D arrays, 1 < N < 4; for scalars the value will be shown.

Then we have four lines with seven buttons each. Each of the four lines correspond to one dimension of the variable. The three buttons in the meddle are the first index, the step and the last index of the dimension.
So in this case, if V if the whole variable, it will be extracted the portion: ( 222:20:222 , 1:1:280 , 1:1:1, 1:1:1 ) = (222,:)
The last button of each line shows the size of the variable. When pressed, the value on it will pass to the last index edit box.
The last button of each line show the dimension I, J, K and L. When pressed, the value 1 will pass to the first index edit box.
the pushbuttons < and > move the first and last index edit boxes step points backward and forward.

In the end of this first section there are the checkbox plot on load and the pushbutton display. If plot on load is selected, the variable is plotted automatically when it is loaded. Display always plots the chosen portion of the variable if this portion is 1-D or 2-D. So, to have plot on load selected is the same as load variable and press display without change any dimension index.

Then pressing < or > will call display automatically.
If you choose the indexes in such way that the extracted portion is a scalar, the value is shown in the second line (where is displayed the size of the variable)

No, lets see what happens if the extracted portion is 2-D.
In the second section of this images we have the buttons contour, pcolor and surf, pressing each, the corresponding 2-D plot is done. Each of these buttons has associated one checkbox.
Pressing display will produce the type of plot which checkbox is selected. After contour we have an edit box where contour values can be introduced. If length of data edited is more than one, then should be contour levels. After contour you can make labels with clabel.
After pcolor we have the caxis edit box; two numbers should be used to control caxis.
After surf we have the view angle edit box; two numbers should be used to control the view angle.
If the checkboxes at the right of caxis and view angle are selected, the new plots will use these values; if not, the values are updated.

Next part is about X and Y to in plots. We have four edit boxes; first, the of variable X, Y, the X range and the Y range.
In this case X is lon_rho(1). It means variable lon_rho from the file 1.
When edited, the corresponding range (full range) appears in the X range edit box. However, when display occurs, the range will be corrected to fit the range of the extracted variable.
If, however, you do not agree with the range shown, you can edit X and Y range edit boxes and select the associated checkbox to be sure the range you entered will be used. If everything is ok (X variable exists in the the file, and the range in use is in agreement with variable range) then a xlabel and ylabel is produced in the figure.
The aspect of the ranges is, as usual, (istart : istep : iend , ....).
To use X and Y, the associated checkbox should be selected.

In the third section we have the same as previous but for the case of vector data (ie, when the extracted portion of the variable is a vector, so only X is used).


Loading Files and Variables

The NCDView GUI starts with three menus. In the menu file, you can load NetCDF files by selecting load.
When this is done, several menus will be created according to the size of variables.
The last file loaded is the current one until other is selected in the menu file --> files. This will also create/update the variables menus.

Now, to load a file you just need to select it from the menus.
The other method is to edit the variable name in the first edit box (top left corner of the GUI and in the image at right).
Example: if you edit bathy you will use the variable bathy from the current file; if you edit bathy(3) you will use the variable bathy from the loaded file number 3.

When one variable is chosen its attributes are shown in the listbox shown in the bottom of the image above.
Next section explains how to use more than one variable for velocity fields


Velocity Fields

If you wanna see velocity fields with arrows, you must load two variables editing then as explained above.
Example: I have two files, first with variable uflx (u wind) and vflx (v wind); I load both files and write: uflx(1),vflx(2) (spaces and not important).
Everything happens as if only uflx was loaded - in terms of range, scale, offset, shown attributes - so variables u and v should have same size, scale and offset.


Menus

In this section, the menu misc is explained. It is show in the figure bellow

1 - colormap controls axes colormap
2 - shading controls axes shading (useful for pcolor and surf plots)
3 - material controls axes material (useful for surf plots)
4 - lighting controls axes light (useful for surf plots)
5 - color contours controls contours colors
6 - axis controls axis: normal, equal, auto
7 - gui size controls GUI size: this may be better than zoom the GUI window, because only the axes will be enlarged, not the uicontrols
8 - gui theme controls the GUI theme...
9 - fontSize controls the font size of pushbuttons, editboxes, ...
10 - overlay overlay WCL or lon-lat file.
WCL is the world coastline obtained from the Coastline Extractor site.
lon-lat is some mat file with the variables lon and lat.
You can also toogle between overlay once and always. In the case of always, a plot of the selected file is done at every display
11 - max var size controls the maximum size of a variable to be plotted. If size is bigger, a question to proceed will be made.
This can be useful in the situation: you have one variable with size 1500 x 300 x 300, being the first dimension the time index, and you want to make a pcolor of the variable for t=1 but you press the wrong > button; then a pcolor of a very big variable would be done, maybe taking some time and maybe without any meaning
8 - set limits fixes the the current xlim, ylim, zlim and DataAspectRatio by putting these values in the edit boxes of the GUI bottom right corner and selecting the associated checkboxes.
These edit boxes are updated at every display, but not when image is zoomed. So imagine, you plot a variable, make a zoom and wanna see the evolution of the zoomed portion... at the new display the axes would acquire the natural size, unless the limits checkboxes are selected.
NOTICE: To avoid resize of axes, set limits should be done, always you make a plot with axis equal, I mean, after first plot with axis equal, select set limits and then continue your plots with >, for instance
9 - axis >< opens dialog box where you can choose the dimensions for which automatic evolution will happen when > or < is pressed

Also is available a uiContextMenu for any vector plot (including the overlayed WCL or lon-lat data). It is shown below:
To use it, click with the mouse right button over the desired line.

home | tutorial >> MMA , Jun 2004     e-mail