compareFields.py

This analyzer compares fields and outputs the difference field. Example uses include evaluating the evolution of a field with time, or looking at the change in a field as a function of some other parameter in the input file, or looking at the difference between two quantities.

-s <simname>, --simulationName=<simname>

(string, required)

<simname> is the name of the simulation to be analyzed. The file extension should NOT be included in this text field.

-F <refFldName>, --fieldName=<refFldName>

(string, required, default = E)

<refFldName> is the name of the reference field, for example, E.

-D <targetFld>, --targetField=<targetFld>

(string, required, default = emPlaneWaveT_E_2.h5)

<targetFld> specifies a target field to compare with. Slightly different behaviour will result depending on the contents of this input field.

  • If <targetFld> is a whole name of a file in the present directory, then all time dumps of field <refFldName> will be compared with <targetFld>. This allows for comparison of time dependent behaviour.
  • If <targetFld> is a directory path, then this analyzer will try to find a simulation with the same basename as the present simulation, and try to compare dump 1 from this simulation with dump 1 from that simulation, dump 2 with dump 2, etc.
  • If <targetFld> is a directory path and simulation name (eg “../testDir/testSim”) we will look to do a comparison betwen dumps of <refFldName> in the current working directory and corresponding dumps of that simulation (eg “testSim_refFldName” in the target directory).
  • If <targetFld> is a directory path, simulation name and field name (eg “../testDir/testSim_testFld”), we will look to do a comparison between dumps of <refFldName> in the current working directory, and dumps of testFld in the targeted directory).
-o <outfield>, --outputField=<outfield>

(string, required, default = diffE)

<outfield> is the name of the field to write the results of the comparison to, for example, diffE.

-w, --overwrite

(flag)

Whether a dataset or group should be overwritten if it already exists.

Output

The output will be a vizschema compatible field file, containing the reference field minus the target field, in other words a difference field.

If you are running this analyzer from the UI, and the output dataset file already exists, then it will be overwritten each time the analyzer is run, unless you uncheck the Overwrite Existing Files box near the bottom of the Analysis Results pane.

If you are running the analyzer from the command line, the dataset will not be overwritten unless the -w, or --overwrite flag is specified on the command line.

The results of your analyzer may not be written into the output file if you have not specified the overwrite option to be True.