MODE-Analysis
MODE-Analysis griggs Wed, 04/24/2019 - 15:36MODE-Analysis Functionality
The MODE-Analysis tool may be used to summarize and aggregate results from one or more MODE runs. It is meant as a simple and convenient way to summarize MODE output without needing to write complicated scripts. However, users are welcome to use whatever scripting language or tools they would like to parse, summarize, and plot the MODE output.
The functionality of MODE-Analysis is similar to that of Stat-Analysis. You may run MODE-Analysis by passing in a configuration file containing all of the filtering parameters or pass the filtering parameters directly on the command line. For MODE-Analysis, a single job must be defined on the command line - whereas for Stat-Analysis, multiple jobs may be defined in the configuration file. MODE-Analysis currently supports two types of jobs:
- The -summary job operates on the columns of data selected by the user. For each column of data selected, it computes summary information.
- The -bycase job is used to summarize the number and area of matched/unmatched objects for each case found subject to filtering parameters.
MODE-Analysis Usage
View the usage statement for MODE-Analysis by simply typing the following:
The usage statement is rather long since all of the filtering parameters are listed. Scroll up to the top and note that you must supply at least one directory or file in which to find MODE output (using the -lookin path command line argument) and a job specification (-summary or -bycase).
The list of MODE LINE OPTIONS in the usage statement are organized into the following 7 groups:
- The toggles selections are used to specify which MODE lines should be used for the analysis job. Users are strongly encouraged to specify these well since not doing so will lead to misleading results.
- The multiple set string options selections may be used to filter out lines based on string values in the MODE output columns.
- The multiple set integer options selections may be used to filter out lines based on integer values in the MODE output columns.
- The integer max/min options selections may be used to filter out lines based on a range of integer values in the MODE output columns.
- The date/time max/min options selections may be used to filter out lines based on date/time ranges in the MODE output columns.
- The floating point max/min options selections may be used to filter out lines based on a range of floating point values in the MODE output columns.
- The miscellaneous options selection may be used to define a polyline and select only lines with objects whose centroid resides inside that masking polyline.
Configure
Configure griggs Wed, 04/24/2019 - 15:38MODE-Analysis may be run using a configuration file to define filtering parameters or by passing filtering parameters on the command line. The default MODE-Analysis configuration may be found in the $MET_BASE/config/MODEAnalysisConfig_default file. The configuration used by the test script may be found in the scripts/config/MODEAnalysisConfig file.
The setup of the MODE-Analysis configuration file differs slightly from the other types of configuration files in MET. In the other MET configuration files, all of the parameters listed are required to be included in every configuration file. For MODE-Analysis, only those filtering parameters that you'd actually like applied should be included. Generally speaking, all of the filtering parameters should be commented out except for the ones that you would like to be applied.
For this tutorial, we'll run MODE-Analysis jobs directly on the command line, rather than using the configuration file.
As mentioned on the previous page, users are strongly encouraged to specify the toggle filtering options when running MODE-Analysis. There are four sets of toggles to be used which are explained below. The equivalent contents of the OBJECT_ID column is listed for each option:
- -fcst versus -obs
The first selects lines pertaining to forecast objects (FNNN and CFNNN) while the latter selects lines pertaining to observation objects (ONNN and CONNN). - -single versus -pair
The first selects single object lines (FNNN, ONNN, CFNNN, and CONNN) while the latter selects pair lines (FNNN_ONNN and CFNNN_CONNN). - -simple versus -composite
The first selects simple object lines (FNNN, ONNN, FNNN_ONNN) while the latter selects composite object lines (CFNNN, CONNN, and CFNNN_CONNN). - -matched versus -unmatched
The first selects matched simple object lines while the latter selects unmatched simple object lines.
Run
Run griggs Wed, 04/24/2019 - 15:40Next, run the MODE-Analysis tool on the command line using the following command:
-lookin $MET_TUTORIAL_DATA/output/mode \
-bycase -fcst -single -simple
The MODE-Analysis tool searches recursively through the -lookin directory for MODE output files ending in _obj.txt. The -bycase job filters the object information and keeps track of object counts and areas. The output lists total matched/unmatched object areas and counts.
Now run a similar command for the simple observation objects:
-lookin $MET_TUTORIAL_DATA/output/mode \
-bycase -obs -single -simple
Compare the forecast and observation object counts and areas.
Now run the following command:
-lookin $MET_TUTORIAL_DATA/output/mode \
-bycase -single -simple
Here, the numbers of matched and unmatched forecast and observation objects are listed but their areas are summed together. Lastly, run the following summary job type and dump the MODE lines used to a file and the output of MODE-Analysis to a file:
-lookin $MET_TUTORIAL_DATA/output/mode \
-summary -simple -pair \
-column CENTROID_DIST -column ANGLE_DIFF -column AREA_RATIO -column INTEREST \
-dump_row $MET_TUTORIAL_DATA/output/mode_analysis/summary_job.dump \
-out $MET_TUTORIAL_DATA/output/mode_analysis/summary_job.out
For all of the pairs of simple objects in the summary_job.dump file (FNNN_ONNN), summary information is computed for the CENTROID_DIST, ANGLE_DIFF, AREA_RATIO, and total INTEREST columns and put in the summary_job.out file.
Output
Output griggs Wed, 04/24/2019 - 15:40The output of MODE-Analysis is printed to the screen by default, as we saw, unless you redirect it to an output file using the -out command line option. View the output of the last MODE-Analysis job we ran by opening the $MET_TUTORIAL_DATA/output/mode_analysis/summary_job.out file with the text editor of your choice. For each of the four columns of data selected, the summary information consists of the following:
- Number of values being summarized.
- Minimum, maximum, mean, and standard deviation of the values.
- The 10th, 25th, 50th (median), 75th, and 90th percentiles of the values.
- The sum of the values, which is only really applicable to columns like AREA.
Close this file, and open up the $MET_TUTORIAL_DATA/output/mode_analysis/summary_job.dump file with the text editor of your choice. Look through the OBJECT_ID column (17th column) and verify that this file only contains pairs of simple objects of the form FNNN_ONNN. (To view the entire header, you can look back at the output files in your $MET_TUTORIAL_DATA/output/mode directory.) It is always a good idea to use the -dump_row command line option to verify that the MODE-Analysis job is performed over exactly the subset of MODE data that you intended.