DATAMANIP commands


PROGRAM NAME

kmag - Output is a Function of the Magnitude of the Input

DESCRIPTION

The Magnitudes operator returns the selected calculation of the magnitude of each data point in the input data object, Input. The user can specify one of six methods for calculating the magnitude output, where Log is the logarithm, base 10. (If the input data is not complex, the imaginary component is assumed to be zero.)
(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.

Executing Magnitudes runs the program kcmplx2real with the -om output option.

REQUIRED ARGUMENTS

-i
type: infile
desc: Input data object

OPTIONAL ARGUMENTS

-om
type: outfile
desc: Output data object containing magnitude of input
default: {none}

Mutually Exclusive Group; if desired, specify ONE of:

-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): log(real*real + imag*imag)

EXAMPLES

SEE ALSO

DATAMANIP::kcmplx2real, DATAMANIP::kcmplx, DATAMANIP::kreal2cmplx

RESTRICTIONS

REFERENCES

COPYRIGHT

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