varinfo - Returns information about a variable's attributes

SYNOPSIS

varinfo  [ parameter=value ]  [ inputfile ... ]

Parameters are: var_name, attr_name, attr_value.

DESCRIPTION

varinfo retrieves and reports specific information about a variable attribute from one or more datasets (datasets). The attribute may be a built-in or user-defined attribute. The information that can be reported depends on whether the attribute is built-in or not (see datasets for discussion on built-in attributes). If the variable attribute is built-in, then only the value of the attribute can be reported. If the attribute is not built-in, then any of the the following characteristics for the attribute can be reported: attribute type, size, units or value. Only one these characteristics can be reported per call to varinfo. The information is written to standard output.

varinfo is designed to be used in shell scripts that provide post-processing for datasets, but can be used on the command-line as well.

PARAMETERS

var_name

Specifies the variable name of the attribute to report information on.

There is no default.

attr_name

Specifies the name of the attribute and, by default, causes the attribute's value(s) to be reported.

Valid names are [units, type, badval, usemin, usemax, scale, offset, size or any user-defined variable attribute name]. There is no default. The built-in attribute size refers to the list of variable dimension sizes.

attr_value

OPTIONAL. Allows the specification of an alternative attribute characteristic to be output. For built-in attributes, only the value can be output.

Valid options are [value, type, units, length]. The default is value.

EXAMPLES

Use in shell scripts as follows:

X = `varinfo var_name=avhrr_ch2 attr_name=units myfile`
if ($X == 'counts')  ...

Y = `varinfo var_name=myvar attr_name=specialatt attr_value=units myfile`
if ($Y == 'counts')  ...

Z = `varinfo var_name=avhrr_ch2 attr_name=size myfile`
echo avhrr_ch2 has $#Z dimensions
echo avhrr_ch2 leading dimension is $Z[1]


Use On the command line as follows:

% varinfo var_name=avhrr_ch2 attr_name=scale myfile
1
% varinfo var_name=x attr_name=myatt myfile
1.5
% varinfo var_name=x attr_name=myatt attr_value=units myfile
celsius
% varinfo var_name=x attr_name=myatt attr_value=type myfile
long
% varinfo var_name=x attr_name=myatt attr_value=length myfile
1

SEE ALSO

datasets, editvar, formats, passinfo, setattr, getinfo


Last Update: $Date: 1998/05/29 20:58:38 $