COMPARE

From ICE Enterprises
Jump to navigation Jump to search

compare two data files or one file with zero

<IN1>      First input file
<IN2>      Second input file (optional)
<MAX_OUT>  Optional results parameter with maximum difference value
<MIN_OUT>  Optional results parameter with minimum difference value
<MAX_THR>  Optional threshold below which maximum difference should fall
<MIN_THR>  Optional threshold above which minimum difference should fall
<RESULT>   Optional result label, set to 1 if diff w/in thresholds, 0 if not

COMPARE differences of two input files and outputs the max/min of the difference
if the /VERBOSE switch is used. If only the first input file is given, the
results are compared to zero, and essentially the result is similar to the
MAXMIN command.

The maximum and minimum values of the difference are (optionally) saved in
results parameters.

If RESULT is given, the max and min are compared to MAX_THR and MIN_THR
respectively; the parameter set by RESULT becomes 1 if they are within the
threshold bounds, 0 otherwise.  The thresholds default to +-1E-9.

Since NeXtMidas 2.9.2, support for record base files (type 3000, 5000, and 6000)
was added. Only numeric SubRecords are compared. When running from terminal, a
message will be printed out for any SubRecords that are not numeric unless the
/VERBOSE=FALSE switch is specified. When comparing two record based files that
do not have exactly the same SubRecords (names, types, etc.), this command will
error with appropriate message. Likewise when comparing record base data to
frame based data (type 1000, 2000).

Examples:
  1. Compare a file with zero (max, min)
    nM> WAVEFORM,OUT=TEMP3,FORM=SF,ELEM=100,SHAPE=SIN,AMP=3,FREQ=.01
    nM> COMPARE TEMP3
    INFO: Diff MAX = 3.0 [COMPARE]
    INFO: Diff MIN = -3.000001 [COMPARE]
    INFO: Diff within THRESHOLDS = 0 [COMPARE]

  2. Compare above file with a new file with different amplitude
    nM> WAVEFORM,OUT=temp1,FORM=SF,ELEM=100,SHAPE=SIN,AMP=1,FREQ=.01
    nM> compare temp1 temp3 MAX_OUT=max MIN_OUT=min result=withinThreshold

    the results min and max hold the answers.
      F: MAX             = 2.0000005
      F: MIN             = -2.0000021
      L: WITHINTHRESHOLD = 0

  3. Compare two type 3000 files (record based data) with same values
    nM> compare test3000_ieee.prm test3000_eeei.prm
    INFO: Diff MAX = 0.0 [COMPARE]
    INFO: Diff MIN = 0.0 [COMPARE]
    INFO: Diff within THRESHOLDS = 1 [COMPARE]

  4. Compare two type 5000 files (record based data) with very large thresholds
    nM> compare sv1.prm sv2.prm MAX_THR=3e7 MIN_THR=-2e7
    INFO: Diff MAX = 2.0299538E7 [COMPARE]
    INFO: Diff MIN = -1.5621862E7 [COMPARE]
    INFO: Diff within THRESHOLDS = 1 [COMPARE]

Switches:
  /LEGACYSCALE - DEPRECATED since NeXtMidas 2.9.2: Use deprecated max/min/full
                 scale values for byte and other data type (which does not match
                 data type's actual max/min/full scale values). [DEF=FALSE]
  /TL      - The number of elements to be read each process loop.
             [DEF=4096 for type 1000 or 1 for other file types]
  /VERBOSE - Force output to the screen if present. Default is to output to the
             screen if <MAX_OUT> and <MIN_OUT> are not given or when in terminal