convec - Converts components of 2-D vector to a different type and stores them as new variables into the same dataset.

SYNOPSIS

convec  [ parameter=value ... ]  [ inputfile ... ]

Parameters are: in/out_varsin/out_types, from_dir, distance_units.

DESCRIPTION

The function convec converts components of 2-D vector to a different type and appends them as two new variables to the input dataset. The input vector components must be presented in the dataset as two parallel variables. The converted vector components will be presented as two output variables, parallel to the input ones. If the output variables already exist, their values will be overwritten. The input and output vectors' types must be different. The "northeast", "magphase", and "latlon" vector types are currently supported. convec, essentially, converts vectors from "magphase" to "northeast" type and visa versa. Or, convec converts from delta latitude (degrees) and delta longitude (degrees) to either "northeast" or "magphase". In all cases, the function convec also creates the complex vector variable that combines "north" and "east" variables into one.

In order convert delta latitude and delta longitude to distance, the input dataset must explicitly contain latitude and longitude variables. These variables are assumed to define the origin of the vectors. The delta latitude and delta longitude variables define the length and direction of the vectors.

PARAMETERS

in/out_vars

These are the two pairs of in- and out-vector components and one complex out-vector, specified as in_comp_1 in_comp_2 out_comp_1 out_comp_2 out_complex. All existing output variables will be overwritten.

Valid responses are any 5 names, where the first two specify the existing variables. There is no default.

in/out_types

The in- and out-vector types can be "northeast" or "magphase". Vector of "northeast" type is specified by its north and east components. Vector of "magphase" type is specified by its magnitude and angle measured clockwise from the north direction.

Valid responses are [northeast magphase] or [magphase northeast] or [latlon northeast] or [latlon magphase]. There is no default.

from_dir

OPTIONAL. If from_dir=yes, then vector direction is assumed to be 'from' rather than 'to'. For example, if from_dir=yes, (north, east) coordinates (1,0)
correspond to an angle of 180 degrees; the vector is treated as it were coming 'from' (-1,0), rather than going 'to' (1,0) . If from_dir=no, (north, east) coordinates (1,0) correspond to an angle of 0 degrees. The default is  from_dir=yes, which is most appropriate when working with wind vectors; e.g., a north wind blows from the north.

distance_units

OPTIONAL. This parameter is used only if the input type is latlon. Valid responses are meters and kilometers. The default response is kilometers.

EXAMPLES

In the example below the input is the TeraScan dataset with the TOVS data. The wind parameters have the "magphase" type. convec converts them to the "northeast" type and appends to the input dataset.

lapaz% convec
input file     : char(255) ? n12.93354.1624.t
in/out vars    : char(255) ? wind_speed wind_dir wind_north wind_east wind_vector
in/out_types   : char( 19) ? magphase northeast
lapaz%

SEE ALSO

vectors


Last Update: $Date: 2002/05/07 23:50:45 $