Data manipulation

Introduction

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.

Importing and exporting 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.

Searching and sorting, random numbers

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.

Math functions

NCL contains all of the standard trig functions as well as several other useful math functions.

Data and plots

You can add data objects to plots using the NCL function NhlAddData and you can remove data objects using the NCL procedure NhlRemoveData.

Data conversion

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.

NCL operators

Any of the basic NCL metadata, algebraic, logical, relational, or assignment operators can be used to manipulate data.

Array processing

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.

Flow control and procedures

The NCL flow control statements are useful in manipulating data. Defining your own procedures can be useful as well.

Examples

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 $