ARTS built-in documentation server

Workspace Method CompareRelative

Description

Checks the consistency between two variables by their relative values.

The two variables are checked to not deviate outside the specified
relative value (*maxabsreldiff*). An error is issued if this is not
fulfilled.

The main application of this method is to be part of the test
control files, and then used to check that a calculated value
is consistent with an old, reference, value.

If either value is 0.0, the relative error is considered as 0
for easier use.  This really means infinite differences, though
allowing zero-crossings is useful for plenty of tests. So Be Aware!

If both *var1* and *var2* are non-zero, the difference is evaluated
as: abs(var1/var2-1)
That is, *var2* is taken as the reference value.

Authors: Oliver Lemke, Richard Larsson

Synopsis

CompareRelative( var1, var2, maxabsreldiff, error_message )

Variables

GINvar1(Numeric, Vector, Matrix, Tensor3, Tensor4, Tensor5, Tensor6, Tensor7, ArrayOfVector, ArrayOfMatrix, ArrayOfTensor3, ArrayOfTensor4, ArrayOfTensor6, ArrayOfTensor7, ArrayOfArrayOfVector, ArrayOfArrayOfMatrix, ArrayOfArrayOfTensor3, ArrayOfArrayOfTensor6, ArrayOfPropagationMatrix, ArrayOfArrayOfPropagationMatrix, ArrayOfStokesVector, ArrayOfArrayOfStokesVector, EnergyLevelMap)A first variable
GINvar2(Numeric, Vector, Matrix, Tensor3, Tensor4, Tensor5, Tensor6, Tensor7, ArrayOfVector, ArrayOfMatrix, ArrayOfTensor3, ArrayOfTensor4, ArrayOfTensor6, ArrayOfTensor7, ArrayOfArrayOfVector, ArrayOfArrayOfMatrix, ArrayOfArrayOfTensor3, ArrayOfArrayOfTensor6, ArrayOfPropagationMatrix, ArrayOfArrayOfPropagationMatrix, ArrayOfStokesVector, ArrayOfArrayOfStokesVector, EnergyLevelMap)A second variable
GINmaxabsreldiff(Numeric)Threshold for maximum relative difference.
GINerror_message(String, Default: "")Additional error message.