oph_predicate

Description

Behaviour

It evaluates a predicate. For each item of input array, if ‘expression0’ satisfies ‘comparison’, then ‘expression1’ is executed, else ‘expression2’ is executed.

Parameters

  • input measure type: Ophidia typing. Supported types are: ‘oph_double’; ‘oph_float’; ‘oph_long’; ‘oph_int’; ‘oph_short’; ‘oph_byte’.
  • output measure type: Ophidia typing. Supported types are: ‘oph_double’; ‘oph_float’; ‘oph_long’; ‘oph_int’; ‘oph_short’; ‘oph_byte’.
  • measure: input measure.
  • expression 0: first expression.
  • comparison: condition to be verified. Only one of the following values are allowed:
    • ‘OPH_MORE_THAN_ZERO’, ‘OPH_POSITIVE’, ‘>0’ or ‘>’ in case expression 1 has to evaluated only if input value is positive;
    • ‘OPH_LESS_THAN_ZERO’, ‘OPH_NEGATIVE’, ‘<0’ or ‘<’ in case expression 1 has to evaluated only if input value is negative;
    • ‘OPH_EQUAL_TO_ZERO’, ‘OPH_ZERO’, ‘==0’ or ‘0’ in case expression 1 has to evaluated only if input value is zero;
    • ‘OPH_MORE_OR_EQUAL_TO_ZERO’, ‘OPH_NOT_NEGATIVE’, ‘>=0’ or ‘>=’ in case expression 1 has to evaluated only if input value is not negative;
    • ‘OPH_LESS_OR_EQUAL_TO_ZERO’, ‘OPH_NOT_POSITIVE’, ‘<=0’ or ‘<=’ in case expression 1 has to evaluated only if input value is not positive;
    • ‘OPH_NOT_EQUAL_TO_ZERO’, ‘OPH_NOT_ZERO’, ‘!=0’, ‘!=’, ‘<>0’ or ‘<>’ in case expression 1 has to evaluated only if input value is not zero;
    • ‘OPH_NULL’, ‘NULL’, ‘NAN’, ‘MISSED’, ‘MISS’, ‘ISNULL’, ‘ISNAN’ or ‘ISMISSED’ in case expression 1 has to evaluated only for missing values.
  • expression 1: expression executed if expression 0 satisfies comparison.
  • expression 2: expression executed if expression 0 does not satisfy comparison.

Return type

Binary-array.

Examples

Identify measures with temperature values greater than 300 K.

oph_predicate('OPH_DOUBLE','OPH_DOUBLE',measure,'x-300','>0','1','0')

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_long’|’oph_short’|’oph_byte’”     “1” / “1”
output measure type “oph_type” “yes” “‘oph_double’|’oph_float’|’oph_int’|’oph_long’|’oph_short’|’oph_byte’”     “1” / “1”
measure “binary-array” “yes”       “1” / “1”
expression 0 “string” “yes”       “1” / “1”
comparison “string” “yes”       “1” / “1”
expression 1 “string” “yes”       “1” / “1”
expression 2 “string” “yes”       “1” / “1”