<<<<<<<<<<<<<<<<<

cdf_extract_scalar(netcdf) VISAGE I/O" cdf_extract_scalar(netcdf)

NAME

cdf_extract_scalar - extract data from netCDF file and place into data set

DESCRIPTION

The cdf_extract_scalar object extracts data from a netCDF file as a visage_scalar, and then creates a data set with the visage_scalar as the scalar data. This data set can then be combined with others data sets (using merge_data_sets filter) for further processing.

An important feature of this object is specifying selection criterion for extracting data from the netCDF file. The message is "selection=(var_name, dim_id,start,end, dim_id,start,end, ...)" where var_name is the name of a netCDF variable. If var_name is a n-dimensional variable, any portion of its data can be extracted using combinations of the selection indices dim_id,start,end. Dim_id refers to the dimension id (1,2,...,n), start refers to the starting value for this dimension, and end refers to the ending value for this dimension. Selection indices need not be specified for each dimension: if not specified for some dim_id the indices start and end are set to (1,1).

NOTE: See cdf_extract_data man page for additional information.

SUPERCLASS

cdf_extract_data

INSTANCE VARIABLES

(none - inherited from superclass)

MESSAGES

read! reads netCDF file, extracts hyperslab as scalar, and creates data set in its data_out.

selection= (var_name, dim_id,start,end, dim_id,start,end, ...) Set the selection list for extracting scalar.

selection? return the value of the current selection list for extracting scalar.

EXAMPLE

Data is extracted from netCDF file as separate unstructured point set geometry, scalar, and vector. The merge_data_sets filter is used to paste them together to form a single data set.

/*

* Scripts tests the cdf_extract_data objects */ /* * For scalar extract portion of y-components of velocity data * (second time step) */ scalar new: no_pts = 10; /* set size of data to extract */

cdf_extract_scalar new: scalar_reader filename=`test.cdf' selection=(velocity, 1,2,2, 2,1,no_pts, 3,2,2) ;

/* * Extract third time step of velocity data */ cdf_extract_vector new: vector_reader filename=`test.cdf' vx_selection=(velocity, 1,3,3, 2,1,no_pts, 3,1,1) vy_selection=(velocity, 1,3,3, 2,1,no_pts, 3,2,2) vz_selection=(velocity, 1,3,3, 2,1,no_pts, 3,3,3) ;

/* * Extract first time step of pressure for x-axis; second time step * of velocity z-component for y-axis; points (i.e., * test_grid) y coordinates for z-axis */ cdf_extract_unstructured_points new: geom_reader filename=`test.cdf' x_selection=(pressure, 1,1,1, 2,1,no_pts, 3,1,1) /* default 3,1,1 */ y_selection=(velocity, 1,2,2, 2,1,no_pts, 3,3,3) z_selection=(test_grid, 1,1,no_pts, 2,2,2) ;

merge_data_sets new: merge data_in= (geom_reader, scalar_reader, vector_reader) output! ;

SEE ALSO

cdf_reader, cdf_extract_data, cdf_extract_vector, cdf_extract_unstructured_points


Please send comments and suggestions to
consult@rpi.edu