DATAMANIP commands


PROGRAM NAME

kcmplx2real - Output = Real, Imaginary, Phase, or Magnitude Component of Input

DESCRIPTION

Complex Conversion (kcmplx2real) performs simple mappings of complex data to real form. The complex input object is transformed into real output objects via four methods: (If the input data is not complex, the imaginary component is assumed to be zero.)

Real Output Assign the real part of the input to the output data object (or).

Imaginary Output Assign the imaginary part of the input to the output data object (oi).

Phase Output Assign the phase of the input to the output data object (op).

Magnitude Output Assign the magnitude of the input to the output data object (om). The user can specify one of six methods for calculating the magnitude output, where Log is the logarithm, base 10.

(mag)
Magnitude = sqrt(real * real + imaginary * imaginary)

(logmag1)
Log (Magnitude + 1)

(logmag)
Log (Magnitude)

(magsq)
Magnitude Squared

(logmagsq1)
Log (Magnitude Squared + 1)

(logmagsq)
Log (Magnitude Squared)

The output object data type will be the same as the input (regarding single or double floats).

Map Data If the input object contains a map, then the operation is performed on the map data. If the input object does not have a map but has value data, then the operation is performed on the value data.

Validity Mask If there is a validity mask associated with the input object, the mask is transferred to the output object. To decrease processing time, the operation will still be performed on those data that have corresponding mask values equal to zero. If the data under the mask is genuinely fInotfP processable, such as NaN or infinity, the user can specify that a value be substituted in place of the original value when it is accessed. The masked data substitution attributes for a data object can be explicitly set and stored using the fISet AttributefP operator, DATAMANIP::ksetdattr.

Explicit Location and Time Data If the input object has time data or location data, it is transferred to the output object.

Failure Modes This program fails if the input object lacks both map data and value data.

REQUIRED ARGUMENTS

-i
type: infile
desc: Input data object

Group; you must specify AT LEAST ONE of:

-or
type: outfile
desc: Output data object containing REAL component of input
default: {none}
AND/OR
-oi
type: outfile
desc: Output data object containing imaginary component of input
default: {none}
AND/OR
-op
type: outfile
desc: Output data object containing phase of input
default: {none}
AND/OR
-om
type: outfile
desc: Output data object containing magnitude of input
default: {none}
AND/OR

ONE OF the Mutually Exclusive Group:

-mag
type: flag
desc: Magnitude = sqrt(real*real + imag*imag)
OR
-magsq
type: flag
desc: Magnitude Squared = real*real + imag*imag
OR
-logmag1
type: flag
desc: Log(Magnitude+1) = log(sqrt(real*real + imag*imag)+1)
OR
-logmagsq1
type: flag
desc: Log(Magnitude Squared+1) = log(real*real+imag*imag+1)
OR
-logmag
type: flag
desc: Log(Magnitude) = log(sqrt(real*real + imag*imag))
OR
-logmagsq
type: flag
desc: Log(Magnitude Squared) = log(real*real + imag*imag)

OPTIONAL ARGUMENTS

none

EXAMPLES

SEE ALSO

kcmplx, kreal2cmplx

RESTRICTIONS

REFERENCES

COPYRIGHT

Copyright (C) 1993 - 1997, Khoral Research, Inc. ("KRI") All rights reserved.