PRITS_TOOLS::CHECK_EQUALITY - ITA-Solar/solo-spice-ql GitHub Wiki

Source code: prits_tools__check_equality.pro

Class: PRITS_TOOLS

Description

Checks if a variable is equal to another variable. The variable may be an array, in that case the output is also an array of same size of type byte. This function can also perform the check if the reference variable is not a finite number. A tolerance value can be provided by which the variable may maximally differ from the reference value and still be considered equal.

YOU MAY BE BETTER SERVED BY USING THE FUNCTIONS: WHERE_MISSING, WHERE_NOT_MISSING, IS_MISSING, IS_NOT_MISSING because those are already in the 'gen' branch of solarsoft. But those are less flexible.

Syntax

equal = PRITS_TOOLS::CHECK_EQUALITY ( VARIABLE, REFERENCE_VALUE [, TOLERANCE=TOLERANCE] [, /NANorINF] [, /SIGN] )

Return value

Boolean. True if the variable is the same, False otherwise. If input variable is an array the output is also an array of same size of type byte.

Arguments

VARIABLE

The variable to be checked against the reference_value.

REFERENCE_VALUE

The reference value that the variable shold be checked against. This may also be +/-NAN or +/-INF.

Optional Input

TOLERANCE

A value that the variable may maximally differ from the reference value and still be considered to be equal. This keyword is ignored if NANorINF is set.

Keywords

NANorINF

If set, then the output is only True if the variable is of the same infinite type (NAN or INF) than the reference variable.

SIGN

If set, then the output is only True if the variable has the same sign (+ or -) as the reference variable. This keyword is ignored if NANorINF is not set.