8. Batch Plotting Module
The batch plotting system is used to generate a number of plots of data in the METviewer database. The usage statement:
---- MVBatch ----
Usage: mv_batch
[-list]
[-printSql]
plot_spec_file
[job_name]
where "-list" indicates that the available plot jobs should be listed and no plots run
"-printSql" print SQL statements
"plot_spec_file" specifies the XML plot specification document
"job_name" specifies the name of the job from the plot specification to run
---- MVBatch Done ----
The plot_spec_file passed to the batch module contains information about the plots that will be generated. It is an XML file and its top-level tag is <plot_spec> which contains the following elements, divided into functional sections.
NOTE: All <val> elements should be listed in alphabetical order.
<connection>: Please reference the Common XML Structures documentation.
<rscript>: (optional) This tag specifies the Rscript instance to use, for example /usr/local/bin/Rscript. It defaults to the instance on the user path.
<folders>: A structure that specifies the input and output file system folders.
<date_list>: Please reference the Common XML Structures documentation.
<date_range>: A structure that specifies a date range, including all dates and times between.
<date_range_list>: A structure that specifies a list of date ranges, conceptually, a list of <date_range> structures.
<series2>: Describes the database field names and values that constitute the various lines, or series, corresponding to the right y axis (y2-axis) of the plot. The structure is the same as <series1> above.
<series_nobs>: Indicates which database fields should be used to calculate the number of observations (NOBS) for the plot.
<plot_cond>: Contains a SQL clause that will be inserted with the clause generated by the <plot_fix> information, allowing a user to specify record conditions for plotted statistics. Examples include:
<plot_cond>ld.baser > 0.02</plot_cond><agg>: This tag has been replaced by <plot_fix>. Do not use <agg>.
Template Formatting
Template values have the syntax {var_name[?param1=val1[&param2=val2[…]]]}. For example, {fcst_lead?format=HH} or {vx_mask?map=masks} or {fcst_thresh?units=in&symbol=letters}. The var_name must be one of the database fields that is used in the plot fixed variables or agg variables. When the template is applied, the current plot values for each variable replaces the tag in the template. The parameters can be used to format, convert or map the values. The dependent variables forecast variables are represented using the syntax {depY_N}, where Y is the y-axis (either 1 or 2) and N is the index of the fcst_var in the <dep> structure, starting with 1. The dependent variable statistics are represented using the syntax {depY_N_statS}, where Y and N match the values of the parent fcst_var, and S is the index of the statistic, starting at 1 for each fcst_var.
When using <agg_stat>, the following constraints and conditions apply:
To turn off bootstrapping, set <boot_repl> to 1.
agg_stat types must only be used with appropriate statistics for each, and only one can be used on a single plot.
agg_stat is performed once for each plot that is created.
A plot cannot have both agg_stat and non-agg_stat data on the same plot.
If the agg_stat difference curve is turned on, the plot1 difference curve must be turned off.
To display the calculated bootstrap CIs, set the plot_cis to “boot”.
Bootstrapping CIs cannot be calculated for PSTD stats, instead use the “brier” CI type for Brier score.
The plot must contain statistics for only one fcst_var.
All series on the plot must be derived from the same data
If agg_stat is turned on, event equalization must be turned off (it is done automatically).
agg_stat cannot be used on the same plot with calc_stat.
calc_ctc, calc_sl1l2, calc_sal1l2, calc_vl1l2 must only be used with appropriate statistics for each, and only one can be used on a single plot.
A plot cannot have both calc_stat and non-calc_stat data on the same plot.
calc_stat cannot be used on the same plot with agg_stat.
Only one of roc_pct or roc_ctc can be used on a single plot.
If using roc_pct, select a list of probabilistic threshold values as a fcst_thresh <plot_fix> value.
If using roc_pct, select a single obs_thresh <plot_fix> value.
If using roc_ctc, select two or more fcst_thresh <plot_fix> values and a single obs_thresh <plot_fix> value.
<ensss_pts>: Number of binned points.
If the number of binned points is not specified or < 1, use a default.
If the number of binned points is > 10 , use 1.
In other cases use the result of division of the number of points on 10.
The following group of settings should be set to lists of values where the length of each list is equal to the number of series that are specified for the plot. Calculating the number of series and furthermore, the order of the series, can be done by considering the series1, series2 and dep values. For each dep1 statistic, enumerate each series1 permutation. Then, do the same for each dep2 statistic.
8.1. MODE Statistics
8.1.1. Single Object Statistics
MODE statistics are broken up into two categories: single and pair statistics. Single statistics are suffixed with a three letter code which indicates the group of objects over which the statistic should be calculated or aggregated. The syntax for the three letter code is as follows: STATNAME_CCC where STATNAME is one of the Single Object Statistics in the table below, and CCC follows the following system:
[A|F|O|D] - indicating All, Forecast, Observed or a Difference between the forecast statistic and the observed statistic
[A|S|C] - indicating All, Simple or Cluster objects
[A|M|U] - indicating All, Matched or Unmatched objects
Single Object Stat |
METviewer Stat Name |
---|---|
SUM(area) / total |
ACOV |
COUNT(object_id) |
CNT |
COUNT(object_id) |
CNTSUM |
centroid_x |
CENTX |
centroid_y |
CENTY |
centroid_lat |
CENTLAT |
centroid_lon |
CENTLON |
axis_avg |
AXAVG |
length |
LEN |
width |
WID |
area |
AREA |
area_threshold |
AREATHR |
curvature |
CURV |
curvature_x |
CURVX |
curvature_y |
CURVY |
complexity |
CPLX |
intensity_10 |
INT10 |
intensity_25 |
INT25 |
intensity_50 |
INT50 |
intensity_75 |
INT75 |
intensity_90 |
INT90 |
intensity_nn |
INTN |
intensity_sum |
INTSUM |
In addition to the single object statistics, METviewer supports ratios of single object counts and areas, and also some contingency table statistics. These statistics are specified in the table below with their corresponding interpretation. For the area-weighted version of these statistics, replace RATIO_ with AREARAT_ and OBJ with OBJA.
Interpretation |
METviewer Stat Name |
---|---|
What percentage of simple objects are forecast? |
RATIO_FSA_ASA |
What percentage of simple objects are observation? |
RATIO_OSA_ASA |
What percentage of simple objects are matched? |
RATIO_ASM_ASA |
What percentage of simple objects are unmatched? |
RATIO_ASU_ASA |
What percentage of simple forecast objects are matched? |
RATIO_FSM_FSA |
What percentage of simple forecast objects are unmatched? |
RATIO_FSU_FSA |
What percentage of simple observation objects are matched? |
RATIO_OSM_OSA |
What percentage of simple observation objects are unmatched? |
RATIO_OSU_OSA |
What percentage of simple matched objects that are forecast? |
RATIO_FSM_ASM |
What percentage of simple matched objects that are observation? |
RATIO_OSM_ASM |
What percentage of simple unmatched objects that are forecast? |
RATIO_FSU_ASU |
What percentage of simple unmatched objects that are observation? |
RATIO_OSU_ASU |
What percentage of all objects are simple? |
RATIO_ASA_AAA |
What percentage of all objects are cluster? |
RATIO_ACA_AAA |
What percentage of all forecast objects are simple? |
RATIO_FSA_FAA |
What percentage of all forecast objects are cluster? |
RATIO_FCA_FAA |
What percentage of all observation objects are simple? |
RATIO_OSA_OAA |
What percentage of all observation objects are cluster? |
RATIO_OCA_OAA |
What percentage of cluster objects are forecast? |
RATIO_FCA_ACA |
What percentage of cluster objects are observation? |
RATIO_OCA_ACA |
What is the ratio of simple forecasts to simple observations (frequency bias)? |
RATIO_FSA_OSA |
What is the ratio of simple observations to simple forecasts (1 / frequency bias)? |
RATIO_OSA_FSA |
What is the ratio of cluster objects to simple objects? |
RATIO_ACA_ASA |
What is the ratio of simple objects to cluster objects? |
RATIO_ASA_ACA |
What is the ratio of cluster forecast objects to simple forecast objects? |
RATIO_FCA_FSA |
What is the ratio of simple forecast objects to cluster forecast objects? |
RATIO_FSA_FCA |
What is the ratio of cluster observation objects to simple observation objects? |
RATIO_OCA_OSA |
What is the ratio of simple observation objects to cluster observation objects? |
RATIO_OSA_OCA |
Hits = (FSM + OSM)/2 |
OBJHITS |
Misses = OSU |
OBJMISSES |
False Alarms = FSU |
OBJFAS |
Correct Negatives (areas only) = [(TOT - FSA) + (TOT - OSA)] / 2 |
(not implemented) |
CSI = hits / (hits + misses + false alarms) = [(FSM + OSM)/2] / [(FSM + OSM)/2 + OSU + FSU] |
OBJCSI |
PODY = hits / (hits + misses) = [(FSM + OSM)/2] / [(FSM + OSM)/2 + OSU] |
OBJPODY |
FAR = false alarms / (hits + false alarms) = FSU / [(FSM + OSM)/2 + FSU] |
OBJFAR |
FBIAS = RATIO_FSA_OSA = FSA / OSA (a.k.a. RATIO_FSA_OSA above) |
OBJFBIAS |
8.1.2. Pair Object Statistics
MODE object pair statistics are specified using the following format: STATNAME_CC where STATNAME is one of the Object Pair Statistics in the table below, and CC follows the following system:
[A|S|C] - indicating All, Simple or Cluster pairs
[A|M|U] - indicating All, Matched or Unmatched objects
Object Pair Stat |
METviewer Stat Name |
---|---|
centroid_dist |
CENTDIST |
boundary_dist |
BOUNDDIST |
convex_hull_dist |
HULLDIST |
angle_diff |
ANGLEDIFF |
area_ratio |
AREARAT |
intersection_area |
INTAREA |
union_area |
UNIONAREA |
symmetric_diff |
SYMDIFF |
intersection_over_areai |
INTOVERAREA |
complexity_ratio |
CMPLXRATIO |
percentile_intensity_ratio |
PERCINTRATIO |
interest |
INT |
MAX(interest) |
MAXINT |
MAX(interest) for fcst objects |
MAXINTF |
MAX(interest) for obs objects |
MAXINTO |