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.
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.
/*
* 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! ;