Data manipulation
This module discusses the basic tools that NCL provides for
manipulating data. This section is somewhat all-inclusive since a good
part of what NCL is designed to do is manipulate data.
NCL contains several functions and procedures for importing and
exporting data in binary, ASCII, netCDF and HDF formats. See the
module
Importing and exporting data for details on
this.
NCL contains a function for sorting singly-dimensioned numeric arrays
qsort and one for
sorting string arrays, sqsort. Also
available are
rand and
srand for generating
random numbers.
NCL contains all of the standard trig functions as well as several other
useful
math functions.
You can add data objects to plots using the NCL function
NhlAddData and
you can remove data objects using the NCL procedure
NhlRemoveData.
In addition to the NCL procedures
NhlDataToNDC and
NhlNDCToData for
converting user data to and from
Normalized Device Coordinates,
there exists every imaginable
function for converting between data types.
Any of the basic NCL metadata, algebraic, logical, relational, or
assignment
operators
can be used to manipulate data.
One of the most valuable features of NCL is its ease of processing
array data.
Most of the basic operators can be applied to arrays.
Also, array subsections are easily extracted and processed, and it
is easy to rearrange array data and create new arrays from existing
arrays.
The NCL
flow control statements
are useful in manipulating data. Defining your own
procedures
can be useful as well.
Almost any of the NCL examples available in the
Quick Start Guide
will illustrate NCL data manipulation. The example
xy14n.ncl
is specifically designed to illustrate the basic data manipulation
tools.
User Guide Control Panel
NG4.1 Home, Index, Examples, Glossary, Feedback, UG Contents, UG WhereAmI?
$Revision: 1.6 $ $Date: 1998/06/15 22:08:48 $