### COMPLEX

Converts between representations of complex data

#### Description:

This application converts between various representations of complex data, including complex NDFs . The conversion may simply unpack or pack real and imaginary parts of a complex NDF, or it may convert between polar and Cartesian representation.

#### Usage:

complex in1 in2 out1 out2 [intype] [outtype]

#### Parameters:

The first input NDF. See Parameter INTYPE for its description.
The second input NDF. See Parameter INTYPE for its description. IN2 will not be accessed when Parameter INTYPE is set to "COMPLEX". When Parameter INTYPE is set to "MOD_ARG", supply a null (!) value.
The nature of the input NDF(s). The allowed options are listed below.
• "COMPLEX" – IN1 is a complex NDF containing real and imaginary parts. (IN2 will not be accessed.)

• "REAL_IMAG" – IN1 contains the real part and IN2 contains the imaginary parts.

• "MOD_ARG" – IN1 contains the modulus and IN2 the argument in radians.

The default is"COMPLEX" if IN1 is a complex NDF, otherwise it is "REAL_IMAG". []

##### OUT1 = NDF (Write)
The first output NDF. Its contents are governed by Parameter OUTTYPE.
##### OUT2 = NDF (Write)
The second output NDF. Its contents are governed by Parameter OUTTYPE. OUT2 will not be accessed when Parameter OUTTYPE is set to "COMPLEX". When Parameter OUTTYPE is set to "MOD_ARG", supply a null (!) value.
The nature of the output NDF(s). The same options are available as for INTYPE, but relate to NDFs OUT1 and OUT instead of IN1 and IN2.

The default is "REAL_IMAG" if IN1 is a complex NDF, otherwise it is "COMPLEX". []

The title for the first output NDF.
The title for the second output NDF.

#### Results Parameters

##### CALCMODE = LITERAL (Write)
Set to indicate the type of calculation that was performed: "To polar" , "From polar" or "None".

#### Examples:

complex realmap imagmap cmplxmap
This example combines real and imaginary parts into a complex NDF.
complex cplxmap ! modulusmap ! OUTTYPE=MOD_ARG
This example would compute the modulus from a complex NDF.

#### Implementation Status:

• This routine correctly processes the AXIS, DATA, QUALITY, LABEL, TITLE, UNITS, WCS, and HISTORY  components of the first input NDF and propagates all of that NDF’s extensions. UNITS is set to "radians" for OUTTYPE = "MOD_ARG".

• The DATA component is processed in double precision. The output NDFs have type _DOUBLE, except when OUTTYPE ="COMPLEX" where it is COMPLEX_DOUBLE.