oph_cast

Description

Behaviour

It converts the measure array value type from input to output type. Possible conversions are:

  • (oph_byte, oph_short, oph_int, oph_long, oph_float, oph_double) <-> (oph_byte, oph_short, oph_int, oph_long, oph_float, oph_double);
  • (oph_byte, oph_short, oph_int, oph_long, oph_float, oph_double) -> (oph_complex_int, oph_complex_long, oph_complex_float, oph_complex_double);
  • (oph_complex_int, oph_complex_long, oph_complex_float, oph_complex_double) -> (oph_complex_int, oph_complex_long, oph_complex_float, oph_complex_double).

With conversion from real to complex numbers, it adds imaginary parts as 0 while, in case of complex numbers -> real numbers, it returns an error.

Parameters

  • input measure type: Ophidia typing. Supported types are: ‘oph_double’ ‘oph_float’ ‘oph_int’ ‘oph_long’ ‘oph_short’ ‘oph_byte’ ‘oph_complex_double’ ‘oph_complex_float’ ‘oph_complex_int’ ‘oph_complex_long’.
  • output measure type: Ophidia typing. Supported types are: ‘oph_double’ ‘oph_float’ ‘oph_int’ ‘oph_long’ ‘oph_short’ ‘oph_byte’ ‘oph_complex_double’ ‘oph_complex_float’ ‘oph_complex_int’ ‘oph_complex_long’.
  • measure: input measure.
  • missingvalue : value to be considered as missing value in input data; by default it is NAN (for “oph_doubl” and “oph_float”).
  • output_missingvalue : value to be considered as missing value in output data; by default it is NAN (for “oph_double” and “oph_float”).

Return type

Binary-array.

Examples

Cast an array of measures from oph_double to oph_complex_int.

oph_cast('OPH_DOUBLE','OPH_COMPLEX_INT',measure)

Operation type

Simple.

Arguments

Argument name Type Mandatory Values Default Min/Max-value Min/Max-times
input measure type “oph_type” “yes” “‘oph_double’|’oph_float’|’oph_int’|’oph_byte’|’oph_short’|’oph_long’|’oph_ complex_double’|’oph_complex_float’|’oph_complex_int’|’oph_complex_long’”     “1” / “1”
output measure type “oph_type” “yes” “‘oph_double’|’oph_float’|’oph_int’|’oph_byte’|’oph_short’|’oph_long’|’oph_ complex_double’|’oph_complex_float’|’oph_complex_int’|’oph_complex_long’”     “1” / “1”
measure “binary-array” “yes”       “1” / “1”
missingvalue “double” “no” “NAN”     “0” / “1”
output_missingvalue “double” “no” “NAN”     “0” / “1”