getval [ parameter=value ... ] [ inputfile ... ]
Parameters are: include_vars, dim_indices, annotate, printout, convert_hemis.
getval prints the value of one or more variables at the point specified by the dimension indices dim_indices. This function can be used to extract from one or more datasets, the value(s) of one or more variables, at the same point for easy comparison. With annotate turned off, getval can also be useful inside shell processing scripts.
All variables to be printed must have the same dimensions.
List of variables to print values for. If the list is preceded by a minus sign, all variables except those listed will be printed. Wildcards * and ? are allowed.
The default is to print all variables.
Specifies the dimension indices for the point to be printed. The number of values must correspond to the number of dimensions for the variable(s), and the indices are specified as 1-relative coordinates.
There is no default.
If annotate=yes, then the variable values are annotated with the corresponding variable and file names, otherwise this information is suppressed.
Valid responses are [yes or no]. The default is [yes].
Specifies that output be directed to the printer, as opposed to the screen. Valid responses are [yes or no]. The default is [no].
[OPTIONAL] If convert_hemis=yes, then variables with units std_latitude or std_longtiude are converted to a format suitable for input to the master family of commands (e.g., -27.5 is output as 27.5s).
Valid responses are [yes or no]. The default is [yes].
This example shows the outputs from getval for the cases when annotate is turned on and off. The dataset, test.tdf, has two variables x and y, each of which are dimensioned 12x27x45. The second example shows how getval might be used in a script.
% getval test.tdf
include_vars : char(255) ? [] x y
dim_indices : int ( 5) ? 4 16 20
annotate : char( 3) ? [yes] y
printout : char( 3) ? [no]
Getval test.tdf
x y
0.0013 0.0054
%
% set xyvals = (`getval include_vars='x y' dim_indices='4 16 20'
annotate=n printout=n test.tdf`)
% echo $xyvals
0.0013 0.0054
%
Note: the above command must be typed all on "one" line, a "\\" continuation character will result in an undesirable parsing of the command line.
getinfo, getdim, printvar, master, passinfo, varinfo, formats.
Last Update: $Date: 1999/05/10 20:14:05 $