5915 lines
277 KiB
HTML
5915 lines
277 KiB
HTML
<!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en">
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type"
|
|
content="text/html; charset=iso-8859-1">
|
|
<meta name="GENERATOR"
|
|
content="Mozilla/4.8 [en] (X11; U; Linux 2.4.18-27.7.xsmp i686) [Netscape]">
|
|
<title>Text Products Reference</title>
|
|
<!--link REL="STYLESHEET" HREF="TextFormatter.html"-->
|
|
</head>
|
|
<body bgcolor="#ffffff">
|
|
<center>
|
|
<h1><a name="InfrastructureReference"></a>Infrastructure Reference</h1>
|
|
</center>
|
|
<p> <a href="#ArgumentsintheStandardProductFile">Arguments
|
|
in
|
|
the Standard File</a> <br>
|
|
<a href="#Naming">Naming Conventions</a> <br>
|
|
<a href="#SampleAnalysis">Sample Analysis</a> <br>
|
|
<a
|
|
href="#StatisticsByTime">Statistics By Time Range</a> <br>
|
|
<a
|
|
href="#ArgumentstoSampleAnalysis">Arguments to SampleAnalysis methods</a>
|
|
<br>
|
|
<a
|
|
href="#Checking_for_Edit_Areas_Sample">Checking for Edit Areas</a><br>
|
|
<a
|
|
href="#GLOBALTHRESHOLDSAND">Global Thresholds and Variables</a> <br>
|
|
<a
|
|
href="#SCALARWEATHERElements">Scalar Analysis methods</a> <br>
|
|
<a
|
|
href="#VECTORWEATHERElements">Vector Analysis methods</a> <br>
|
|
<a href="#DISCRETEELEMENTS">DiscreteAnalysis
|
|
methods</a> <br>
|
|
<a href="#WXElement">Weather
|
|
Analysis methods</a> <br>
|
|
<a
|
|
href="#dominantWx">Algorithm for rankedWx and dominantWx</a> <br>
|
|
<a href="#TextRule">Text Rules Libraries for Narrative
|
|
Products</a><br>
|
|
<a
|
|
href="#SettingDAYandNIGHTtimes">Setting Day and Night Times</a>
|
|
<br>
|
|
<a
|
|
href="#Analysis-DrivenPhrases">Analysis-Driven Phrases</a> <br>
|
|
<a
|
|
href="#ArgumentstoTextRulesClass">Arguments to Narrative methods</a> <br>
|
|
<a href="#CheckingforEdit">Checking
|
|
for Edit Areas</a> <br>
|
|
<a href="#TextGlobals">Global
|
|
Thresholds and Variables</a> <br>
|
|
<a href="#NARRATIVEPHRASES">Narrative
|
|
Phrases</a> <br>
|
|
<a
|
|
href="#SCALARWEATHERELEMENT">Scalar Weather Element Phrases</a> <br>
|
|
<a
|
|
href="#WINDANDWINDGUST">Vector-Related Phrases (Wind and WindGust)</a>
|
|
<br>
|
|
<a
|
|
href="#SeaBreeze">Sea Breeze Identification</a> <br>
|
|
<a
|
|
href="#WEATHER">Weather Phrases</a><br>
|
|
<a
|
|
href="#Weather_Key_Attributes_Primary_and">Weather Subkey Attributes
|
|
"Primary" and "Mention"</a><br>
|
|
<a
|
|
href="#CustomizingWeatherPhrases">Customizing Weather Phrases</a> <br>
|
|
<a
|
|
href="#PopWx_Consistency">Pop/Wx Consistency</a> <br>
|
|
<a
|
|
href="#COMBINEDELEMENT">Combined Element Phrases</a> <br>
|
|
<a
|
|
href="#MARINE">Marine Phrases</a><br>
|
|
<a href="#AlgorithmforWaveHeightandWindWaveHgt">Algorithm for WaveHeight
|
|
and WindWaveHgt Reporting</a> <br>
|
|
<a
|
|
href="#FIREWEATHER">Fire Weather Phrases</a> <br>
|
|
<a
|
|
href="#FIREWEATHER"> Discrete Phrases (Headlines)</a> <br>
|
|
<a
|
|
href="#NARRATIVESTRATEGIES">Narrative Strategies</a> <br>
|
|
<a
|
|
href="#STRATEGYFORNONLINEARTHRESHOLDS">Non-Linear Thresholds</a>
|
|
<br>
|
|
<a
|
|
href="#DATAVALUEEXTRACTIONFROMTHEGRIDS">DataValue
|
|
Extraction from the Grids</a> <br>
|
|
<a
|
|
href="#UNITCONVERSION">Unit Conversion</a> <br>
|
|
<a
|
|
href="#STRATEGYFORNONSTANDARDROUNDING">Standard and
|
|
Non-Standard Rounding</a> <br>
|
|
<a
|
|
href="#RANGEADJUSTMENT">Range Adjustment</a>
|
|
<br>
|
|
<a
|
|
href="#STRATEGYFORHANDLINGNULLVALUES">Null Values</a> <br>
|
|
<a
|
|
href="#STRATEGYFORLOCALEFFECTSPhraseBuildermodule">Local
|
|
Effects</a> <br>
|
|
<a
|
|
href="#LocalEffectsandCompoundPhrases">Local Effects and
|
|
Compound Phrases</a> <br>
|
|
<a
|
|
href="#ConsolidationRulesforLocalEffects">Consolidation
|
|
Rules for Local Effects</a> <br>
|
|
<a
|
|
href="#LocalEffectExamples">Local Effect Examples</a> <br>
|
|
<a
|
|
href="#NullValuesandLocalEffects">Null Values and Local
|
|
Effects</a> <br>
|
|
<a
|
|
href="#ExceptversusOtherwiseWording">"Except" vs. "Otherwise"
|
|
wording</a> <br>
|
|
<a
|
|
href="#LocalEffectAreasthatdonotIntersecttheCurrentArea">More
|
|
Local Effect Area Features</a> <br>
|
|
<a
|
|
href="#LocalEffectsforSnowAccumulationandTotalSnowAccumulation">Local
|
|
Effects for Snow Accumulation and Total Snow Accumulation -- Using a
|
|
Method for Checking the Local Effect Threshold</a> <br>
|
|
<a
|
|
href="#LocalEffectsfortheCombinedSkyPopWxPhrase">Local
|
|
Effects for the Combined SkyPopWx Phrase</a> <br>
|
|
<a
|
|
href="#PERIODCOMBINING">Period Combining</a> <br>
|
|
<a
|
|
href="#STRATEGYFORPHRASECONSOLIDATION">Phrase Consolidation</a>
|
|
<br>
|
|
<a
|
|
href="#PHRASEORDERING">Phrase Ordering</a> <br>
|
|
<a
|
|
href="#UNTILPHRASING">"Until" Phrasing</a> <br>
|
|
<a
|
|
href="#HANDLINGVISIBILITY">Visibility</a> <br>
|
|
<a
|
|
href="#WEATHERKEYFILTERING">Weather Phrasing</a><br>
|
|
<a href="#Appendix_A">Appendix A: Local Effects
|
|
Design</a><br>
|
|
</p>
|
|
<hr>
|
|
<h2> <a name="ArgumentsintheStandardProductFile"></a>Arguments in
|
|
the Standard Product File</h2>
|
|
|
|
<center><br>
|
|
<table nosave="" border="1" width="75%">
|
|
<caption>
|
|
<center></center>
|
|
<br>
|
|
</caption><tbody>
|
|
</tbody> <tbody>
|
|
<tr>
|
|
<td>ARGUMENT</td>
|
|
<td>ACCESSING INFORMATION</td>
|
|
</tr>
|
|
<tr>
|
|
<td>argDict</td>
|
|
<td> Dictionary containing system information about the
|
|
product being created. In most cases, you will not need to access
|
|
information within argDict, but it must be passed for internal system
|
|
use.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>fcst</td>
|
|
<td>The text string representing the product. It will
|
|
be in a partially completed state as it is passed to each method in
|
|
turn. Be sure to "return fcst" at the end of a method that
|
|
is passed the fcst.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>editArea</td>
|
|
<td>Contains the name and polygon points that define an edit
|
|
area. <br>
|
|
editAreaName = editArea.id().name()</td>
|
|
</tr>
|
|
<tr>
|
|
<td>areaLabel</td>
|
|
<td>The label given to the current edit area (or current
|
|
combination of areas). This label is defined via the
|
|
"defaultEditAreas" entries OR within the Combinations file entries.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>timeRange</td>
|
|
<td>Time Range over which statistics are being generated.
|
|
This is always in GMT. <br>
|
|
timeRange.startTime() <br>
|
|
timeRange.startTime().day(),
|
|
timeRange.startTime().month(), timeRange.startTime().hour()
|
|
<br>
|
|
timeRange.endTime()</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</center>
|
|
<h2> <a name="Naming"></a>Naming conventions</h2>
|
|
Throughout the infrastructure, thresholds, variables, and methods are
|
|
named with suffixes that indicate the return value
|
|
expected.
|
|
For example, the method, <i><font color="#993366">pop_lower_threshold</font>,</i>returns
|
|
a weather element value for PoP. The table below lists the
|
|
suffixes and their meaning (in alphabetical order): <br>
|
|
<br>
|
|
|
|
<center><br>
|
|
<table nosave="" border="1" width="75%">
|
|
<caption>
|
|
<center></center>
|
|
<br>
|
|
</caption><tbody>
|
|
</tbody> <tbody>
|
|
<tr>
|
|
<td>METHOD SUFFIXES</td>
|
|
<td>METHOD RETURN VALUE</td>
|
|
</tr>
|
|
<tr>
|
|
<td>_dict</td>
|
|
<td>Python dictionary</td>
|
|
</tr>
|
|
<tr>
|
|
<td>_difference</td>
|
|
<td>a difference in weather values e.g. <i><font color="#993366">vector_mag_difference</font></i>is
|
|
used to determine if wind magnitudes are significantly different</td>
|
|
</tr>
|
|
<tr>
|
|
<td>_element</td>
|
|
<td>weather element name e.g. "WindWaveHgt" returned as the
|
|
<i><font color="#993366">seasWindWave_element</font></i></td>
|
|
</tr>
|
|
<tr>
|
|
<td>_flag</td>
|
|
<td>0 or 1</td>
|
|
</tr>
|
|
<tr>
|
|
<td>_list</td>
|
|
<td>Python list</td>
|
|
</tr>
|
|
<tr>
|
|
<td>_percentage</td>
|
|
<td>number between 0 and 100</td>
|
|
</tr>
|
|
<tr>
|
|
<td>_phrase</td>
|
|
<td>text string phrase</td>
|
|
</tr>
|
|
<tr>
|
|
<td>_phrase_connector</td>
|
|
<td>text string for connecting phrases e.g. " then " as in
|
|
"Mostly cloudy in the morning then clearing."</td>
|
|
</tr>
|
|
<tr>
|
|
<td>_threshold</td>
|
|
<td>weather element value</td>
|
|
</tr>
|
|
<tr>
|
|
<td>_weight</td>
|
|
<td>number between 0 and 1</td>
|
|
</tr>
|
|
<tr>
|
|
<td>_valueStr</td>
|
|
<td>string representing a weather element value</td>
|
|
</tr>
|
|
<tr>
|
|
<td>_valueList</td>
|
|
<td>list of thresholds corresponding to value strings for weather
|
|
element values</td>
|
|
</tr>
|
|
<tr>
|
|
<td>_value_connector</td>
|
|
<td>text string for connecting values e.g. " to " as in "25 to 35
|
|
mph"</td>
|
|
</tr>
|
|
<tr>
|
|
<td>_nlValue</td>
|
|
<td>This suffix indicates that the method can return either a
|
|
single value, a method, OR a dictionary of (lowValue, highValue) :
|
|
returnValue entries. See the section on "Non-linear
|
|
Thresholds" for more information.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</center>
|
|
<h2> <a name="SampleAnalysis"></a>Sample Analysis</h2>
|
|
The Python methods described in this section can be found in the
|
|
SampleAnalysis module which appears in the Utilities window of the
|
|
Define Text Products Dialog. Each method is listed with the value
|
|
it returns. All methods return "None" if there is no data
|
|
available.
|
|
<h4><a name="StatisticsByTime"></a>Statistics By Time Range</h4>
|
|
Methods that are starred (**) below (e.g. **avg) can be
|
|
listed in the analysisList with an optional argument list
|
|
indicating how the time range is to be divided in reporting
|
|
statistics. A typical analysisList entry might look like this:
|
|
<p> "analysisList" : [ <br>
|
|
|
|
("MaxT", self.avg), <br>
|
|
|
|
] </p>
|
|
<p>The result of the analysis will be a simple average value for the
|
|
entire time range being examined. Using the optional
|
|
"divide" argument, the analysisList might look like this: </p>
|
|
<p> "analysisList" : [ <br>
|
|
|
|
("MaxT", self.avg, [6]), <br>
|
|
|
|
] </p>
|
|
<p>In this instance, the time range will be divided into 6-hour
|
|
sub-ranges and an average value for MaxT will be reported for each
|
|
sub-range. This information will be reported as a list of tuples. For
|
|
example, a 12-hour time range would produce: </p>
|
|
<p>
|
|
[ (avg1, subRange1), (avg2, subRange2)] </p>
|
|
<p>The time range is divided from the endtime backward so that "odd"
|
|
sub-ranges occur at the beginning of the time range. For example,
|
|
suppose we are dividing an 8 hour time range into 6-hour
|
|
sub-ranges. This will result in a 2-hour sub-range followed by a
|
|
6-hour sub-range. </p>
|
|
<p>The Text Rules methods are built to handle varying types of Sample
|
|
Analyis return values. </p>
|
|
<p>If the time-divide argument is zero, the statistics will be
|
|
reported "byTimeRange" returning a list of (statistics, subRange)
|
|
tuples, one for each grid overlapping timeRange being examined. </p>
|
|
<p>In summary, the following table shows analysisList methods and their
|
|
corresponding results: <br>
|
|
<br>
|
|
</p>
|
|
<center><br>
|
|
<table nosave="" border="1" width="75%">
|
|
<caption>
|
|
<center></center>
|
|
<br>
|
|
</caption><tbody>
|
|
</tbody> <tbody>
|
|
<tr nosave="">
|
|
<td>ANALYSIS LIST SPECIFICATION</td>
|
|
<td nosave="">RESULT</td>
|
|
</tr>
|
|
<tr>
|
|
<td>("MinT", self.avg)</td>
|
|
<td>Average scalar value over the entire time range</td>
|
|
</tr>
|
|
<tr>
|
|
<td>("MinT", self.avg, [0]) </td>
|
|
<td>List of (avg, subRange) tuples, one for each grid overlapping
|
|
timeRange</td>
|
|
</tr>
|
|
<tr>
|
|
<td>("MinT", self.avg, [3]) </td>
|
|
<td>TimeRange is divided into 3-hour sub-ranges and
|
|
returns: <br>
|
|
List of (avg, subRange) tuples, one for each sub-range</td>
|
|
</tr>
|
|
<tr>
|
|
<td>("MinT", self.avg, [6]) </td>
|
|
<td>TimeRange is split into 6-hour sub-ranges and returns: <br>
|
|
List of (avg, subRange) tuples, one for each sub-range</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</center>
|
|
<p><b>NOTE</b> that if there is no data for ANY ONE of the
|
|
subRanges, None is returned for the entire time range. </p>
|
|
<h4><a name="ArgumentstoSampleAnalysis"></a>Arguments to Sample
|
|
Analysis Methods</h4>
|
|
The SampleAnalysis thresholds and variables take several arguments
|
|
which contain useful information allowing you to return values based on
|
|
product type, edit area, weather element or time range. The
|
|
following table lists the arguments and shows how to access the
|
|
information they contain. <br>
|
|
<br>
|
|
|
|
<center><br>
|
|
<table nosave="" border="1" width="75%">
|
|
<caption>
|
|
<center></center>
|
|
<br>
|
|
</caption><tbody>
|
|
</tbody> <tbody>
|
|
<tr>
|
|
<td>ARGUMENT</td>
|
|
<td>ACCESSING INFORMATION</td>
|
|
</tr>
|
|
<tr>
|
|
<td>parmHisto</td>
|
|
<td>Weather Element: elementName =
|
|
parmHisto.parmID().parmName() <br>
|
|
Edit
|
|
Area:
|
|
editAreaName = parmHisto.area().id().name()</td>
|
|
</tr>
|
|
<tr>
|
|
<td>timeRange</td>
|
|
<td>Time Range over which statistics are being generated.
|
|
This is always in GMT. <br>
|
|
timeRange.startTime() <br>
|
|
timeRange.startTime().day(),
|
|
timeRange.startTime().month(), timeRange.startTime().hour()
|
|
<br>
|
|
timeRange.endTime()</td>
|
|
</tr>
|
|
<tr>
|
|
<td>componentName</td>
|
|
<td>Current Text Product component being analyzed</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<br>
|
|
<br>
|
|
</center>
|
|
<h4><a name="Checking_for_Edit_Areas_Sample"></a>Checking for Edit Areas</h4>
|
|
Sometimes you might want to check to see if you are processing a
|
|
particular edit area or set of edit areas. For example, you might
|
|
want to base the analysisMethod on the current Edit Area. To do
|
|
this, set up an analysis method in the "analysisList" as follows:<br>
|
|
<br>
|
|
("Wind",
|
|
self._wind_analysisMethod), <br>
|
|
<br>
|
|
Then include this analysis method in your override file:<br>
|
|
<br>
|
|
def _wind_analysisMethod(self, parmHisto,
|
|
timeRange, componentName): <br>
|
|
|
|
ChannelZone = ["PHZ130"] <br>
|
|
|
|
argDict = self._argDict <br>
|
|
|
|
argDict["editArea"] = (parmHisto.area(), "") <br>
|
|
if
|
|
self.currentAreaContains(argDict, ChannelZone): <br>
|
|
|
|
return self.vectorModeratedMax(parmHisto, timeRange, componentName) <br>
|
|
else: <br>
|
|
|
|
return self.vectorModeratedMinMax(parmHisto, timeRange,
|
|
componentName) <br>
|
|
<p><a name="GLOBALTHRESHOLDSAND"></a><b>GLOBAL THRESHOLDS AND VARIABLES</b>
|
|
</p>
|
|
<p>There are four categories of analysis methods: absolute, cumulative,
|
|
standard deviation (stdDev) and moderated (percentage). The
|
|
absolute and cumulative categories do not filter the sampled data. All
|
|
statistics are based on the entire sampled data set. The
|
|
standard deviation (stdDev) and moderated methods do filter the sampled
|
|
data set, however. The stdDev methods ignore values that lie
|
|
outside a configurable number of standard deviations from the
|
|
mean. Low and high thresholds are defined independently. The
|
|
moderated methods work exactly the same way as stdDev methods, except
|
|
that they filter data based on a ranked percentage. Values are
|
|
ranked, low to high, and outliers are excluded from the data set (e.g.,
|
|
the upper 10%). </p>
|
|
<p>Most analysis methods screen grids for temporal coverage of the
|
|
given time range before including their data values in the
|
|
analysis. The exceptions to this are the methods that
|
|
work with accumulative elements. The following table describes the
|
|
temporal coverage thresholds you can override for this screening
|
|
process. To override a threshold, simply copy the method from the
|
|
SampleAnalysis utility into your _Overrides file and change desired
|
|
values. Most methods weight grids temporally as well. Each grid
|
|
will contribute
|
|
proportional to its time duration for the sampled period. <br>
|
|
</p>
|
|
<center>
|
|
<table nosave="" border="1" width="75%">
|
|
<caption>
|
|
<center></center>
|
|
<br>
|
|
</caption><tbody>
|
|
</tbody> <tbody>
|
|
<tr nosave="">
|
|
<td nosave=""><a name="temporalCoverage_percentage"></a><i><font
|
|
color="#993366">temporalCoverage_percentage</font></i></td>
|
|
<td>This is the
|
|
percentage
|
|
of the given time range COVERED by the grid in order to include it in
|
|
the analysis. This is the value used IF a value is not found in
|
|
the
|
|
temporalCoverage_dict (see below) <br>
|
|
NOTE: The temporalCoverage_hours (see below) must also be met by the
|
|
grid for it to be included.<br>
|
|
In addition, if a grid is completely contained
|
|
within the time range, it will automatically be included. <br>
|
|
Default is 20 percent.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><i><font color="#993366">temporalCoverage_dict</font></i></td>
|
|
<td>Temporal Coverage percentage specified by Weather Element.</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="vertical-align: top;"><i><font color="#993366">temporalCoverage_hours</font></i></td>
|
|
<td style="vertical-align: top;">This is the
|
|
hours of the given time range COVERED by the grid in order to include
|
|
it in
|
|
the analysis. This is the value used IF a value is not found in
|
|
the
|
|
temporalCoverage_hours_dict (see below) <br>
|
|
NOTE: The temporalCoverage_percentage (see above) must also be met by
|
|
the grid for it to be included.<br>
|
|
In addition, if a grid is completely contained
|
|
within the time range, it will automatically be included. <br>
|
|
Default is 0 percent.</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="vertical-align: top;"><i><font color="#993366">temporalCoverage_hours_dict</font></i></td>
|
|
<td style="vertical-align: top;">Temporal Coverage hours
|
|
specified by Weather Element.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><i><font color="#993366">moderatedDefault</font></i></td>
|
|
<td>The value used by all "moderated" methods by default if the
|
|
weather element does not appear in the moderated_dict. The
|
|
moderated_dict value always overrides this default value. This
|
|
value is used for the min and max values.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><i><font color="#993366">moderated_dict</font></i></td>
|
|
<td>Returns a dictionary that defines the min and max filter
|
|
values for all "moderated" methods. For each weather element, a tuple
|
|
defines the minimum threshold and the maximum threshold
|
|
respectively. All moderated methods rank all sampled values from
|
|
lowest to highest and then exclude values that are below the minimum
|
|
threshold and above the maximum threshold.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><i><font color="#993366">stdDevDefault</font></i></td>
|
|
<td>The value used by all "stdDev" methods by default if the
|
|
weather element does not appear in the stdDev_dict. The stdDev_dict
|
|
value always overrides this default value. This value is used for
|
|
the min and max values.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><i><font color="#993366">stdDev_dict</font></i></td>
|
|
<td>Returns a dictionary that defines the low and high limit at
|
|
which outliers will be removed when calculating stdDev stats. These
|
|
tuples represent the (low, high) number of standard <br>
|
|
deviations. Any values falling outside this range will not be
|
|
included in the calculated statistic. </td>
|
|
</tr>
|
|
<tr>
|
|
<td><i><font color="#993366">bin_dict</font></i></td>
|
|
<td>Returns a dictionary that defines the bin values for
|
|
"binnedPercent". Bin tuples represent (low, high) values for each bin.
|
|
Bin values are inclusive.</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="vertical-align: top;"><i><font color="#993366">maxMode_increment_dict</font></i></td>
|
|
<td style="vertical-align: top;">Returns the increment to be used
|
|
for "maxMode" when "binning" values before computing mode. For
|
|
example, the default "maxMode_increment" for "PoP" is 10. </td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</center>
|
|
<p>Here is how the standard deviation SampleAnalysis methods work: <br>
|
|
1) compute the standard deviation of all grid values <br>
|
|
2) the <font color="#993399"><i>stdDev_dict</i> </font>contains a
|
|
threshold, i.e., number of sigmas for each the min and the max <br>
|
|
3) the routine calculates the min and max from the std deviation and
|
|
the sigmas <br>
|
|
4) in some cases, the result may fall outside of the actual data
|
|
range. In this case, the returned values will be the min or max
|
|
of
|
|
the actual data points. </p>
|
|
<p>Here is how the moderated SampleAnalysis methods work: <br>
|
|
1) compute the "histogram" of the data values <br>
|
|
2) the <i><font color="#993399">moderated_dict </font></i>gives a
|
|
percentage for min, and a percentage for max <br>
|
|
3) we return values that are % percent from the min and % percent from
|
|
the max, not numerically, but from a sorted list. Thus if the
|
|
histogram is <br>
|
|
4,4,5,6,7,8,9,10,15,19, and your percent is 20% for the min and 10% for
|
|
the max, you will pick out the 20% of the number and the 90% of the
|
|
number in the <br>
|
|
sequence. Since there are exactly 10 samples in my exmaple, the
|
|
20% point will be 5, and the 90% point will be 15. It isn't
|
|
numerical. </p>
|
|
<p>Here is some further explanation (from Bill Schneider) on the
|
|
moderated methods: </p>
|
|
<p>The moderated methods look at all the points in the grid, then they
|
|
throw away highest (for max) or lowest (for min) percentage you have
|
|
specified in the moderated dictionary. Then it uses the max or min of
|
|
the remaining gridpoints. </p>
|
|
<p>So for example if you use moderatedMaximum for temperature and have
|
|
defined the moderated percentages fore temperature as (10,15) in the
|
|
dictionary, the method will take the grid points that have the highest
|
|
values and throw away the top 15 percent of them. The remaining maximum
|
|
value will be reported. For moderatedMinimum, the method will take the
|
|
grid points that have the lowest values and throw away 15 % of the
|
|
lowest values before reporting the minimum. <br>
|
|
</p>
|
|
<p><a name="SCALARWEATHERElements"></a><b>SCALAR WEATHER ELEMENTS</b> <br>
|
|
</p>
|
|
<center>
|
|
<table nosave="" border="1" width="75%">
|
|
<caption>
|
|
<center></center>
|
|
<br>
|
|
</caption><tbody>
|
|
</tbody> <tbody>
|
|
<tr nosave="">
|
|
<td nosave=""><font color="#000000">METHOD </font></td>
|
|
<td><font color="#000000">RETURN VALUE:</font></td>
|
|
</tr>
|
|
<tr>
|
|
<td><font color="#000000">**avg </font></td>
|
|
<td><font color="#000000">average value</font></td>
|
|
</tr>
|
|
<tr>
|
|
<td><font color="#000000">**minMax</font></td>
|
|
<td><font color="#000000"> (min, max)</font></td>
|
|
</tr>
|
|
<tr>
|
|
<td><font color="#000000">**minimum</font></td>
|
|
<td><font color="#000000">minimum value</font></td>
|
|
</tr>
|
|
<tr>
|
|
<td><font color="#000000">**maximum</font></td>
|
|
<td><font color="#000000">maximum value</font></td>
|
|
</tr>
|
|
<tr>
|
|
<td><font color="#000000">**median </font></td>
|
|
<td><font color="#000000">median value for given time range</font></td>
|
|
</tr>
|
|
<tr nosave="">
|
|
<td><font color="#000000">**medianRange </font></td>
|
|
<td nosave=""><font color="#000000">2-value range around the
|
|
median value for given time range</font></td>
|
|
</tr>
|
|
<tr>
|
|
<td><font color="#000000">**mode </font></td>
|
|
<td><font color="#000000">mode value for given time range</font></td>
|
|
</tr>
|
|
<tr nosave="">
|
|
<td><font color="#000000">**modeRange </font></td>
|
|
<td nosave=""><font color="#000000">2-value range around the mode
|
|
value for given time range</font></td>
|
|
</tr>
|
|
<tr>
|
|
<td><font color="#000000">firstAvg </font></td>
|
|
<td><font color="#000000">average value for first grid only</font></td>
|
|
</tr>
|
|
<tr>
|
|
<td><font color="#000000">firstMinMax</font></td>
|
|
<td><font color="#000000">minmax value for the first grid only</font></td>
|
|
</tr>
|
|
<tr>
|
|
<td><font color="#000000">minMaxAvg </font></td>
|
|
<td><font color="#000000"> (min, max, avg)</font></td>
|
|
</tr>
|
|
<tr>
|
|
<td><font color="#000000">minMaxSum </font></td>
|
|
<td><font color="#000000"> ( min, max, sum)</font> <br>
|
|
<font color="#000000">Time-weighted min/max/ave of the
|
|
multiple grids overlapping the time range. This is used for
|
|
rate-dependent weather elements such as QPF.</font></td>
|
|
</tr>
|
|
<tr>
|
|
<td><font color="#000000">accumMinMax</font></td>
|
|
<td><font color="#000000"> (min, max, sum)</font> <br>
|
|
<font color="#000000">Returns the min, max, and sum for
|
|
rate-dependent weather elements such as QPF.</font></td>
|
|
</tr>
|
|
<tr>
|
|
<td><font color="#000000">accumSum</font></td>
|
|
<td><font color="#000000">sum</font> <br>
|
|
<font color="#000000">Returns the sum for rate-dependent weather
|
|
elements such as QPF.</font></td>
|
|
</tr>
|
|
<tr>
|
|
<td><font color="#000000">**maxAvg </font></td>
|
|
<td><font color="#000000">average value.</font> <br>
|
|
<font color="#000000">Calculates the average value in each
|
|
of the overlapping grids, and then returns the maximum of the averages.</font></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="vertical-align: top;">**maxMode</td>
|
|
<td style="vertical-align: top;">Calculates the mode value in
|
|
each of the overlapping grids, and thern returns the maximum of the
|
|
modes. Before calculating the mode, the values are rounded to the
|
|
nearest increment as given in the <i><font color="#993399">maxMode_increment_dict</font></i></td>
|
|
</tr>
|
|
<tr>
|
|
<td>**stdDevMaxAvg</td>
|
|
<td>average value. <br>
|
|
Calculates the average value after filtering by standard deviation and
|
|
then returns the maximum of the averages.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>**moderatedMaxAvg</td>
|
|
<td>average value. <br>
|
|
Calculates the average value after filtering by moderated (percentage)
|
|
and then returns the maximum of the averages.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>**stdDevAvg</td>
|
|
<td>average value after filtering based on stdDev</td>
|
|
</tr>
|
|
<tr>
|
|
<td>stdDevFirstAvg</td>
|
|
<td>average value for the first grid only</td>
|
|
</tr>
|
|
<tr>
|
|
<td><font color="#000000">**stdDevMinMax</font></td>
|
|
<td><font color="#000000"> (min, max)</font> <br>
|
|
<font color="#000000">min, max set at standard deviations around
|
|
the mean.</font> <br>
|
|
<font color="#000000">The <i>stdDev_dict</i>, defines the number
|
|
of standard deviations to compute min, max around the mean. Default is
|
|
1.0 standard deviations. Both min and max can be defined independently
|
|
per weather element.</font></td>
|
|
</tr>
|
|
<tr>
|
|
<td>**stdDevMin</td>
|
|
<td>same as stdDevMinMax except just returns the minimum value</td>
|
|
</tr>
|
|
<tr>
|
|
<td>**stdDevMax</td>
|
|
<td>same as stdDevMinMax except just returns the maximum value</td>
|
|
</tr>
|
|
<tr>
|
|
<td><font color="#000000">stdDevFirstMinMax</font></td>
|
|
<td><font color="#000000">(min,max) </font> <br>
|
|
<font color="#000000">stdDevMinMax (see above) for the first grid
|
|
only</font></td>
|
|
</tr>
|
|
<tr>
|
|
<td>**moderatedAvg</td>
|
|
<td>Returns the average value after filtering based on percentage
|
|
defined in <i><font color="#993399">moderated_dict</font></i></td>
|
|
</tr>
|
|
<tr>
|
|
<td>**moderatedMinMax</td>
|
|
<td>(min, max) <br>
|
|
Returns the min and max values after filtering based on the percentage
|
|
defined in <i><font color="#993399">moderated_dict.</font></i></td>
|
|
</tr>
|
|
<tr>
|
|
<td>**moderatedMin</td>
|
|
<td>same as moderatedMinMax except just returns the minimum</td>
|
|
</tr>
|
|
<tr>
|
|
<td>**moderatedMax</td>
|
|
<td>same as moderatedMinMax except just returns the maximum</td>
|
|
</tr>
|
|
<tr>
|
|
<td>moderatedFirstAvg</td>
|
|
<td>same as moderatedAvg except only the first grid is sampled</td>
|
|
</tr>
|
|
<tr>
|
|
<td>moderatedFirstMinMax</td>
|
|
<td>same as moderatedMinMax except only the first grid is sampled.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>hourlyTemp </td>
|
|
<td>return hourly T values in tuples; returns a list of
|
|
tuples: (avgValue, startHour)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>binnedPercent</td>
|
|
<td>return a list of tuples representing bins and corresponding
|
|
percentages of values in each bin. The bins are defined in the <i>bins_dict.</i><font
|
|
color="#000000">NOTE: When using this method, make sure you have grids
|
|
covering the entire time range of interest so that the percentages
|
|
which
|
|
are time-weighted will add up to 100.</font></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</center>
|
|
<br>
|
|
|
|
<p><a name="VECTORWEATHERElements"></a><b>VECTOR WEATHER ELEMENTS</b> </p>
|
|
<p>Note: all vector directions are returned as numeric. You
|
|
can set the <i><font color="#993366">vectorDirection_algorithm </font></i>to
|
|
be "Average" or "MostFrequent". It will then apply to all vector
|
|
analysis methods.
|
|
</p>
|
|
<center>
|
|
<table nosave="" border="1" width="75%">
|
|
<caption>
|
|
<center></center>
|
|
<br>
|
|
</caption><tbody>
|
|
</tbody> <tbody>
|
|
<tr>
|
|
<td>**vectorAvg </td>
|
|
<td>(mag, dir) </td>
|
|
</tr>
|
|
<tr>
|
|
<td>**vectorMinMax</td>
|
|
<td>((minMag, maxMag), dir) </td>
|
|
</tr>
|
|
<tr>
|
|
<td>**vectorMin </td>
|
|
<td>(minMag, dir)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>**vectorMax</td>
|
|
<td>(maxMag, dir)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>vectorMagMinMax </td>
|
|
<td>(minMag, maxMag) </td>
|
|
</tr>
|
|
<tr>
|
|
<td>vectorMagMin</td>
|
|
<td>minMag </td>
|
|
</tr>
|
|
<tr>
|
|
<td>vectorMagMax</td>
|
|
<td>maxMag </td>
|
|
</tr>
|
|
<tr>
|
|
<td>**vectorMode </td>
|
|
<td>(mag, dir)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>**vectorMedian </td>
|
|
<td>(mag, dir) </td>
|
|
</tr>
|
|
<tr>
|
|
<td>**vectorModeRange </td>
|
|
<td>((minMag, maxMag), dir) </td>
|
|
</tr>
|
|
<tr>
|
|
<td>**vectorMedianRange</td>
|
|
<td>((minMag, maxMag), dir) </td>
|
|
</tr>
|
|
<tr>
|
|
<td>**vectorStdDevAvg</td>
|
|
<td>(mag, dir) </td>
|
|
</tr>
|
|
<tr>
|
|
<td>**vectorStdDevMinMax</td>
|
|
<td>((minMag, maxMag), dir) </td>
|
|
</tr>
|
|
<tr>
|
|
<td>**vectorStdDevMin </td>
|
|
<td>(minMag, dir)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>**vectorStdDevMax </td>
|
|
<td>(maxMag, dir)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>**vectorModeratedAvg</td>
|
|
<td>(mag, dir) </td>
|
|
</tr>
|
|
<tr>
|
|
<td>**vectorModeratedMinMax</td>
|
|
<td>((minMag, maxMag), dir) </td>
|
|
</tr>
|
|
<tr>
|
|
<td>**vectorModeratedMin </td>
|
|
<td>(minMag, dir)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>**vectorModeratedMax </td>
|
|
<td>(maxMag, dir)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>vectorRange</td>
|
|
<td>(mag1, mag2, dir1, dir2) <br>
|
|
returns mag and dir for two specified periods</td>
|
|
</tr>
|
|
<tr>
|
|
<td>vectorBinnedPercent</td>
|
|
<td>return a list of tuples representing bins and corresponding
|
|
percentages of magnitude values in each bin. The bins are defined in
|
|
the <i>bins_dict.</i><font color="#000000">NOTE: When using this
|
|
method, make sure you have grids
|
|
covering the entire time range of interest so that the percentages
|
|
which
|
|
are time-weighted will add up to 100.</font></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</center>
|
|
<p><a name="DISCRETEELEMENTS"></a><b>DISCRETE ELEMENTS</b> <br>
|
|
</p>
|
|
<center>
|
|
<table nosave="" border="1" width="75%">
|
|
<caption>
|
|
<center></center>
|
|
<br>
|
|
</caption><tbody>
|
|
</tbody> <tbody>
|
|
<tr nosave="">
|
|
<td nosave="">METHOD</td>
|
|
<td>RETURN VALUE</td>
|
|
<td>THRESHOLDS AND VARIABLES <br>
|
|
(To override, find in SampleAnalysis and copy to Overrides file)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>discreteTimeRangesByKey </td>
|
|
<td>List of (discreteKey, timeRange) pairs ordered in ascending
|
|
order by timeRange and then by priority of discrete keys as defined in
|
|
the serverConfig files.</td>
|
|
<td><i><font color="#993366">discreteKey_coverage_percentage</font></i><font
|
|
color="#000000">-- required coverage by discete key</font> <i><font
|
|
color="#993366"><br>
|
|
</font></i><font color="#000000"></font></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="vertical-align: top;">discreteTimeRangesByKey_withAux</td>
|
|
<td style="vertical-align: top;">Same as above, but including the
|
|
auxiliary field<br>
|
|
</td>
|
|
<td style="vertical-align: top;"><br>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>**dominantDiscreteValue</td>
|
|
<td>List of most common discrete keys ranked from most frequent
|
|
to least frequent. </td>
|
|
<td><i><font color="#993366">discreteKey_coverage_percentage</font></i><font
|
|
color="#000000">-- required coverage by discete key</font> <br>
|
|
<i><font color="#993366">dominantDiscreteKeys_threshold-</font></i><font
|
|
color="#000000">- maximum number of discrete keys to be returned from
|
|
dominantDiscreteValue<br>
|
|
</font><i><font color="#993366">cleanOutEmptyValues <span
|
|
style="color: rgb(51, 0, 51);"></span></font></i><font color="#993366"><span
|
|
style="color: rgb(51, 0, 51);">-- whether or not to leave <None>
|
|
values out of list of keys</span></font><br>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="vertical-align: top;">**dominantDiscreteValue_withAux</td>
|
|
<td style="vertical-align: top;">Same as above, but including the
|
|
auxiliary field</td>
|
|
<td style="vertical-align: top;"><br>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="vertical-align: top;">**rankedDiscreteValue</td>
|
|
<td style="vertical-align: top;">List of most common (discrete
|
|
keys, rank) pairs listed from most frequent
|
|
to least frequent. </td>
|
|
<td style="vertical-align: top;"><i><font color="#993366">discreteKey_coverage_percentage</font></i><font
|
|
color="#000000">-- required coverage by discete key</font> <br>
|
|
<i><font color="#993366">dominantDiscreteKeys_threshold-</font></i><font
|
|
color="#000000">- maximum number of discrete keys to be returned from
|
|
dominantDiscreteValue<br>
|
|
</font><i><font color="#993366">cleanOutEmptyValues <span
|
|
style="color: rgb(51, 0, 51);"></span></font></i><font color="#993366"><span
|
|
style="color: rgb(51, 0, 51);">-- whether or not to leave <None>
|
|
values out of list of keys (default 0)</span></font><br>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="vertical-align: top;">**rankedDiscreteValue_withAux</td>
|
|
<td style="vertical-align: top;">Same as above, but including the
|
|
auxiliary field<br>
|
|
</td>
|
|
<td style="vertical-align: top;"><br>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>discrete_percentages</td>
|
|
<td>list of (discrete key, percentage) pairs. Time-weighted
|
|
/ areal-weighted percentage is calculated for all overlapping grids</td>
|
|
<td>None</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="vertical-align: top;">discrete_percentages_withAux</td>
|
|
<td style="vertical-align: top;">Same as above, but including the
|
|
auxiliary field</td>
|
|
<td style="vertical-align: top;"><br>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</center>
|
|
<br>
|
|
|
|
<p><a name="WXElement"></a><b>WX ELEMENT</b> <br>
|
|
</p>
|
|
<center>
|
|
<table nosave="" border="1" width="75%">
|
|
<caption>
|
|
<center></center>
|
|
<br>
|
|
</caption><tbody>
|
|
</tbody> <tbody>
|
|
<tr nosave="">
|
|
<td nosave="">METHOD</td>
|
|
<td>RETURN VALUE</td>
|
|
<td>THRESHOLDS <br>
|
|
AND VARIABLES <br>
|
|
(To override, find in SampleAnalysis and copy to Overrides file)</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="vertical-align: top;">**rankedWx<br>
|
|
</td>
|
|
<td style="vertical-align: top;">list of (subkey, rank) pairs
|
|
found for a given time range. rank is based on temporal and areal
|
|
coverage of the subkey in the time range<br>
|
|
</td>
|
|
<td style="vertical-align: top;"><i><font color="#993366">coverage_weights_dict</font></i><font
|
|
color="#000000"> - weights per coverage term </font><br>
|
|
<i><font color="#993366">wxkey_coverage_percentage</font></i><font
|
|
color="#000000">-- areal coverage over the time period by weather key</font>
|
|
<br>
|
|
<i><font color="#993366">attribute_coverage_percentage</font></i><font
|
|
color="#000000">-- areal coverage over the time period for attributes</font><br>
|
|
<i><font color="#993366">dominantKeys_threshold-</font></i><font
|
|
color="#000000">- maximum number of weather keys to be returned from
|
|
dominantWx<br>
|
|
</font><i><font color="#993366">aggregateCov_algorithm </font></i><font
|
|
color="#000000">- can use highest ranked coverage or a weighted scheme<br>
|
|
</font><i><font color="#993366">cleanOutEmptyValues <span
|
|
style="color: rgb(51, 0, 51);"></span></font></i><font color="#993366"><span
|
|
style="color: rgb(51, 0, 51);">-- whether or not to leave <NoWx>
|
|
values out of list of keys (default 0)</span></font><br>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>**dominantWx </td>
|
|
<td>list of subkeys found for the given time range</td>
|
|
<td>same as rankedWx<font color="#000000"></font></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</center>
|
|
<h4> <a name="dominantWx"></a>Algorithm for rankedWx and dominantWx</h4>
|
|
The rankedWx and dominantWx algorithms use configurable thresholds and
|
|
weights to give you control over the weather that you choose to submit
|
|
to Text Rules for phrase generation. The only difference between
|
|
rankedWx and dominantWx is that the rankedWx method returns tuples of
|
|
(subkey, rank) pairs while the dominantWx method simply returns the
|
|
list of subkeys. The algorithm is as follows:
|
|
<ul>
|
|
<li>Throw out any grids that do not cover the <i><font
|
|
color="#993366">temporalCoverage_percentage </font></i>of the given
|
|
time range.</li>
|
|
<li>For each weather type in the grids, determine:</li>
|
|
<ul>
|
|
<li>an aggregate subkey</li>
|
|
<ul>
|
|
<li>coverage -- aggregate coverage algorithm can be chosen by
|
|
overriding "aggregateCov_algorithm" (SampleAnalysis). There are 2
|
|
choices:</li>
|
|
<ul>
|
|
<li>"getAggregateCov" chooses the highest ranked coverage
|
|
(default)<br>
|
|
</li>
|
|
<li>"getWeightedAggregateCov" favors stronger coverage
|
|
terms. <br>
|
|
</li>
|
|
</ul>
|
|
<li>intensity -- highest ranking OR if ranks are close, dominant</li>
|
|
<li>visibility -- lowest visibility</li>
|
|
<li>attributes -- aggregate of all occurrences</li>
|
|
</ul>
|
|
<li>a rank i.e. the percentage of areal coverage over the time
|
|
period. This raw rank is then weighted by the coverage term.<br>
|
|
</li>
|
|
</ul>
|
|
<li>Throw out any weather type that does not meet the <i><font
|
|
color="#993366">wxkey_coverage_percentage</font></i> except:</li>
|
|
<ul>
|
|
<li>If a weather subkey is designated "Primary" it will be the
|
|
aggregate subkey and will automatically be the highest ranked.</li>
|
|
</ul>
|
|
<ul>
|
|
<li>If a weather subkey is designated as "Mention", it will be the
|
|
aggregate subkey and will not be eliminated.<br>
|
|
</li>
|
|
</ul>
|
|
<li>Return the <i><font color="#993366">dominantKeys threshold</font></i>
|
|
number of weather subkeys sorted by rank, wxType, and coverage<br>
|
|
</li>
|
|
<li>For rankedWx, the computed rank is returned with each
|
|
subkey
|
|
<br>
|
|
</li>
|
|
</ul>
|
|
We use the rank when
|
|
combining subkeys and in weather phrasing and wording as follows:<br>
|
|
<br>
|
|
<div style="margin-left: 40px;"> def
|
|
rankFuzzFactor(self): <br>
|
|
# Used when combining
|
|
weather subkeys. <br>
|
|
# If the difference between
|
|
the subkey rankings is <br>
|
|
# less than this amount, the
|
|
subkeys will be combined and <br>
|
|
# the dominant coverage or
|
|
intensity will be chosen <br>
|
|
# <br>
|
|
# Also used in weather
|
|
wording to determine if <br>
|
|
# subkeys have significantly
|
|
different ranks. <br>
|
|
# If so, then wording such
|
|
as "possibly mixed with" or <br>
|
|
# "with pockets of" could be
|
|
used. <br>
|
|
# <br>
|
|
return 10 <br>
|
|
<div style="text-align: left;"><small><small></small></small><br>
|
|
</div>
|
|
</div>
|
|
For more information, see the section on <a href="#WEATHERKEYFILTERING">Weather
|
|
Phrasing.</a><br>
|
|
<h2><a name="TextRulesLibrariesforSimpleTableProducts"></a>Text
|
|
Rules Libraries for Simple Table Products</h2>
|
|
(To be supplied)
|
|
<h2><a name="TextRulesLibrariesforSmartTabularProducts"></a>Text
|
|
Rules Libraries for Smart Tabular Products</h2>
|
|
(To be supplied)
|
|
<h2><a name="TextRule"></a>Text Rules Libraries for Narrative Products</h2>
|
|
<h4> <a name="NarrativeTreeandPhraseBuilderInfrastructure"></a>Narrative
|
|
Tree and Phrase Builder Infrastructure</h4>
|
|
(to be supplied) <br>
|
|
|
|
<p>The Text Rules and all of it's inherited libraries can be found in
|
|
the Utilities window of the Define Text Products Dialog.
|
|
This section describes the threshold, variable and phrase methods in
|
|
the
|
|
TextRules libraries to support Narrative Products. This
|
|
information will help you customize your narrative product by looking
|
|
up
|
|
the phrases that are being generated in the "phraseList" of your
|
|
product
|
|
components. For each weather element (or combinations of weather
|
|
elements), we list Example Phrases, corresponding SampleAnalysis
|
|
methods, and Thresholds and variables you can set to customize the
|
|
phrase. <br>
|
|
</p>
|
|
<h4><a name="SettingDAYandNIGHTtimes"></a>Setting DAY and NIGHT
|
|
times</h4>
|
|
Most formatters work on the assumption that "daytime" is from 6 am to 6
|
|
pm local time and "nighttime" is 6 pm to 6 am the next day local
|
|
time. If you want to change that assumption, you can override the
|
|
following variables simply by including them in your local file:
|
|
<p>
|
|
def DAY(self): <br>
|
|
|
|
return 6 <br>
|
|
def
|
|
NIGHT(self): <br>
|
|
|
|
return 18 <br>
|
|
</p>
|
|
<h4><a name="Analysis-DrivenPhrases"></a>Analysis-Driven Phrases</h4>
|
|
Most phrase methods accept results from any SampleAnalysis method for
|
|
the appropriate data type (Scalar, Vector, Wx), and will report with an
|
|
appropriate temporal resolution. Some phrase methods are
|
|
expecting
|
|
certain statistics. In the tables below, if the statistics method
|
|
is starred, any temporal resolution is accepted -- otherwise only
|
|
what's shown.
|
|
<p>If a threshold or variable appears in <b><font color="#993366">bold</font>,
|
|
</b>then
|
|
it MUST be set in order for the phrase to appear. </p>
|
|
<h4><a name="ArgumentstoTextRulesClass"></a>Arguments to Narrative
|
|
Methods</h4>
|
|
The TextRules thresholds, variables, and methods take arguments which
|
|
contain useful information allowing you to return values based on
|
|
product type, edit area, weather element or time range. The
|
|
following table lists the arguments and shows how to access the
|
|
information they contain. <br>
|
|
<br>
|
|
|
|
<center><br>
|
|
<table nosave="" border="1" width="95%">
|
|
<caption>
|
|
<center></center>
|
|
<br>
|
|
</caption><tbody>
|
|
</tbody> <tbody>
|
|
<tr nosave="">
|
|
<td nosave="">ARGUMENT</td>
|
|
<td>DESCRIPTION</td>
|
|
<td>ACCESSING INFORMATION</td>
|
|
</tr>
|
|
<tr>
|
|
<td>tree</td>
|
|
<td>Narrative tree contains the structure and information for the
|
|
entire narrative product</td>
|
|
<td>tree.stats.get(elementName, timeRange, areaLabel, statLabel,
|
|
mergeMethod) -- allows you to get statistics e.g.
|
|
<p>stats = tree.stats.get("Wind", timeRange, "CO_Boulder",
|
|
"vectorMinMax", "List") </p>
|
|
<p>productTimeRange = tree.getTimeRange() <br>
|
|
productStartTime = productTimeRange.startTime()</p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>node</td>
|
|
<td>The node of the tree at which we are currently executing
|
|
methods.</td>
|
|
<td> The current time range: <br>
|
|
|
|
nodeTimeRange = node.getTimeRange() <br>
|
|
|
|
nodeStartTime = nodeTimeRange.startTime()
|
|
<p>The current edit area: <br>
|
|
|
|
node.getAreaLabel() </p>
|
|
<p>The current product component, name, definition, or
|
|
position: <br>
|
|
component
|
|
= node.getComponent() <br>
|
|
|
|
componentName = node.getComponentName() <br>
|
|
|
|
componentDef = component.get("definition") <br>
|
|
|
|
componentPosition = node.getComponentPosition() <br>
|
|
|
|
# tells it's position (1,2,3...) in the Narrative Definition </p>
|
|
<p>To see if the current edit area (which could be a Combination)
|
|
contains any of a list of edit areas: <br>
|
|
inlandWaters =
|
|
["TampaBayWaters"] <br>
|
|
if
|
|
self.currentAreaContains(tree, inlandWaters): <br>
|
|
|
|
# do special case for TampaBayWaters </p>
|
|
<p>The current phrase: <br>
|
|
|
|
node.getAncestor("name") <br>
|
|
Note: This will only work for a node within a "phrase" method. </p>
|
|
<p>The "getAncestor" method finds the first ancestor with the
|
|
given attribute and returns the attribute's value.</p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>elementName</td>
|
|
<td>Weather element name -- useful information for returning
|
|
threshold or variable values based on weather element</td>
|
|
<td><br>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</center>
|
|
<h4> <a name="CheckingforEdit"></a>Checking for Edit Areas</h4>
|
|
Sometimes you might want to check to see if you are processing a
|
|
particular edit area or set of edit areas. For example, if you
|
|
running a CWF product and setting a threshold for WindWaveHgt, you
|
|
might
|
|
want to know if you processing an "inland waters area" or
|
|
not. There is an EditAreaUtils library method to help you
|
|
do
|
|
this which is illustrated through the following example:
|
|
<p>
|
|
inlandWatersAreas = ["TampaBayWaters", "InlandWaters"] <br>
|
|
|
|
if self.currentAreaContains(tree, inlandWatersAreas): <br>
|
|
|
|
# Return a value for the inland waters areas <br>
|
|
|
|
else: <br>
|
|
|
|
# Return a value for the other areas </p>
|
|
<h4><a name="TextGlobals"></a>GLOBAL THRESHOLDS AND VARIABLES</h4>
|
|
To override these thresholds and variables, find them in the designated
|
|
library module and copy them into the Overrides product file. <br>
|
|
NOTE: There are many more thresholds and variables in the
|
|
ConfigVariables module which, to avoid redundancy, are not listed
|
|
here. Please refer to that module directly to learn of the many
|
|
ways you can customize the formatters.<br>
|
|
<center><br>
|
|
<table border="1" width="90%">
|
|
<caption>
|
|
<center></center>
|
|
<br>
|
|
</caption><tbody>
|
|
</tbody> <tbody>
|
|
<tr>
|
|
<td><font color="#000000">THRESHOLD OR VARIABLE</font></td>
|
|
<td>DESCRIPTION</td>
|
|
<td>LIBRARY</td>
|
|
</tr>
|
|
<tr>
|
|
<td><i><font color="#993366">phrase_descriptor_dict</font></i></td>
|
|
<td>Descriptor words for weather elements in phrases e.g. "North <i>winds</i>
|
|
5-10 mph."</td>
|
|
<td>ConfigVariables</td>
|
|
</tr>
|
|
<tr>
|
|
<td><i><font color="#993366">phrase_connector_dict</font></i></td>
|
|
<td>Connecting words in phrases e.g. "North winds 5-10 mph <i>becoming</i>20-25
|
|
mph.</td>
|
|
<td>ConfigVariables</td>
|
|
</tr>
|
|
<tr>
|
|
<td><i><font color="#993366">value_connector_dict</font></i></td>
|
|
<td>Connectors for ranges of values e.g. "North winds 5 <i>to</i>
|
|
10 mph."</td>
|
|
<td>ConfigVariables</td>
|
|
</tr>
|
|
<tr>
|
|
<td><i><font color="#993366">units_descriptor_dict</font></i></td>
|
|
<td>Words for units used in reporting data values e.g. "North
|
|
winds 5-10 <i>knots</i>."</td>
|
|
<td>ConfigVariables</td>
|
|
</tr>
|
|
<tr>
|
|
<td><i><font color="#993366">timePeriod_descriptor_list</font></i></td>
|
|
<td>Phrases for sub-ranges of a time period e.g. "Partly cloudy <i>in
|
|
the afternoon</i>."</td>
|
|
<td>TimeDescriptor</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="vertical-align: top;"><i><font color="#993366">scalar_difference_nlValue_dict</font></i></td>
|
|
<td style="vertical-align: top;">If the difference between scalar
|
|
values for 2 sub-periods is greater than or equal to this value, the
|
|
different values will be noted in the phrase.<br>
|
|
</td>
|
|
<td style="vertical-align: top;">ConfigVariables<br>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="vertical-align: top;"><i><font color="#993366">vector_mag_difference_nlValue_dict<br>
|
|
vector_dir_difference_nlValue_dict<br>
|
|
</font></i></td>
|
|
<td style="vertical-align: top;">If the difference between vector
|
|
values for 2 sub-periods is greater
|
|
than or equal to these values, the different values will be noted in
|
|
the
|
|
phrase.</td>
|
|
<td style="vertical-align: top;">ConfigVariables<br>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</center>
|
|
<h4> <a name="NARRATIVEPHRASES"></a>NARRATIVE PHRASES</h4>
|
|
The following tables list the various phrases definitions found in Text
|
|
Rules library modules and used by the standard text narrative text
|
|
products.
|
|
<h4><a name="SCALARWEATHERELEMENT"></a>SCALAR WEATHER ELEMENT PHRASES
|
|
-- ScalarPhrases module</h4>
|
|
<center><br>
|
|
<table border="1" height="100%" width="95%">
|
|
<caption>
|
|
<center></center>
|
|
<br>
|
|
</caption><tbody>
|
|
</tbody> <tbody>
|
|
<tr>
|
|
<td>ELEMENT</td>
|
|
<td>TEXT RULES <br>
|
|
METHOD</td>
|
|
<td>EXAMPLE PHRASES</td>
|
|
<td>SAMPLE <br>
|
|
ANALYSIS</td>
|
|
<td>THRESHOLDS AND VARIABLES <br>
|
|
(To override, find in ScalarPhrases or ConfigVariables and copy to
|
|
Overrides file)</td>
|
|
<td>ADD'L <br>
|
|
INFO</td>
|
|
</tr>
|
|
<tr>
|
|
<td><a name="Highlights"></a>Hazards</td>
|
|
<td><a name="makeHeadlinePhrases"></a>makeHeadlinesPhrases</td>
|
|
<td>.WINTER STORM WARNING IN EFFECT<br>
|
|
</td>
|
|
<td>No sampling by SampleAnalysis<br>
|
|
</td>
|
|
<td> <a href="#AllowedHazards">allowedHazards</a></td>
|
|
<td>Found in DiscretePhrases module</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Sky</td>
|
|
<td>sky_phrase</td>
|
|
<td>"Partly cloudy in the <br>
|
|
morning, then clearing."</td>
|
|
<td>Sky: <br>
|
|
**Scalar Stats <br>
|
|
**binnedPercent
|
|
<p>PoP: (optional) <br>
|
|
**Scalar Stats </p>
|
|
</td>
|
|
<td><i><font color="#993366">pop_sky_lower_threshold</font></i> <br>
|
|
<i><font color="#993366">clearing_threshold</font></i> <br>
|
|
<i><font color="#993366">sky_valueList</font></i> <br>
|
|
<i><font color="#993366">sky_value</font></i> <br>
|
|
<i><font color="#993366">areal_sky_flag</font></i> <br>
|
|
<i><font color="#993366">areal_sky_value<br>
|
|
areal_skyPercentage<br>
|
|
areal_skyRelatedWx<br>
|
|
</font></i> <i><font color="#993366">similarSkyWords_list</font></i>
|
|
<br>
|
|
<i><font color="#993366">reportIncreasingDecreasingSky_flag</font></i>
|
|
<br>
|
|
<i><font color="#993366">reportClearSkyForExtendedPeriod_flag</font></i></td>
|
|
<td><br>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>PoP</td>
|
|
<td>popMax_phrase</td>
|
|
<td>"Chance of <br>
|
|
snow 40 percent."</td>
|
|
<td>PoP: **maxAvg</td>
|
|
<td><i><font color="#993366">phrase_descriptor_dict</font> </i>for
|
|
"PoP" <br>
|
|
May use this method in the phrase_descriptor_dict: <br>
|
|
<i> <font color="#993366">areal_or_chance_pop_descriptor</font></i>
|
|
<br>
|
|
<i><font color="#993366">units_descriptor_dict </font></i>for
|
|
"percent" <br>
|
|
<i><font color="#993366">pop_lower_threshold</font></i> <br>
|
|
<i><font color="#993366">pop_upper_threshold</font></i> <br>
|
|
<i><font color="#993366">wxQualifiedPoP_flag <br>
|
|
matchToWxInfo_dict<br>
|
|
</font></i></td>
|
|
<td><br>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>MaxT <br>
|
|
MinT</td>
|
|
<td>reportTrends</td>
|
|
<td>"Warmer." <br>
|
|
"Much colder."</td>
|
|
<td>MaxT, MinT <br>
|
|
avg, minMax, <br>
|
|
stdDevMinMax</td>
|
|
<td><i><font color="#993366">reportTrends_valueStr </font></i><font
|
|
color="#000000">to set up thresholds for trend phrases</font> <br>
|
|
<font color="#000000">Phrases are based on 24 hour prior
|
|
statistics</font></td>
|
|
<td><br>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>MaxT <br>
|
|
MinT <br>
|
|
HeatIndex <br>
|
|
WindChill</td>
|
|
<td>extremeTemps_phrase</td>
|
|
<td>"Very hot." <br>
|
|
"Hot." <br>
|
|
"Bitterly cold."</td>
|
|
<td>MaxT, MinT, HeatIndex, WindChill: **ScalarStats</td>
|
|
<td><i><font color="#993366">heatIndex_threshold</font></i> <br>
|
|
<i><font color="#993366">windChill_threshold</font></i></td>
|
|
<td>This phrase may be used in place of "reportTrends"</td>
|
|
</tr>
|
|
<tr>
|
|
<td>MinT</td>
|
|
<td>lows_phrase</td>
|
|
<td>"Lows in the lower 40s to lower 50s."</td>
|
|
<td>MinT: <br>
|
|
minmax stdDevMinMax</td>
|
|
<td><i><font color="#993366">phrase_descriptor_dict </font></i>for
|
|
"lows" <br>
|
|
<i><font color="#993366">minimum_range_nlValue_dict</font></i> <br>
|
|
<i><font color="#993366">maximum_range_nlValue_dict</font></i> <br>
|
|
<i><font color="#993366">range_nlValue_dict</font></i> <br>
|
|
<i><font color="#993366">tempPhrase_exceptions</font></i> <br>
|
|
<i><font color="#993366">tempPhrase_boundary_dict</font></i></td>
|
|
<td>Only generated if Night time</td>
|
|
</tr>
|
|
<tr>
|
|
<td>MaxT</td>
|
|
<td>highs_phrase</td>
|
|
<td>"Highs in the upper 70s to lower 80s."</td>
|
|
<td>MaxT: <br>
|
|
minMax stdDevMinMax</td>
|
|
<td><i><font color="#993366">phrase_descriptor_dict </font></i>for
|
|
"highs" <br>
|
|
<i><font color="#993366">minimum_range_nlValue_dict</font></i> <br>
|
|
<i><font color="#993366">maximum_range_nlValue_dict</font></i> <br>
|
|
<i><font color="#993366">range_nlValue_dict</font></i> <br>
|
|
<i><font color="#993366">tempPhrase_exceptions</font></i> <br>
|
|
<i><font color="#993366">tempPhrase_boundary_dict</font></i></td>
|
|
<td>Only generated if Day time</td>
|
|
</tr>
|
|
<tr>
|
|
<td>MinT</td>
|
|
<td>lows_range_phrase</td>
|
|
<td>"Lows 45 to 50."</td>
|
|
<td>MinT: <br>
|
|
minMax stdDevMinMax</td>
|
|
<td><i><font color="#993366">phrase_descriptor_dict </font></i><font
|
|
color="#000000">for "lows"</font> <br>
|
|
<i><font color="#993366">minimum_range_nlValue_dict</font></i> <br>
|
|
<i><font color="#993366">maximum_range_nlValue_dict</font></i> <br>
|
|
<i><font color="#993366">range_nlValue_dict</font></i> <br>
|
|
<i><font color="#993366">value_connector_dict</font></i></td>
|
|
<td>Only generated if Night time</td>
|
|
</tr>
|
|
<tr>
|
|
<td>MaxT</td>
|
|
<td>highs_ range_phrase</td>
|
|
<td>"Highs 70 to 75."</td>
|
|
<td>MaxT: <br>
|
|
minmax stdDevMinMax</td>
|
|
<td><i><font color="#993366">phrase_descriptor_dict </font></i><font
|
|
color="#000000">for "highs"</font> <br>
|
|
<i><font color="#993366">minimum_range_nlValue_dict</font></i> <br>
|
|
<i><font color="#993366">maximum_range_nlValue_dict</font></i> <br>
|
|
<i><font color="#993366">range_nlValue_dict </font></i> <br>
|
|
<i><font color="#993366">value_connector_dict</font></i></td>
|
|
<td>Only generated if Day time</td>
|
|
</tr>
|
|
<tr>
|
|
<td>MinT</td>
|
|
<td>extended_lows <br>
|
|
_phrase</td>
|
|
<td>"Lows in the 40s." <br>
|
|
"Lows 55 to 65."</td>
|
|
<td>MinT: <br>
|
|
firstAvg</td>
|
|
<td><i><font color="#993366">extended _temp_range</font></i></td>
|
|
<td>C11 only</td>
|
|
</tr>
|
|
<tr>
|
|
<td>MaxT</td>
|
|
<td>extended_highs <br>
|
|
_phrase</td>
|
|
<td>"Highs in the 70s." <br>
|
|
"Highs 55 to 65."</td>
|
|
<td>MaxT: <br>
|
|
avg</td>
|
|
<td><i><font color="#993366">extended _temp_range</font></i></td>
|
|
<td>C11 only</td>
|
|
</tr>
|
|
<tr>
|
|
<td>T <br>
|
|
MinT <br>
|
|
MaxT</td>
|
|
<td>temp_trends</td>
|
|
<td>"Temperatures <br>
|
|
falling overnight."</td>
|
|
<td>T: hourlyTemp <br>
|
|
MinT and MaxT: <br>
|
|
avg, minMax, stdDevMinMax</td>
|
|
<td><i><font color="#993366">temp_trend_threshold</font></i></td>
|
|
<td>NOTE: There is an alternate method for "temp_trends_words" in
|
|
the ScalarPhrases module.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>SnowAmt <br>
|
|
</td>
|
|
<td>snow_phrase</td>
|
|
<td>"Snow accumulation 2 inches."
|
|
<p> </p>
|
|
</td>
|
|
<td>SnowAmt: accumMinMax <br>
|
|
</td>
|
|
<td><i><font color="#993366">phrase_descriptor_dict </font></i>for
|
|
"SnowAmt" <br>
|
|
<i><font color="#993366">units_descriptor_dict </font> </i>for
|
|
"inches" and "inch" <br>
|
|
<i><font color="#993366">pop_snow_lower_threshold</font></i> <br>
|
|
<i><font color="#993366">increment_dict </font></i><font
|
|
color="#000000">for "SnowAmt" </font><i><font color="#993366"></font></i><br>
|
|
</td>
|
|
<td><br>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>SnowAmt</td>
|
|
<td>descriptive_snow <br>
|
|
_phrase</td>
|
|
<td>"Moderate snow accumulations."</td>
|
|
<td>SnowAmt: accumMinMax</td>
|
|
<td><br>
|
|
</td>
|
|
<td><br>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="vertical-align: top;">StormTotalSnow<br>
|
|
</td>
|
|
<td style="vertical-align: top;">stormTotalSnow_phrase<br>
|
|
</td>
|
|
<td style="vertical-align: top;">"Storm total snow accumulation
|
|
around 9 inches."<br>
|
|
</td>
|
|
<td style="vertical-align: top;">StormTotalSnow:<br>
|
|
accumMinMax<br>
|
|
</td>
|
|
<td style="vertical-align: top;"><i><font color="#993366">phrase_descriptor_dict</font></i>for
|
|
"TotalSnow" <br>
|
|
<i><font color="#993366">units_descriptor_dict </font> </i>for
|
|
"inches" and "inch" <br>
|
|
<i><font color="#993366">pop_snow_lower_threshold</font></i> <br>
|
|
<i><font color="#993366">increment_dict </font></i><font
|
|
color="#000000">for "SnowAmt" </font></td>
|
|
<td style="vertical-align: top;"><br>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="vertical-align: top;">SnowAmt<br>
|
|
</td>
|
|
<td style="vertical-align: top;">total_snow_phrase<br>
|
|
</td>
|
|
<td style="vertical-align: top;">"Total snow accumulation 6
|
|
inches."<br>
|
|
</td>
|
|
<td style="vertical-align: top;">SnowAmt:<br>
|
|
accumMinMax<br>
|
|
</td>
|
|
<td style="vertical-align: top;"><i><font color="#993366">phrase_descriptor_dict</font></i>for
|
|
"SnowAmt" <br>
|
|
<i><font color="#993366">units_descriptor_dict </font> </i>for
|
|
"inches" and "inch" <br>
|
|
<i><font color="#993366">pop_snow_lower_threshold</font></i> <br>
|
|
<i><font color="#993366">getSnowReportEndDay</font></i> <br>
|
|
<i><font color="#993366">increment_dict </font></i><font
|
|
color="#000000">for "SnowAmt" </font></td>
|
|
<td style="vertical-align: top;"><br>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>SnowLevel</td>
|
|
<td>snowLevel_phrase</td>
|
|
<td>"Snow level 7600 feet."</td>
|
|
<td>SnowLevel: **ScalarStats</td>
|
|
<td><i><font color="#993366">phrase_descriptor_dict </font></i>for
|
|
"SnowLevel" <br>
|
|
<i><font color="#993366">units_descriptor_dict </font> </i>for
|
|
"feet" <br>
|
|
<i><font color="#993366">pop_snowLevel_upper_threshold</font></i>
|
|
<br>
|
|
<i><font color="#993366">snowLevel_maximum_phrase</font></i> <br>
|
|
<i><font color="#993366">snowLevel_upper_topo_percentage</font></i>
|
|
<br>
|
|
<i><font color="#993366">snowLevel_lower_topo_percentage</font></i>
|
|
<br>
|
|
<i><font color="#993366">increment_dict </font></i><font
|
|
color="#000000">for "SnowLevel"</font></td>
|
|
<td>Be sure and set the <i><font color="#993366">snowLevel_maximum_phrase</font></i>for
|
|
your local area</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="vertical-align: top;">IceAccum<br>
|
|
</td>
|
|
<td style="vertical-align: top;">iceAccumulation_phrase<br>
|
|
</td>
|
|
<td style="vertical-align: top;">"Ice accumulation of up to
|
|
one half inch."<br>
|
|
</td>
|
|
<td style="vertical-align: top;">IceAccum: accumMinMax<br>
|
|
</td>
|
|
<td style="vertical-align: top;"><i><font color="#993366">ice_accumulation_threshold<br>
|
|
phrase_descriptor_dict </font></i><font color="#000000">for "IceAccum"</font><br>
|
|
<i><font color="#993366">increment_dict </font></i><font
|
|
color="#000000">for "IceAccum"<br>
|
|
</font></td>
|
|
<td style="vertical-align: top;"><br>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>WindChill</td>
|
|
<td>windChill_phrase</td>
|
|
<td>"Wind chill readings 5 to 10."</td>
|
|
<td>WindChill: <br>
|
|
**ScalarStats <br>
|
|
T:minMax</td>
|
|
<td><i><font color="#993366">phrase_descriptor_dict</font> </i>for
|
|
"WindChill" <br>
|
|
<i><font color="#993366">windChill_threshold</font></i> <br>
|
|
<i><font color="#993366">windChillTemp_difference</font></i> <br>
|
|
<i><font color="#993366">windChill_range</font></i></td>
|
|
<td><br>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>WindChill</td>
|
|
<td>windBased_windChill_phrase</td>
|
|
<td>"Wind chill readings 5 to 10."</td>
|
|
<td>WindChill:**ScalarStats <br>
|
|
Wind: **VectorStats</td>
|
|
<td><i><font color="#993366">phrase_descriptor_dict</font> </i>for
|
|
"WindChill" <br>
|
|
<i><font color="#993366">windChill_threshold</font></i> <br>
|
|
<i><font color="#993366">windChill_wind_threshold</font></i> <br>
|
|
<i><font color="#993366">minimum_range_threshold_dict</font></i> <br>
|
|
<i><font color="#993366">range_threshold_dict</font></i> <br>
|
|
<i><font color="#993366">value_connector_dict</font></i> <br>
|
|
<i><font color="#993366">windChill_range</font></i></td>
|
|
<td>Checks against Wind instead of T</td>
|
|
</tr>
|
|
<tr>
|
|
<td>HeatIndex</td>
|
|
<td>heatIndex_phrase</td>
|
|
<td>"Heat index readings 10 to 15."</td>
|
|
<td>HeatIndex: <br>
|
|
**ScalarStats <br>
|
|
T: minMax</td>
|
|
<td><i><font color="#993366">phrase_descriptor_dict </font></i>for
|
|
"HeatIndex" <br>
|
|
<i><font color="#993366">heatIndex_threshold</font></i> <br>
|
|
<i><font color="#993366">heatIndexTemp_difference</font></i> <br>
|
|
<i><font color="#993366">minimum_range_threshold_dict</font></i> <br>
|
|
<i><font color="#993366">range_threshold_dict</font></i> <br>
|
|
<i><font color="#993366">value_connector_dict</font></i> <i><font
|
|
color="#993366"><br>
|
|
</font></i></td>
|
|
<td><br>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="vertical-align: top;">MinRH<br>
|
|
</td>
|
|
<td style="vertical-align: top;">rh_phrase<br>
|
|
</td>
|
|
<td style="vertical-align: top;">"Minimum RH 30 percent."<br>
|
|
</td>
|
|
<td style="vertical-align: top;">**ScalarStats MinRH<br>
|
|
</td>
|
|
<td style="vertical-align: top;"><i><font color="#993366">rh_threshold</font></i></td>
|
|
<td style="vertical-align: top;"><br>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</center>
|
|
<h4> <a name="WINDANDWINDGUST"></a>WIND AND WINDGUST PHRASES --
|
|
VectorRelatedPhrases module</h4>
|
|
<center><br>
|
|
<table border="1" width="95%">
|
|
<caption>
|
|
<center></center>
|
|
<br>
|
|
</caption><tbody>
|
|
</tbody> <tbody>
|
|
<tr>
|
|
<td>ELEMENT</td>
|
|
<td>TEXT RULES <br>
|
|
METHOD</td>
|
|
<td>EXAMPLE <br>
|
|
PHRASES</td>
|
|
<td>SAMPLE <br>
|
|
ANALYSIS</td>
|
|
<td>THRESHOLDS AND VARIABLES <br>
|
|
(To override, find in VectorRelatedPhrases or ConfigVariables and copy
|
|
to Overrides file)</td>
|
|
<td>ADD'L <br>
|
|
INFO</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Wind</td>
|
|
<td>wind_phrase</td>
|
|
<td>"Northeast winds 5 to 15 mph in the afternoon."
|
|
<p>"Southwest winds 5-15 mph." </p>
|
|
<p> </p>
|
|
</td>
|
|
<td>Wind: **Vector Stats</td>
|
|
<td><i><font color="#993366">phrase_descriptor_dict </font></i>for
|
|
"Wind" <br>
|
|
<i><font color="#993366">units_descriptor_dict </font></i>for
|
|
"mph" <br>
|
|
<i><font color="#993366">value_connector_dict </font></i>for
|
|
"Wind" e.g. 5 to 10 mph <br>
|
|
<i><font color="#993366">increment</font></i> for "Wind" e.g.
|
|
round wind magnitudes to nearest 5 <br>
|
|
<i><font color="#993366">null_nlValue_dict</font></i> <br>
|
|
<i><font color="#993366">first_null_phrase_dict</font></i> <br>
|
|
<i><font color="#993366">null_phrase_dict</font></i>
|
|
<p><i><font color="#993366">maximum_range_nlValue</font></i>for
|
|
"Wind" e.g. do not report winds with more than a 5 mph range e.g. 5 to
|
|
10 mph <br>
|
|
<font color="#993366"><i>minimum_range_nlValue</i> </font>for
|
|
"Wind" e.g. report winds with at least this range e.g. 5 to 10
|
|
mph </p>
|
|
<p>Differences used for reporting Wind in different time
|
|
periods: <br>
|
|
"Wind NE 20 to 35 mph in the morning becoming S 10 to 15 mph in the
|
|
afternoon." <br>
|
|
<i><font color="#993366">vector_mag_difference_nlValue_dict</font></i>
|
|
e.g. 10 mph <br>
|
|
<i><font color="#993366">vector_dir_difference_nlValue_dict </font></i>e.g.
|
|
60 degrees </p>
|
|
<p><i><font color="#993366">phrase_connector_dict </font></i>for
|
|
"becoming", "increasing to", "decreasing to", "shifting to the" </p>
|
|
<p><i><font color="#993366">embedded_vector_descriptor_flag_dict </font></i><font
|
|
color="#000000">-- default is 1 -- if 0, descriptor is first e.g. "<i>Winds</i>
|
|
east 5 to 10 mph."</font> </p>
|
|
<p><i><font color="#993366">include_timePeriod_descriptor_flag </font></i><font
|
|
color="#000000"> -- moderates the time qualification on the phrase
|
|
e.g.
|
|
"in the afternoon"</font> <br>
|
|
<i><font color="#993366">marine_wind_flag</font></i></p>
|
|
</td>
|
|
<td>mph</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Wind</td>
|
|
<td>wind_withGust_phrase</td>
|
|
<td>"East winds 10 to 20 mph with gusts to around 70 mph in the
|
|
night becoming southwest 5 to 10 mph in the early morning."</td>
|
|
<td>Wind: **Vector Stats for Wind <br>
|
|
Wind: **Vector MinMax (must be there as a secondary analysis method for
|
|
comparison in the gust_phrase) <br>
|
|
WindGust: <br>
|
|
**Scalar Stats </td>
|
|
<td>Same as above PLUS: <br>
|
|
<i><font color="#993366">phrase_descriptor_dict </font></i>
|
|
for "WindGust" <br>
|
|
<i><font color="#993366">gust_threshold </font></i><font
|
|
color="#000000">-- gusts reported if above this threshold</font> <br>
|
|
<i><font color="#993366">gust_wind_difference_threshold </font></i><font
|
|
color="#000000">-- gust reported if difference between max Wind and
|
|
WindGust is greater than this threshold</font> <br>
|
|
<i><font color="#993366">useWindsForGusts_flag </font></i><font
|
|
color="#000000">-- if a WindGust grid is not found, the absolute max
|
|
wind will be used for gusts</font></td>
|
|
<td>mph</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Wind</td>
|
|
<td>marine_wind_phrase</td>
|
|
<td>"West winds 10 to 20 knots in the morning shifting to the
|
|
southwest in the afternoon."</td>
|
|
<td>**Vector Stats</td>
|
|
<td>Same as for public_windRange_phrase except <i><font
|
|
color="#993366">units_descriptor_dict </font></i>for "kt" <br>
|
|
<i><font color="#993366">marine_wind_flag</font> </i>set to 1
|
|
for
|
|
marine descriptors e.g. gales, storm force winds <br>
|
|
<b><i><font color="#993366">seaBreeze_thresholds </font></i></b><font
|
|
color="#000000">and local effects areas (see below)</font> <br>
|
|
<i><font color="#993366">marine_wind_descriptor</font> </i>for
|
|
"Wind" <br>
|
|
<i><font color="#993366">phrase_connector_dict </font></i>for
|
|
"becoming", "rising to", "easing to", "veering", "backing",
|
|
"becoming onshore" <br>
|
|
<i><font color="#993366">useWindsForGusts_flag </font></i><font
|
|
color="#000000">-- if a WindGust grid is not found, the absolute max
|
|
wind will be used for gusts</font></td>
|
|
<td>knots
|
|
<p>See description for SeaBreeze below</p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Wind</td>
|
|
<td>marine_wind <br>
|
|
_withGusts_phrase</td>
|
|
<td>"East winds 10 to 20 knots with gusts to around 70 knots in
|
|
the night veering southwest 5 to 10 knots in the early morning."</td>
|
|
<td>Wind: **Vector Stats <br>
|
|
Wind: **Vector MinMax (must be there for comparision in the Gust
|
|
phrase) <br>
|
|
WindGust: <br>
|
|
**ScalarStats </td>
|
|
<td>Same as above PLUS <br>
|
|
<i><font color="#993366">phrase_descriptor_dict </font></i>for
|
|
"WindGust" <br>
|
|
<i><font color="#993366">gust_threshold </font></i><font
|
|
color="#000000">-- gust reported if above this threshold</font> <br>
|
|
<i><font color="#993366">gust_wind_difference_threshold</font></i><font
|
|
color="#000000">-- gust reported if difference between max Wind and
|
|
WindGust is greater than this threshold</font></td>
|
|
<td>knots</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Wind</td>
|
|
<td>lake_wind_phrase</td>
|
|
<td>"Caution advised on area lakes."</td>
|
|
<td>Wind: **Vector Stats</td>
|
|
<td><b><i><font color="#993366">lake_wind_areaNames</font></i></b>
|
|
<br>
|
|
<i><font color="#993366">phrase_descriptor _dict </font></i>for
|
|
"lakeWinds" <br>
|
|
<i><font color="#993366">lake_wind_thresholds</font></i></td>
|
|
<td><br>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Wind</td>
|
|
<td>wind_summary</td>
|
|
<td>"Breezy" "Windy"</td>
|
|
<td>Wind: **Vector Stats</td>
|
|
<td><i><font color="#993366">vector_summary_valueStr</font></i></td>
|
|
<td><br>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>WindGust</td>
|
|
<td>gust_phrase</td>
|
|
<td>"Gusts up to 70 mph."</td>
|
|
<td>WindGust: **Scalar Stats</td>
|
|
<td><i><font color="#993366">phrase_descriptor_dict </font></i>for
|
|
"WindGust" <br>
|
|
<i><font color="#993366">gust_threshold</font></i> <br>
|
|
<i><font color="#993366">null_nlValue_dict</font></i> <br>
|
|
<i><font color="#993366">first_null_phrase_dict</font></i> <br>
|
|
<i><font color="#993366">null_phrase_dict</font></i>
|
|
<p><i><font color="#993366">gust_wind_difference_nlValue </font></i><font
|
|
color="#000000">-- gust reported if difference between max Wind and
|
|
WindGust is greater than this threshold</font> <br>
|
|
<i><font color="#993366">scalar_difference_nlValue_dict</font></i><font
|
|
color="#000000"> -- for "WindGust": if gusts for 2 consecutive
|
|
sub-ranges differ by more than this amount, they will be reported
|
|
separately.</font> <br>
|
|
<i><font color="#993366">include_timePeriod_descriptor_flag </font></i><font
|
|
color="#000000"> -- moderates the time qualification on the phrase
|
|
e.g.
|
|
"in the afternoon"</font></p>
|
|
</td>
|
|
<td><br>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</center>
|
|
<h4> <a name="SeaBreeze"></a>Sea Breeze Identification</h4>
|
|
Sea breezes can be identified to produce phrases such as the following:
|
|
<p> NW winds 15 to 25
|
|
knots <i>becoming onshore</i> 10 to 15 knots. </p>
|
|
<p>To set up sea breeze indentification, you need to: </p>
|
|
<ul>
|
|
<li>Create the following named edit areas from the GFE GUI:</li>
|
|
<ul>
|
|
<li>OffShoreArea -- offshore area</li>
|
|
<li>OnShoreArea -- onshore area</li>
|
|
|
|
</ul>
|
|
<li> Override the product component definition to include the
|
|
"intersectAreas" for Wind. For example:</li>
|
|
</ul>
|
|
<font color="#006600">
|
|
def CWFPeriod(self):</font>
|
|
<ul>
|
|
<font color="#006600">
|
|
return {</font> <br>
|
|
<font color="#006600">
|
|
"type": "component",</font> <br>
|
|
<font color="#006600">
|
|
"methodList": [</font> <br>
|
|
<font color="#006600">
|
|
self.assemblePhrases,</font> <br>
|
|
<font color="#006600">
|
|
self.wordWrap,</font> <br>
|
|
<font color="#006600">
|
|
],</font> <br>
|
|
<font color="#006600">
|
|
"analysisList": [</font> <br>
|
|
<font color="#006600">
|
|
# Split time range in quarters for Wind and WindGust</font> <br>
|
|
<font color="#006600">
|
|
("Wind", self.vectorModeratedMinMax, [3]),</font> <br>
|
|
<font color="#006600">
|
|
("Wind", self.vectorMinMax, [12]),</font> <br>
|
|
<font color="#006600">
|
|
("WindGust", self.maximum, [3]),</font> <br>
|
|
<font color="#006600">
|
|
("WaveHeight", self.minMax, [6]),</font> <br>
|
|
<font color="#006600">
|
|
("WindWaveHgt", self.minMax, [6]),</font> <br>
|
|
<font color="#006600">
|
|
# Split time range in half for Wx and Swell</font> <br>
|
|
<font color="#006600">
|
|
("Wx", self.rankedWx, [6]),</font> <br>
|
|
<font color="#006600">
|
|
("Swell", self.vectorMinMax, [6]),</font> <br>
|
|
<font color="#006600">
|
|
("Swell2", self.vectorMinMax, [6]),</font> <br>
|
|
<font color="#006600">
|
|
("Period", self.avg, [6]),</font> <br>
|
|
<font color="#006600">
|
|
("Period2", self.avg, [6]),</font> <br>
|
|
<font color="#006600">
|
|
],</font>
|
|
<p><font color="#006600">
|
|
"phraseList":[</font> <br>
|
|
<font color="#006600">
|
|
# WINDS</font> <br>
|
|
<font color="#006600">
|
|
self.marine_wind_withGusts_phrase,</font> <br>
|
|
<font color="#006600">
|
|
# Alternative:</font> <br>
|
|
<font color="#006600">
|
|
#self.marine_wind_phrase,</font> <br>
|
|
<font color="#006600">
|
|
#self.gust_phrase,</font> <br>
|
|
<font color="#006600">
|
|
# WAVES</font> <br>
|
|
<font color="#006600">
|
|
self.wave_withPeriods_phrase,</font> <br>
|
|
<font color="#006600">
|
|
# Alternative:</font> <br>
|
|
<font color="#006600">
|
|
#self.wave_phrase,</font> <br>
|
|
<font color="#006600">
|
|
# Optional:</font> <br>
|
|
<font color="#006600">
|
|
self.chop_phrase,</font> <br>
|
|
<font color="#006600">
|
|
# WEATHER</font> <br>
|
|
<font color="#006600">
|
|
self.weather_phrase,</font> <br>
|
|
<font color="#006600">
|
|
# SWELLS AND PERIODS</font> <br>
|
|
<font color="#006600">
|
|
self.swell_withPeriods_phrase,</font> <br>
|
|
<font color="#006600">
|
|
# Alternative:</font> <br>
|
|
<font color="#006600">
|
|
#self.swell_phrase,</font> <br>
|
|
<font color="#006600">
|
|
#self.period_phrase,</font> <br>
|
|
<font color="#006600">
|
|
],</font> </p>
|
|
<p><font color="#663366">
|
|
"intersectAreas" :[</font> <br>
|
|
<font color="#663366">
|
|
("Wind", ["OffShoreArea", "OnShoreArea"]),</font> <br>
|
|
<font color="#663366">
|
|
],</font> </p>
|
|
<p> <font
|
|
color="#006600"> }</font> <br>
|
|
</p>
|
|
<li>Override the <i><font color="#993366">seaBreeze_thresholds</font></i>
|
|
(found in ConfigVariables) appropriately for your areas to identify the
|
|
offshore and onshore wind directions that indicate a sea breeze.
|
|
If the magnitude is constant throughout the period AND if the offshore
|
|
winds are between offshoreDirection1 and
|
|
offshoreDirection2 during the first part of the period AND the onshore
|
|
winds are between onshoreDirection1 and onshoreDirection2 during the
|
|
next part of the period, the <i>becoming onshore</i> wording is used.
|
|
For example, if you set OffShoreArea for Hours 1-6 to 1020 and
|
|
OnShoreArea for Hours 7-12 to 2420, you will get the desired wording.<br>
|
|
</li>
|
|
</ul>
|
|
<h4> <a name="WEATHER"></a>WEATHER PHRASES -- WxPhrases module</h4>
|
|
<center><br>
|
|
<table border="1" width="95%">
|
|
<caption>
|
|
<center></center>
|
|
<br>
|
|
</caption><tbody>
|
|
</tbody> <tbody>
|
|
<tr>
|
|
<td>ELEMENT</td>
|
|
<td>TEXT RULES <br>
|
|
METHOD</td>
|
|
<td>EXAMPLE <br>
|
|
PHRASES</td>
|
|
<td>SAMPLE <br>
|
|
ANALYSIS</td>
|
|
<td>THRESHOLDS AND VARIABLES <br>
|
|
(To override, find in WxPhrases, PhraseBuilder, or
|
|
ConfigVariables and copy to
|
|
Overrides
|
|
file)</td>
|
|
<td>ADD'L <br>
|
|
INFO</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Wx</td>
|
|
<td>weather_phrase</td>
|
|
<td><br>
|
|
</td>
|
|
<td>Wx: **rankedWx</td>
|
|
<td>Pop/Wx Consistency<br>
|
|
<i><font color="#993366">coveragePoP_value<br>
|
|
</font></i><i><font color="#993366">pop_related_flag</font></i> <br>
|
|
<i><font color="#993366">pop_wx_lower_threshold </font></i>pop-related
|
|
Wx types are not reported if PoP is below this threshold <br>
|
|
<br>
|
|
Combining and consolidating<br>
|
|
<p><i><font color="#993366">filter_subkeys_flag </font></i><font
|
|
color="#000000">set to filter subkeys by combining duplicates and
|
|
similar Wx types as specified in:</font> <br>
|
|
<font color="#993366"><i>wxCombinations</i> </font>Wx types
|
|
WITHIN sub-phrases can
|
|
be combined to prevent redundant reporting e.g. combine "R" and "RW" to
|
|
prevent: "Scattered rain showers and rain." <br>
|
|
<font color="#993366"><i>similarWxTypes, similarIntensities,
|
|
similarCoverages, similarCoverageLists</i></font>
|
|
Used when combining weather subkeys ACROSS sub-phrases for
|
|
weather phrases and for
|
|
determining local effects.<br>
|
|
<i><font color="#993366">wxHierarchies</font> </i>Used
|
|
when sorting weather subkeys into dominant coverage or weather type
|
|
order.</p>
|
|
<p>Wording<i><font color="#993366"><br>
|
|
</font></i><i><font color="#993366">useSimple<br>
|
|
subPhrase_limit<br>
|
|
</font></i></p>
|
|
<p><i><font color="#993366">rankFuzzFactor </font></i>(CommonUtils)<br>
|
|
<i><font color="#993366">precip_related_flag</font></i> <br>
|
|
<i><font color="#993366">wxTypeDescriptors</font></i> <br>
|
|
<i><font color="#993366">wxIntensityDescriptors<br>
|
|
wxAttributeDescriptors<br>
|
|
</font></i></p>
|
|
<p><i><font color="#993366">rankWordingFuzzFactor<br>
|
|
possiblyMixedWith<br>
|
|
mixedWith<br>
|
|
withPocketsOf<br>
|
|
wxConjunction<br>
|
|
</font></i><br>
|
|
Visibility<br>
|
|
<i><font color="#993366">null_nlValue </font></i><font
|
|
color="#000000">for "Visibility"</font> <br>
|
|
<i><font color="#993366">embedded_visibility_flag</font></i> <br>
|
|
<i><font color="#993366">visibility_weather_phrase_nlValue</font></i>
|
|
<br>
|
|
<i><font color="#993366">element_outUnits_dict</font></i><font
|
|
color="#000000"> for "Visibility"</font><br>
|
|
<i><font color="#993366">visibility_wx_threshold</font></i> <br>
|
|
<i><font color="#993366">significant_wx_visibility_subkeys</font></i>
|
|
</p>
|
|
<p><i><font color="#993366">include_timePeriod_descriptor_flag </font></i><font
|
|
color="#000000"> -- moderates the time qualification on the phrase
|
|
e.g.
|
|
"in the afternoon"</font></p>
|
|
</td>
|
|
<td>See section below on the meaning of <a
|
|
href="#Weather_Key_Attributes_Primary_and">Weather Subkey Attributes
|
|
"Primary" and "Mention."</a><br>
|
|
<br>
|
|
See section below on <a href="#CustomizingWeatherPhrases">Customizing
|
|
Weather Phrases</a>
|
|
<p>See the section on <a href="#HANDLINGVISIBILITY">Handling
|
|
Visibility</a></p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Wx</td>
|
|
<td>severeWeather_phrase</td>
|
|
<td>"Some thunderstorms may be severe."<br>
|
|
"Some storms could be severe with damaging hail."<br>
|
|
"Some storms could be severe with large hail and damaging winds
|
|
possible."<br>
|
|
<br>
|
|
</td>
|
|
<td>Wx:**rankedWx</td>
|
|
<td> <br>
|
|
</td>
|
|
<td>Reports if there is T+ in the time period. <br>
|
|
Also reports large hail and damaging winds.<br>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Wx</td>
|
|
<td>heavyPrecip_phrase</td>
|
|
<td>"Rain may be heavy at times." <br>
|
|
"Locally heavy rainfall possible." <br>
|
|
"Snow may be heavy at times."</td>
|
|
<td>Wx: **rankedWx</td>
|
|
<td><i><font color="#993366">phrase_descriptor_dict </font></i>for
|
|
"heavyRainfall", "heavyRain", "heavySnow", "heavyPrecip"<br>
|
|
<i><font color="#993366">heavySnowTypes<br>
|
|
heavyOtherTypes </font></i><br>
|
|
</td>
|
|
<td>Reports if intensity is + for R, RW, S, SW,<br>
|
|
IP, ZR, ZL, L<br>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="vertical-align: top;">Wx<br>
|
|
</td>
|
|
<td style="vertical-align: top;">heavyRain_phrase<br>
|
|
</td>
|
|
<td style="vertical-align: top;">"Locally heavy rain possible."<br>
|
|
</td>
|
|
<td style="vertical-align: top;">Wx: **rankedWx</td>
|
|
<td style="vertical-align: top;"><i><font color="#993366">phrase_descriptor_dict </font></i>for
|
|
"heavyRains"</td>
|
|
<td style="vertical-align: top;">Reports if T has attribute HvyRn<br>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Wx</td>
|
|
<td>visibility_phrase</td>
|
|
<td>"Visibility less than 1 nautical mile."</td>
|
|
<td>Wx: **rankedWx</td>
|
|
<td><i><font color="#993366">null_nlValue </font></i><font
|
|
color="#000000">for "Visibility" below which visibility is not reported</font>
|
|
<br>
|
|
<i><font color="#993366">phrase_descriptor </font></i><font
|
|
color="#000000">for "Visibility"</font> <br>
|
|
<i><font color="#993366">increment_nlValue </font></i><font
|
|
color="#000000">for "Visibility"</font> <br>
|
|
<i><font color="#993366">visibility_phrase_nlValue</font></i> <br>
|
|
<i><font color="#993366">element_outUnits_dict</font></i><font
|
|
color="#000000"> for "Visibility"</font></td>
|
|
<td>See the section on <a href="#HANDLINGVISIBILITY">Handling
|
|
Visibility</a></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</center>
|
|
<br>
|
|
<h4><a name="Weather_Key_Attributes_Primary_and"></a>Weather Subkey
|
|
Attributes "Primary" and "Mention"</h4>
|
|
Many weather subkeys can have attributes of "Primary" and "Mention"
|
|
which allow the forecaster to influence the resulting words as follows:<br>
|
|
<ul>
|
|
<li>"Primary": If a subkey is marked as "Primary," it will
|
|
appear as the dominant weather subkey in the weather wording. </li>
|
|
<li>"Mention": If a subkey is marked as "Mention," it will
|
|
appear in the weather wording regardless of its temporal/areal
|
|
coverage. Otherwise, subkeys that do not meet the coverage
|
|
requirements (as defined by the "wxkey_coverage_percent") are
|
|
eliminated from the wording. So, for example, the
|
|
wxkey_coverage_percent for IP is 15% so that if we have just 1 hour of
|
|
IP in a 12-hour period, it will not be mentioned in the wording.
|
|
However, if this subkey is given an attribute of "Mention," it will not
|
|
be eliminated and will appear in the wording. This gives the forecaster
|
|
the ability to supercede the coverage thresholds. </li>
|
|
</ul>
|
|
<h4><a name="CustomizingWeatherPhrases"></a>Customizing Weather
|
|
Phrases
|
|
</h4>
|
|
You can override the "wxCoverageDescriptors", "wxTypeDescriptors" ,
|
|
"wxIntensityDescriptors" , and "wxAttributeDescriptors" in your
|
|
Overrides
|
|
file to customize the wording for weather types, coverages,
|
|
intensities, and attributes. For example, the following default
|
|
settings express very light rain and snow showers as "sprinkles" and
|
|
"flurries", respectively.
|
|
<p> <font color="#006600"> def wxTypeDescriptors(self):</font>
|
|
<br>
|
|
<font color="#006600"> # This
|
|
is the list of coverages, wxTypes, intensities, attributes for which
|
|
special</font> <br>
|
|
<font color="#006600"> #
|
|
weather type wording is desired. Wildcards (*) can be used to
|
|
match any value.</font> <br>
|
|
<font color="#006600"> # If a
|
|
weather subkey is not found in this list, default wording</font> <br>
|
|
<font color="#006600"> # will
|
|
be used from the Weather Definition in the server.</font> <br>
|
|
<font color="#006600"> # The
|
|
format of each tuple is:</font> <br>
|
|
<font color="#006600">
|
|
# (coverage, wxType, intensity, attribute,
|
|
weatherType
|
|
descriptor)</font> <br>
|
|
<font color="#006600"> return
|
|
[</font> <br>
|
|
<font color="#006600">
|
|
("*", "RW", "--", "*", "sprinkles"),</font> <br>
|
|
<font color="#006600">
|
|
("*", "SW", "--", "*", "flurries"),</font> <br>
|
|
<font color="#006600">
|
|
]</font> </p>
|
|
<p>In many cases, more than one of these methods will have to be
|
|
overridden to accomplish the desired result. We might have to
|
|
"turn on" one kind of wording and "turn off" other default wording. In
|
|
the above example, we have to "turn off" the default descriptor for
|
|
"very light" using the wxIntensityDescriptors: </p>
|
|
<p><font color="#006600"> def
|
|
wxIntensityDescriptors(self):</font> <br>
|
|
<font color="#006600"> # This
|
|
is the list of coverages, wxTypes, intensities, attribute for which
|
|
special</font> <br>
|
|
<font color="#006600"> #
|
|
weather intensity wording is desired. Wildcards (*) can be used
|
|
to
|
|
match any value.</font> <br>
|
|
<font color="#006600"> # If a
|
|
weather subkey is not found in this list, default wording</font> <br>
|
|
<font color="#006600"> # will
|
|
be used from the Weather Definition in the server.</font> <br>
|
|
<font color="#006600"> # The
|
|
format of each tuple is:</font> <br>
|
|
<font color="#006600">
|
|
# (coverage, wxType, intensity, attribute, intensity
|
|
descriptor)</font> <br>
|
|
<font color="#006600"> return
|
|
[</font> <br>
|
|
<font color="#330033">
|
|
("*", "RW", "--", "*", ""),</font> <br>
|
|
<font color="#330033"> </font><font color="#006600">
|
|
("*", "RW", "-", "*", ""),</font> <br>
|
|
<font color="#006600">
|
|
("*", "R", "--", "*", "very light"),</font> <br>
|
|
<font color="#006600">
|
|
("*", "R", "-", "*", "light"),</font> <br>
|
|
<font color="#006600">
|
|
("*", "R", "+", "*", "heavy"),</font> <br>
|
|
<font color="#006600">
|
|
("*", "RW", "+", "*", "heavy"),</font> <br>
|
|
<font color="#663366"> </font><font color="#330033">
|
|
("*", "SW", "--", "*", ""),</font> <br>
|
|
<font color="#330033"> </font><font color="#006600">
|
|
("*", "SW", "-", "*", ""),</font> <br>
|
|
<font color="#006600">
|
|
("*", "SW", "+", "*", "heavy"),</font> <br>
|
|
<font color="#006600">
|
|
("*", "S", "--", "*", "very light"),</font> <br>
|
|
<font color="#006600">
|
|
("*", "S", "-", "*", "light"),</font> <br>
|
|
<font color="#006600">
|
|
("*", "S", "+", "*", "heavy"),</font> <br>
|
|
<font color="#006600">
|
|
("*", "ZR", "--", "*", "light"),</font> <br>
|
|
<font color="#006600">
|
|
("*", "ZR", "+", "*", "heavy"),</font> <br>
|
|
<font color="#006600">
|
|
("*", "L", "*", "*", ""),</font> <br>
|
|
<font color="#006600">
|
|
("*", "F", "+", "*", "dense"),</font> <br>
|
|
<font color="#006600">
|
|
]</font> </p>
|
|
<p>Suppose we want to report "heavy snow" as "snow...heavy at times",
|
|
we would include the following in our Overrides file: </p>
|
|
<p> <font color="#006600"> def wxTypeDescriptors(self):</font>
|
|
<br>
|
|
<font color="#006600">
|
|
list = TextRules.TextRules.wxTypeDescriptors(self)</font> <br>
|
|
<font color="#006600">
|
|
list.append( </font><font color="#663366">("*", "S", "+", "*",
|
|
"snow...heavy at times") </font><font color="#006600">)</font> <br>
|
|
<font color="#009900"> </font><font color="#006600">
|
|
return list</font> </p>
|
|
<p><font color="#006600"> def
|
|
wxIntensityDescriptors(self):</font> <br>
|
|
<font color="#006600">
|
|
list = TextRules.TextRules.wxIntensityDescriptors(self)</font> <br>
|
|
<font color="#006600">
|
|
list.append( </font><font color="#663366">("*", "S", "+", "")</font> <br>
|
|
<font color="#009900"> </font><font color="#006600">
|
|
return list</font> </p>
|
|
<p>As another example, suppose we want to describe thunderstorms with
|
|
an attribute of "dry" as "dry thunderstorms." Including the
|
|
following in our Overrides file could accomplish this: </p>
|
|
<p> <font color="#006600"> def wxTypeDescriptors(self):</font>
|
|
<br>
|
|
<font color="#006600">
|
|
list = TextRules.TextRules.wxTypeDescriptors(self)</font> <br>
|
|
<font color="#006600">
|
|
list.append( </font><font color="#663366">("*", "T", "*", "Dry", "dry
|
|
thunderstorms") </font><font color="#006600">)</font> <br>
|
|
<font color="#009900"> </font><font color="#006600">
|
|
return list</font> </p>
|
|
<p> <font color="#006600"> def
|
|
wxAttributeDescriptors(self):</font> <br>
|
|
<font color="#006600">
|
|
list = TextRules.TextRules.wxAttributeDescriptors(self)</font> <br>
|
|
<font color="#006600">
|
|
list.append( </font><font color="#663366">("*", "T", "*", "Dry", "") </font><font
|
|
color="#006600">)</font> <br>
|
|
<font color="#009900"> </font><font color="#006600">
|
|
return list</font> </p>
|
|
<p>It is possible to specify a method instead of text string for the
|
|
descriptor. For example, the default wxTypeDescriptor for rain
|
|
showers uses a method as follows: </p>
|
|
<p><font color="#006600"> def wxTypeDescriptors(self):</font>
|
|
<br>
|
|
<font color="#006600"> return
|
|
[</font> <br>
|
|
<font color="#006600">
|
|
("*", "SW", "--", "*", "flurries"),</font> <br>
|
|
<font color="#006600">
|
|
("*", "RW", "*", "*", self.rainShowersDescriptor),</font> <br>
|
|
<font color="#006600">
|
|
]</font> </p>
|
|
<p><font color="#006600"> def
|
|
rainShowersDescriptor(self, tree, node, subkey):</font> <br>
|
|
<font color="#006600"> if
|
|
subkey.intensity() == "--":</font> <br>
|
|
<font color="#006600">
|
|
return "sprinkles"</font> <br>
|
|
<font color="#006600"> if
|
|
tree is None:</font> <br>
|
|
<font color="#006600">
|
|
return "showers"</font> <br>
|
|
<font color="#006600"> t =
|
|
tree.stats.get(</font> <br>
|
|
<font color="#006600">
|
|
"T", node.getTimeRange(),</font> <br>
|
|
<font color="#006600">
|
|
node.getAreaLabel(), statLabel="minMax",</font> <br>
|
|
<font color="#006600">
|
|
mergeMethod="Min")</font> <br>
|
|
<font color="#006600"> if t
|
|
is None:</font> <br>
|
|
<font color="#006600">
|
|
return "showers"</font> <br>
|
|
<font color="#006600"> if t
|
|
< 40:</font> <br>
|
|
<font color="#006600">
|
|
return "rain showers"</font> <br>
|
|
<font color="#006600"> else:</font>
|
|
<br>
|
|
<font color="#006600">
|
|
return "showers"</font> </p>
|
|
<p>These methods are used in Table products as well as
|
|
Narratives. NOTE: IF you are working with a narrative
|
|
product, you can include the "tree, node" arguments and use them to
|
|
qualify your customizations. For example, we could check the node
|
|
time range and qualify fog as "morning fog" as in the example below: </p>
|
|
<p><font color="#006600"> def wxTypeDescriptors(self,
|
|
tree, node):</font> <br>
|
|
<font color="#006600">
|
|
list = TextRules.TextRules.wxTypeDescriptors(self)</font> <br>
|
|
<font color="#006600">
|
|
# Find out what time range we are working with</font> <br>
|
|
<font color="#006600">
|
|
timeRange = node.getTimeRange()</font> <br>
|
|
<font color="#006600">
|
|
# See if this time range is for the Morning</font> <br>
|
|
<font color="#006600">
|
|
# First, shift to Local time from GMT</font> <br>
|
|
<font color="#006600">
|
|
timeRange = self.shiftedTimeRange(timeRange)</font> <br>
|
|
<font color="#006600">
|
|
startHour = timeRange.startTime().hour()</font> <br>
|
|
<font color="#006600">
|
|
endHour = timeRange.endTime().hour()</font> <br>
|
|
<font color="#006600">
|
|
if startHour >= 6 and endHour <= 12:</font> <br>
|
|
<font color="#006600">
|
|
list.append( ("*", "F", "*", "*", "morning fog") )</font> <br>
|
|
<font color="#006600">
|
|
return list</font> </p>
|
|
<p>For more information on customizing Weather Phrases, see the
|
|
sections on <a href="#WEATHERKEYFILTERING">Weather
|
|
Phrasing </a>and<a href="#STRATEGYFORPHRASECONSOLIDATION">
|
|
Phrase
|
|
Consolidation.<br>
|
|
</a></p>
|
|
<a href="#STRATEGYFORPHRASECONSOLIDATION"> </a>
|
|
<h4><a name="PopWx_Consistency"></a>Pop/Wx Consistency</h4>
|
|
By default, PoP (as well as LAL) is matched to the highest ranking
|
|
weather subkey. The default algorithm ensures that the reported
|
|
PoP matches
|
|
the reported Wx. This algorithm assumes that the grids have been
|
|
made consistent between PoP and Wx, perhaps via a Smart Tool. Thus, for
|
|
each weather subkey, there is a corresponding PoP in the grid.
|
|
The
|
|
algorithm reports the PoP that matches the highest ranked
|
|
weather.
|
|
So you might have a large area of SChc T with PoP of 20 and a very
|
|
small area of Lkly T with a PoP of 60. This will get reported as <br>
|
|
<br>
|
|
SLIGHT CHANCE OF THUNDERSTORMS. CHANCE OF
|
|
THUNDERSTORMS 20 PERCENT.<br>
|
|
<br>
|
|
since SChc T is computed to be the highest ranking subkey. The
|
|
algorithm
|
|
does not report values that are not in the grids. Instead, the
|
|
PoP
|
|
value in the grids that gives the closest match to the Wx coverage is
|
|
used. The configurable <i><font color="#993366">coveragePoP_table</font></i>
|
|
(CommonUtils)
|
|
defines the PoP ranges associated with each weather coverage.<span
|
|
style="font-weight: bold;"><br>
|
|
<br>
|
|
</span>The algorithm and matching can be controlled by adjusting the
|
|
"matchToWxInfo_dict" (ConfigVariables) in various ways shown and
|
|
described below:<br>
|
|
<br>
|
|
def matchToWxInfo_dict(self, tree, node):<br>
|
|
# The system will
|
|
automatically match the following elements to<br>
|
|
# the highest ranking
|
|
weather subkey coverage.<br>
|
|
# Each entry is a tuple of
|
|
(increment, algorithm, noPrecipValue, percentThreshold, wxTypes filter)
|
|
where<br>
|
|
<br>
|
|
# increment: This is
|
|
the increment from the low "bin" value<br>
|
|
# to be
|
|
added. For example, PoP has a bin of 55-65, so<br>
|
|
# its
|
|
increment is 5 to end up with values as multiples of 10.<br>
|
|
<br>
|
|
# algorithm: Can be<br>
|
|
#
|
|
Max: The MAXIMUM value that falls within the coverage range<br>
|
|
|
|
# for the highest
|
|
ranking subkey will be chosen.<br>
|
|
# Mode:
|
|
The MOST FREQUENT (over space and time) value that<br>
|
|
|
|
# falls within
|
|
the coverage range for the highest ranking<br>
|
|
|
|
# subkey will be
|
|
chosen.<br>
|
|
# MaxMode:
|
|
This is the MAXIMUM value over time of the MOST<br>
|
|
|
|
# FREQUENT values over
|
|
area for each of the grids in the timeRange.<br>
|
|
|
|
# In other words, for
|
|
each grid, we find the Mode i.e. MOST FREQUENT<br>
|
|
|
|
# value that falls
|
|
within the coverage range for the highest<br>
|
|
|
|
# ranking subkey.
|
|
Then we find the MAXIMUM of these values<br>
|
|
|
|
# over the grids again
|
|
falling within the coverage values.<br>
|
|
#
|
|
AnalysisMethod: This will simply use whatever analysis method<br>
|
|
|
|
# is specified as the
|
|
first entry in the product component<br>
|
|
|
|
# for the element. For
|
|
example, if you have<br>
|
|
#<br>
|
|
|
|
# ("PoP",
|
|
self.stdDevMaxAvg, [3]),<br>
|
|
|
|
# ("PoP",
|
|
self.binnedPercent, [3]),<br>
|
|
#<br>
|
|
|
|
# the "stdDevMaxAvg"
|
|
method will be used.<br>
|
|
#<br>
|
|
# noPrecipValue: The
|
|
value that should be returned if there is<br>
|
|
|
|
# no precipitating
|
|
weather. Can be:<br>
|
|
#
|
|
None<br>
|
|
# an
|
|
actual data value<br>
|
|
#
|
|
"Max": The maximum value found that has a greater > 0% occurrence.<br>
|
|
#
|
|
"AnalysisMethod": As above, will return the result of the product<br>
|
|
|
|
# component analysis
|
|
method e.g. stdDevMaxAvg or maximum.<br>
|
|
#<br>
|
|
# percentThreshold:
|
|
(optional) Percent of areal coverage a value must have in<br>
|
|
#
|
|
order to be considered for the element value returned. <br>
|
|
#
|
|
Default is 0.<br>
|
|
#<br>
|
|
# wxTypes filter:
|
|
(optional) Match only to weather keys of these wxTypes e.g.<br>
|
|
#
|
|
match LAL only to "T"<br>
|
|
#<br>
|
|
# EXAMPLE 1:
|
|
Suppose we have:<br>
|
|
<br>
|
|
|
|
# Wx Hours 1-12: Chc
|
|
R (coverage range is 30-60)<br>
|
|
|
|
# PoP Hours 1-3: 40%
|
|
(over 70% of area), 50% (over 30% of area)<br>
|
|
|
|
# Hours
|
|
4-12: 30<br>
|
|
<br>
|
|
# For the 12-hour PoP,<br>
|
|
# If set
|
|
to Max, we will get PoP: 50<br>
|
|
# If set
|
|
to Mode, we will get PoP: 30<br>
|
|
# If set
|
|
to MaxMode, we will get PoP: 40<br>
|
|
<br>
|
|
# For the Hours 1-3 PoP:<br>
|
|
# If set
|
|
to Max, we will get PoP: 50<br>
|
|
# If set
|
|
to Mode, we will get PoP: 40<br>
|
|
# If set
|
|
to MaxMode, we will get PoP: 40<br>
|
|
<br>
|
|
# NOTE: IF you add a
|
|
new element to this list, you MUST include<br>
|
|
# a coverage table
|
|
named "coverage<elementName>_value". Follow<br>
|
|
# the example for
|
|
"coveragePoP_value" in CommonUtils. You can<br>
|
|
# then access the
|
|
element value by calling "matchToWx" (WxPhrases).<br>
|
|
#<br>
|
|
return {<br>
|
|
|
|
"PoP": (5, "Max", None, 0),<br>
|
|
# If
|
|
there's no precipitating weather, return LAL 1<br>
|
|
|
|
"LAL": (0, "Max", 1, 0, ["T"]),<br>
|
|
}<br>
|
|
<br>
|
|
<h4><a name="COMBINEDELEMENT"></a>COMBINED ELEMENT PHRASES --
|
|
CombinedPhrases module<br>
|
|
</h4>
|
|
<center>
|
|
<table border="1" width="95%">
|
|
<caption>
|
|
<center></center>
|
|
<br>
|
|
</caption><tbody>
|
|
</tbody> <tbody>
|
|
<tr>
|
|
<td>ELEMENT</td>
|
|
<td>TEXT RULES <br>
|
|
METHOD</td>
|
|
<td>EXAMPLE <br>
|
|
PHRASES</td>
|
|
<td>SAMPLE <br>
|
|
ANALYSIS</td>
|
|
<td>THRESHOLDS AND VARIABLES <br>
|
|
(To override, find in ConfigVariables, WxPhrases, or CombinedPhrases
|
|
and copy to Overrides file)</td>
|
|
<td>ADD'L <br>
|
|
INFO</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Sky, PoP, Wx</td>
|
|
<td>skyPopWx_phrase</td>
|
|
<td>"Partly cloudy with a 20 percent chance of showers and
|
|
thunderstorms." <br>
|
|
<br>
|
|
"Sunny in the morning then partly cloudy with a 20 percent chance of
|
|
rain showers in
|
|
the afternoon."</td>
|
|
<td>Wx:**rankedWx <br>
|
|
(See add'l info). <br>
|
|
Sky: **median <br>
|
|
PoP: **binnedPercent, </td>
|
|
<td>The same thresholds and variables described for the <a
|
|
href="#WEATHER">weather_phrase</a> apply to this combined phrase.<br>
|
|
<br>
|
|
In addition:<br>
|
|
<i><font color="#993366">useCombinedSkyPopWx<br>
|
|
useSkyPopWx_consolidation<br>
|
|
</font></i><br>
|
|
<i><font color="#993366">sky_valueList</font></i> <br>
|
|
<i><font color="#993366">matchToWxInfo_dict</font></i><br>
|
|
<br>
|
|
</td>
|
|
<td><font color="#ff0000">NOTE: You should also include the
|
|
sky_phrase, weather_phrase, and popMax_phrase in your phraseList when
|
|
you are using the skyPopWx_phrase.</font>
|
|
<p><font color="#000000">For more information on the algorithm
|
|
used and examples, see the documentation in the CombinedPhrases module.</font></p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Wx, Sky</td>
|
|
<td>weather_orSky_phrase</td>
|
|
<td>If no weather, then return sky phrase</td>
|
|
<td>Sky: **median <br>
|
|
Wx: **rankedWx</td>
|
|
<td>same as for weather_phrase and sky_phrase</td>
|
|
<td><br>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</center>
|
|
<br>
|
|
|
|
<h4><a name="MARINE"></a>MARINE PHRASES -- MarinePhrases module<br>
|
|
</h4>
|
|
<center>
|
|
<table border="1" width="95%">
|
|
<caption>
|
|
<center></center>
|
|
<br>
|
|
</caption><tbody>
|
|
</tbody> <tbody>
|
|
<tr>
|
|
<td>ELEMENT</td>
|
|
<td>TEXT RULES <br>
|
|
METHOD</td>
|
|
<td>EXAMPLE <br>
|
|
PHRASES</td>
|
|
<td>SAMPLE <br>
|
|
ANALYSIS</td>
|
|
<td>THRESHOLDS AND VARIABLES <br>
|
|
(To override, find in ConfigVariables or MarinePhrases and copy to
|
|
Overrides file)</td>
|
|
<td>ADD'L <br>
|
|
INFO</td>
|
|
</tr>
|
|
<tr>
|
|
<td>WaveHeight <br>
|
|
WindWaveHgt</td>
|
|
<td>wave_phrase</td>
|
|
<td>"Combined seas 15 to 25 feet." <br>
|
|
"Wind waves 5 feet."</td>
|
|
<td>WaveHeight or WindWaveHeight: <br>
|
|
** Scalar Stats</td>
|
|
<td> <br>
|
|
<i><font color="#993366">maximum_range_nlValue</font></i> <br>
|
|
<i><font color="#993366">inlandWatersAreas</font></i> <br>
|
|
<i><font color="#993366">inlandWatersWave_element</font></i>l <br>
|
|
<i><font color="#993366">waveHeight_wind_threshold</font></i> <br>
|
|
<i><font color="#993366">combinedSeas_threshold</font></i> <br>
|
|
<i><font color="#993366">seasWaveHeight_element </font></i> <br>
|
|
<i><font color="#993366">seasWindWave_element </font></i> <br>
|
|
<i><font color="#993366">noWaveHeight_phrase</font></i> <br>
|
|
<i><font color="#993366">null_nlValue_dict</font></i> <br>
|
|
<i><font color="#993366">first_null_phrase_dict</font></i> <br>
|
|
<i><font color="#993366">null_phrase_dict</font></i> <br>
|
|
<i><font color="#993366">include_timePeriod_descriptor_flag </font></i><font
|
|
color="#000000"> -- moderates the time qualification on the phrase
|
|
e.g.
|
|
"in the afternoon"</font></td>
|
|
<td>See algorithm <br>
|
|
below </td>
|
|
</tr>
|
|
<tr>
|
|
<td>WaveHeight <br>
|
|
WindWaveHgt</td>
|
|
<td>wave_withPeriod <br>
|
|
_phrase</td>
|
|
<td>"Combined seas 15 to 25 feet dominant period 11 seconds."</td>
|
|
<td>Same as above PLUS: <br>
|
|
Period: **Scalar Stats <br>
|
|
Period2: **Scalar Stats</td>
|
|
<td>same as above PLUS <br>
|
|
<i><font color="#993366">phrase_descriptor_dict </font></i>for
|
|
"dominant period" <br>
|
|
<i><font color="#993366">units_descriptor_dict </font></i>for
|
|
"ft"</td>
|
|
<td>See algorithm <br>
|
|
below</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Wind</td>
|
|
<td><i>see <a href="#WINDANDWINDGUST">Wind and WindGust Phrases</a>
|
|
above</i></td>
|
|
<td><br>
|
|
</td>
|
|
<td><br>
|
|
</td>
|
|
<td><br>
|
|
</td>
|
|
<td><br>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Wind</td>
|
|
<td>chop_phrase</td>
|
|
<td>"Bay and inland waters a light chop."</td>
|
|
<td>Wind: **Vector Stats</td>
|
|
<td><i><font color="#993366">phrase_descriptor_dict </font></i>for
|
|
"chop" <br>
|
|
<i><font color="#993366">include_timePeriod_descriptor_flag </font></i><font
|
|
color="#000000"> -- moderates the time qualification on the phrase
|
|
e.g.
|
|
"in the afternoon"</font></td>
|
|
<td><br>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Swell</td>
|
|
<td>swell_phrase</td>
|
|
<td>"Northeast swells 5 to 10 feet and 10 to 15 feet."</td>
|
|
<td>Swell: **Vector Stats <br>
|
|
Swell2: **Vector Stats <br>
|
|
Wind: **Vector Stats</td>
|
|
<td><i><font color="#993366">phrase_descriptor_dict </font></i>for
|
|
"Swell" <br>
|
|
<i><font color="#993366">units_descriptor_dict </font></i>for
|
|
"ft" <br>
|
|
<i><font color="#993366">units_descriptor_dict </font></i>for
|
|
"foot" <br>
|
|
<i><font color="#993366">value_connector_dict </font></i>for
|
|
"Swell" e.g. 5 to 10 feet <br>
|
|
<i><font color="#993366">increment</font></i> for "Swell" e.g.
|
|
round swell magnitudes to nearest 1
|
|
<p><i><font color="#993366">null_nlValue_dict</font></i> <br>
|
|
<i><font color="#993366">first_null_phrase_dict</font></i> <br>
|
|
<i><font color="#993366">null_phrase_dict</font></i> </p>
|
|
<p><i><font color="#993366">maximum_range_nlValue_dict</font></i>
|
|
<br>
|
|
<i><font color="#993366">minimum_range_nlValue_dict</font></i> </p>
|
|
<p><i><font color="#993366">waveHeight_wind_threshold</font></i> <br>
|
|
<i><font color="#993366">combinedSeas_threshold</font></i> </p>
|
|
<p><i><font color="#993366">vector_mag_difference_nlValue_dict</font></i>
|
|
e.g. 2 feet <br>
|
|
<i><font color="#993366">vector_dir_difference_nlValue_dict </font></i>e.g.
|
|
60 degrees </p>
|
|
<p><i><font color="#993366">phrase_connector_dict </font></i>for
|
|
"becoming", "increasing to", "decreasing to", "shifting to the" </p>
|
|
<p><i><font color="#993366">embedded_vector_descriptor_flag_dict </font></i><font
|
|
color="#000000">-- default is 1 -- if 0, descriptor is first e.g. "<i>Swells</i>
|
|
east 5 to 10 feet."</font> </p>
|
|
<p><i><font color="#993366">include_timePeriod_descriptor_flag </font></i><font
|
|
color="#000000"> -- moderates the time qualification on the phrase
|
|
e.g.
|
|
"in the afternoon"</font></p>
|
|
</td>
|
|
<td>Note: The Swell phrase will not be produced for InlandWaters
|
|
areas OR if a "seas" wave phrase is produced (See algorithm below.)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Swell</td>
|
|
<td>swell_withPeriod <br>
|
|
_phrase</td>
|
|
<td>"Northeast swells 5 to 10 feet at 9 seconds and 10 to 15 feet
|
|
at 12 seconds."</td>
|
|
<td>Swell: **Vector Stats <br>
|
|
Swell2: **Vector Stats <br>
|
|
Period: **Scalar Stats <br>
|
|
Period2: **Scalar Stats <br>
|
|
Wind: **Vector Stats</td>
|
|
<td>Same as above PLUS: <br>
|
|
<i><font color="#993366">phrase_descriptor_dict </font></i>
|
|
for "Period" <br>
|
|
<i><font color="#993366">units_descriptor </font></i><font
|
|
color="#000000">for "seconds" </font></td>
|
|
<td><br>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Period</td>
|
|
<td>period_phrase</td>
|
|
<td>"Period 15 seconds."</td>
|
|
<td>Period: **Scalar Stats</td>
|
|
<td><i><font color="#993366">phrase_descriptor_dict </font></i>
|
|
for "Period" <br>
|
|
<i><font color="#993366">units_descriptor </font></i><font
|
|
color="#000000">for "seconds"</font> <br>
|
|
<i><font color="#993366">include_timePeriod_descriptor_flag </font></i><font
|
|
color="#000000"> -- moderates the time qualification on the phrase
|
|
e.g.
|
|
"in the afternoon"</font></td>
|
|
<td><br>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</center>
|
|
<h4> <a name="AlgorithmforWaveHeightandWindWaveHgt"></a>Algorithm for
|
|
WaveHeight and/or WindWaveHgt Reporting</h4>
|
|
<ul>
|
|
<li>If the edit area is in the <i><font color="#993366">inlandWatersAreas</font></i>
|
|
list, report from the <i><font color="#993366">inlandWatersWave_element</font></i>(default
|
|
"WaveHeight". If not available, report on second choice (default
|
|
WindWaveHgt). For this phrase, use the <i><font color="#993366">phrase_descriptor_dict </font></i>
|
|
entry for "inland waters".</li>
|
|
<li>If the edit area is not inland waters:</li>
|
|
<ul>
|
|
<ul>
|
|
<li>If maximum Wind > <i><font color="#993366">waveHeight_wind_threshold</font></i>
|
|
OR if maximum WindWaveHgt and maximum Swell > <i><font
|
|
color="#993366">combinedSeas_threshold</font></i>:</li>
|
|
<ul>
|
|
<ul>
|
|
<li>report from <i><font color="#993366">seasWaveHeight_element</font></i>(default
|
|
WaveHeight).</li>
|
|
<li>if "_withPeriod" report average of Period and
|
|
Period2 embedded in phrase.</li>
|
|
</ul>
|
|
<li>For this phrase, use the phrase_descriptor entry for "seas".</li>
|
|
</ul>
|
|
<li>Otherwise, report <i><font color="#993366">seasWindWave_element</font></i>(default
|
|
WindWaveHgt). For this phrase, use the <i><font color="#993366">phrase_descriptor_dict</font></i>for
|
|
"waves".</li>
|
|
</ul>
|
|
</ul>
|
|
<li>If no data available, return the <i><font color="#993366">noWaveHeight_phrase</font></i>.</li>
|
|
</ul>
|
|
NOTE: The Swell phrase will not be produced for inland waters OR
|
|
if a "seas" phrase is reported.
|
|
<h4><a name="FIREWEATHER"></a>FIRE WEATHER PHRASES<br>
|
|
</h4>
|
|
<center>
|
|
<table border="1" width="95%">
|
|
<caption>
|
|
<center></center>
|
|
<br>
|
|
</caption><tbody>
|
|
</tbody> <tbody>
|
|
<tr>
|
|
<td>ELEMENT</td>
|
|
<td>TEXT RULES <br>
|
|
METHOD</td>
|
|
<td>EXAMPLE <br>
|
|
PHRASES</td>
|
|
<td>SAMPLE <br>
|
|
ANALYSIS</td>
|
|
<td>THRESHOLDS AND VARIABLES <br>
|
|
(To override, find in ConfigVariables orFirePhrases and copy to
|
|
Overrides
|
|
file)</td>
|
|
<td>ADD'L <br>
|
|
INFO</td>
|
|
</tr>
|
|
<tr>
|
|
<td>CWR</td>
|
|
<td>cwr_phrase</td>
|
|
<td>CHC OF WETTING RAIN....20 percent</td>
|
|
<td>CWR: **ScalarStats </td>
|
|
<td><i><font color="#993366">phrase_descriptor_dict</font></i></td>
|
|
<td><br>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Dispersion</td>
|
|
<td>smokeDispersal_phrase</td>
|
|
<td>SMOKE DISPERSAL....</td>
|
|
<td>Dispersion: **ScalarStats</td>
|
|
<td><i><font color="#993366">phrase_descriptor_dict</font></i> <br>
|
|
<i><font color="#993366">smokeDispersal_valueStr</font></i></td>
|
|
<td><br>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Haines</td>
|
|
<td>haines_phrase</td>
|
|
<td>HAINES INDEX...3 Very low potential for large plume dominated
|
|
fire growth.</td>
|
|
<td>Haines: **ScalarStats</td>
|
|
<td><i><font color="#993366">phrase_descriptor_dict</font></i> <br>
|
|
<i><font color="#993366">hainesDict</font></i></td>
|
|
<td><br>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>LAL</td>
|
|
<td>lal_phrase</td>
|
|
<td>LAL...2.</td>
|
|
<td>LAL: avg [0] </td>
|
|
<td><i><font color="#993366">phrase_descriptor_dict</font></i></td>
|
|
<td><br>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>MaxRH</td>
|
|
<td>humidity_recovery_phrase</td>
|
|
<td>HUMIDITY RECOVERY...POOR</td>
|
|
<td>MaxRH: mode</td>
|
|
<td><i><font color="#993366">phrase_descriptor_dict</font></i> <br>
|
|
<i><font color="#993366">humidityRecovery_percentage</font></i> <br>
|
|
<i><font color="#993366">humidityRecovery_valueList</font></i></td>
|
|
<td><br>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>MixHgt</td>
|
|
<td>mixingHgt_phrase</td>
|
|
<td> MIXING HEIGHT...600-1000 FT AGL</td>
|
|
<td>MixHgt: **ScalarStats</td>
|
|
<td><i><font color="#993366">phrase_descriptor_dict</font></i></td>
|
|
<td><br>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Sky/Wx</td>
|
|
<td>skyWeather_byTimeRange_compoundPhrase</td>
|
|
<td>SKY/WEATHER...Mostly sunny until 1100...then partly
|
|
cloudy. Chance of showers.</td>
|
|
<td>Sky: **Scalar Stats <br>
|
|
Wx: **dominantWx</td>
|
|
<td><i><font color="#993366">phrase_descriptor_dict</font></i> <br>
|
|
<i><font color="#993366">includeSkyRanges_flag</font></i> <br>
|
|
<font color="#000000">All the thresholds and varables from the
|
|
weather_phrase and the fireSky_phrase apply</font></td>
|
|
<td>To change the format of the sky ranges, override the <font
|
|
color="#006600">addSkyRange</font> method from FirePhrases</td>
|
|
</tr>
|
|
<tr>
|
|
<td>TransWind</td>
|
|
<td>transportWind_phrase</td>
|
|
<td> TRANSPORT WINDS...West 3-10 mph.</td>
|
|
<td>TransWind: **Vector Stats</td>
|
|
<td><i><font color="#993366">phrase_descriptor_dict</font></i></td>
|
|
<td><br>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Wind</td>
|
|
<td>fireWind_compoundPhrase</td>
|
|
<td>20-FT WINDS...Winds northeast around 10 mph in the evening
|
|
becoming light after midnight.</td>
|
|
<td>Wind20ft OR Wind: **VectorStats</td>
|
|
<td><i><font color="#993366">phrase_descriptor_dict</font></i> <br>
|
|
<font color="#000000">All the threhsolds and variables from the
|
|
wind_summary and wind_phrase apply.</font></td>
|
|
<td>If the Wind20ft grid is available, it is reported. Otherwise,
|
|
the Wind grid values are multiplied by the <font color="#006600">windAdjustmentFactor</font>(set
|
|
in the Overrides file) and reported.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Variable</td>
|
|
<td>trend_DayOrNight_phrase</td>
|
|
<td>"24-HOUR TREND...2 degrees warmer." <br>
|
|
"24-HOUR TREND...10 percent wetter."</td>
|
|
<td>MinT, MaxT: mode <br>
|
|
MinRH, MaxRH: mode
|
|
<p>Optional: <br>
|
|
Ttrend: self.avg <br>
|
|
RHtrend: self.avg </p>
|
|
<p>IF the trend grids are present, they are used, otherwise, the
|
|
MinT or MaxRH (nighttime) or MaxT or MinRH (daytime) grids are used.</p>
|
|
</td>
|
|
<td><i><font color="#993366">phrase_descriptor</font></i> for
|
|
"higher", "lower", "missing", "unchanged" <br>
|
|
<i><font color="#993366">trend_threshold_dict</font></i> <br>
|
|
<i><font color="#993366">un</font><font color="#993399">its_d</font><font
|
|
color="#993366">escriptor</font></i></td>
|
|
<td>Arguments: dayElement, nightElement, <br>
|
|
trendElement, <br>
|
|
indent_flag, <br>
|
|
endWithPeriod_flag <br>
|
|
The flags are set to 1 for FWF-type phrases.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Variable</td>
|
|
<td>dayOrNight_phrase</td>
|
|
<td>"MAX TEMPERATURE....45-55." <br>
|
|
"MIN HUMIDITY...........20-25."</td>
|
|
<td>avg, minmax, stdDevMinMax, median, mode</td>
|
|
<td><i><font color="#993366">minimum_range_threshold_dict</font></i>
|
|
<br>
|
|
<i><font color="#993366">range_threshold_dict</font></i> <br>
|
|
<i><font color="#993366">value_connector_dict</font></i></td>
|
|
<td>Arguments: dayElement, nightElement, indent_flag,
|
|
endWithPeriod_flag <br>
|
|
These flags are set to 1 for FWF-type phrases.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</center>
|
|
<h4> <a name="RidgeversusValleyWinds"></a>Ridge versus Valley Winds</h4>
|
|
For some edit areas, you may want to break out the 20-foot winds
|
|
into Ridges and Valleys. To do so, in the FWF_<site>_Overrides
|
|
file, set up the
|
|
names of areas for which you want this break-out:
|
|
<p> def ridgeValleyAreas(self, tree, node): <br>
|
|
# List of edit area names
|
|
for which we want <br>
|
|
# ridge/valley winds
|
|
reported: <br>
|
|
# <br>
|
|
# 20-FOOT WINDS... <br>
|
|
#
|
|
VALLEYS/LWR SLOPES... <br>
|
|
#
|
|
RIDGES/UPR SLOPES.... <br>
|
|
# <br>
|
|
# e.g. <br>
|
|
# return ["Area1"] <br>
|
|
return [] </p>
|
|
<p>Next, make sure you have edit areas defined for "Ridges" and
|
|
"Valleys" to intersect with the current area. If you want to use
|
|
different edit area names, you can include the following override (from
|
|
the FirePhrases module) in your Overrides file: </p>
|
|
<p> def valleyRidgeAreaNames(self, tree, node): <br>
|
|
# These are the areas for
|
|
valleys and ridges, respectively, <br>
|
|
# to be intersected with the
|
|
current edit area for <br>
|
|
# reporting valley winds and
|
|
ridge winds, respectively. <br>
|
|
# NOTE: If you change these
|
|
area names, you will also <br>
|
|
# need to change the names
|
|
in the FirePeriod "intersectAreas" <br>
|
|
# section. <br>
|
|
return "Valleys", "Ridges" <br>
|
|
</p>
|
|
<h4> <a name="DISCRETEPHRASESHeadlines"></a>DISCRETE PHRASES
|
|
(DiscretePhrases module)<br>
|
|
</h4>
|
|
<center>
|
|
<table nosave="" border="1" width="95%">
|
|
<caption>
|
|
<center></center>
|
|
<br>
|
|
</caption><tbody>
|
|
</tbody> <tbody>
|
|
<tr nosave="">
|
|
<td nosave="">ELEMENT</td>
|
|
<td>TEXT RULES <br>
|
|
METHOD</td>
|
|
<td>EXAMPLE PHRASES</td>
|
|
<td>SAMPLE <br>
|
|
ANALYSIS</td>
|
|
<td>THRESHOLDS AND VARIABLES <br>
|
|
(To override, find in designated module and copy to Overrides file)</td>
|
|
<td>ADD'L <br>
|
|
INFO</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Hazards</td>
|
|
<td>makeHeadlinePhrases<br>
|
|
</td>
|
|
<td>.WINTER STORM WARNING IN EFFECT<br>
|
|
</td>
|
|
<td>Not sampled by SampleAnalysis</td>
|
|
<td><i><font color="#993399"> <a href="#AllowedHazards">allowedHazards</a><br>
|
|
</font></i><i><font color="#993399"></font></i></td>
|
|
<td>Found in DiscretePhrases module</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</center>
|
|
<h4> <a name="NARRATIVESTRATEGIES"></a>NARRATIVE STRATEGIES</h4>
|
|
Narrative Tree methods coordinate to produce a desired result.
|
|
The strategy behind this coordination is not obvious from looking at
|
|
the
|
|
individual methods, so we provide documentation for this coordination
|
|
in
|
|
the following "Strategy" sections. <br>
|
|
|
|
<h4><a name="STRATEGYFORNONLINEARTHRESHOLDS"></a>NON-LINEAR
|
|
THRESHOLDS</h4>
|
|
We support non-linear thresholds and variables by allowing a method to
|
|
return a dictionary of ranges and values. The code applying the
|
|
threshold is responsible for applying it to each value using the
|
|
nlValue method:<br>
|
|
<p> <font color="#006600">threshold =
|
|
self.nlValue(threshold, value)</font> </p>
|
|
<p>Any variable that is named with the suffix <font color="#006600">_nlValue</font>
|
|
can operate in this way returning EITHER a single value or a dictionary
|
|
of values. If a dictionary is returned, it is of the form: </p>
|
|
<p> <font color="#006600">{</font> <br>
|
|
<font color="#006600"> 'default':
|
|
<default value>,</font> <br>
|
|
<font color="#006600"> (lowVal, highVal)
|
|
: <value>,</font> <br>
|
|
<font color="#006600"> }</font> <br>
|
|
where lowVal and highVal consitute a range for applying the given
|
|
value. The lowVal is inclusive while the highVal is exclusive.
|
|
For example: </p>
|
|
<p> <font color="#006600">def
|
|
scalar_difference_nlValue_dict(self, tree, node):</font> <br>
|
|
<font color="#006600"> #
|
|
Scalar difference. If the difference between scalar values</font>
|
|
<br>
|
|
<font color="#006600"> # for
|
|
2 sub-periods is greater than this value,</font> <br>
|
|
<font color="#006600"> # the
|
|
different values will be noted in the phrase.</font> <br>
|
|
<font color="#006600"> return
|
|
{</font> <br>
|
|
<font color="#006600">
|
|
"WindGust": {</font> <br>
|
|
<font color="#006600">
|
|
'default': 10,</font> <br>
|
|
<font color="#006600">
|
|
(0, 30): 10,</font> <br>
|
|
<font color="#006600">
|
|
(30, 50): 15,</font> <br>
|
|
<font color="#006600">
|
|
(50, 200): 20,</font> <br>
|
|
<font color="#006600">
|
|
},</font> <br>
|
|
<font color="#006600">
|
|
}</font> </p>
|
|
<p>In this case, if the WindGust is greater or equal to 0 and less than
|
|
30, the scalar_difference will be 10; if WindGust is greater or equal
|
|
to
|
|
30 and less that 50, the scalar_difference will be 15; etc. </p>
|
|
<p>You always have the additional option of basing the return value on
|
|
the current edit area. For example: </p>
|
|
<p><font color="#006600"> def
|
|
scalar_difference_nlValue_dict(self, tree, node):</font> <br>
|
|
<font color="#006600"> #
|
|
Scalar difference. If the difference between scalar values</font>
|
|
<br>
|
|
<font color="#006600"> # for
|
|
2 sub-periods is greater than this value,</font> <br>
|
|
<font color="#006600"> # the
|
|
different values will be noted in the phrase.</font> <br>
|
|
<font color="#006600"> return
|
|
{</font> <br>
|
|
<font color="#006600">
|
|
"WindGust": self.windGust_scalar_nlValue_difference,</font> <br>
|
|
<font color="#006600">
|
|
}</font> </p>
|
|
<p><font color="#006600"> def
|
|
windGust_scalar_nlValue_difference(self, tree, node):</font> <br>
|
|
<font color="#006600">
|
|
mountains = ["Area1", "Area2"]</font> <br>
|
|
<font color="#006600">
|
|
if self.currentAreaContains(tree, mountains):</font> <br>
|
|
<font color="#006600">
|
|
return 15</font> <br>
|
|
<font color="#006600">
|
|
else:</font> <br>
|
|
<font color="#006600">
|
|
return {</font> <br>
|
|
<font color="#006600">
|
|
'default': 10,</font> <br>
|
|
<font color="#006600">
|
|
(0, 30): 10,</font> <br>
|
|
<font color="#006600">
|
|
(31, 50): 15,</font> <br>
|
|
<font color="#006600">
|
|
(51, 200): 20,</font> <br>
|
|
<font color="#006600">
|
|
}</font> </p>
|
|
<p>The method applying the threshold must do the following before using
|
|
it: </p>
|
|
<p> <font color="#006600"> threshold =
|
|
self.scalar_difference_threshold(</font> <br>
|
|
<font color="#006600">
|
|
tree, node, element, element)</font> <br>
|
|
for each value to check: <br>
|
|
<font color="#006600">
|
|
curThreshold = self.nlValue(threshold, value)</font> <br>
|
|
<font color="#006600"> # Use
|
|
curThreshold for the given value</font> <br>
|
|
</p>
|
|
<h4><a name="DATAVALUEEXTRACTIONFROMTHEGRIDS"></a>DATA VALUE
|
|
EXTRACTION FROM THE GRIDS</h4>
|
|
<font color="#000000">The following steps are taken to extract the raw
|
|
data values from the grids for reporting in narrative products:</font>
|
|
<ul>
|
|
<li> <font color="#000000">Sampling -- simple histogram of raw data</font></li>
|
|
<li> <font color="#000000">Sample Analysis -- statistical methods
|
|
specified in the product component definition (e.g. avg, mininum,
|
|
maximum, vectorModeratedMinMax)</font></li>
|
|
<li> <font color="#000000">Unit Conversion</font></li>
|
|
<li> <font color="#000000">Standard and Non-Standard Rounding</font></li>
|
|
<li> <font color="#000000">Range Adjustment</font></li>
|
|
</ul>
|
|
<font color="#000000">All of this is done prior to generating
|
|
phrases. In addition, if sub-phrases or components are combined,
|
|
Range Adjustment is re-done if necessary. There are
|
|
user-configurable thresholds and variables to control this processing,
|
|
and it is very important to understand the relationships between them
|
|
to
|
|
produce acceptable results.</font>
|
|
<h4><a name="UNITCONVERSION"></a>Unit Conversion</h4>
|
|
<font color="#000000">The input and output units are specified in the
|
|
following dictionaries. Unit conversion is done automatically</font>
|
|
<p><font color="#000000"> </font><font color="#006600">
|
|
def element_inUnits_dict(self, tree, node):</font> <br>
|
|
<font color="#006600"> #
|
|
Dictionary of descriptors for various units</font> </p>
|
|
<p><font color="#006600"> def
|
|
element_outUnits_dict(self, tree, node):</font> <br>
|
|
<font color="#006600"> #
|
|
Dictionary of descriptors for various units</font> </p>
|
|
<h4><font color="#000000"> <a name="STRATEGYFORNONSTANDARDROUNDING"></a>Standard
|
|
and
|
|
Non-Standard rounding</font></h4>
|
|
The system does automatic unit conversion and rounding when statistics
|
|
are generated for the narrative product. Rounding is normally
|
|
done
|
|
using a simple increment value (which can be non-linear as described
|
|
above). In lieu of that, a non-standard rounding method may be
|
|
specified per weather element.
|
|
<p>Example of standard rounding increment (from
|
|
ZFP_<site>_Overrides file,
|
|
overriding increment_nlValue_dict in ConfigVariables module): </p>
|
|
<p><font color="#006600"> def
|
|
increment_nlValue_dict(self, tree, node):</font> <br>
|
|
<font color="#006600"> #
|
|
Increment for rounding values</font> <br>
|
|
<font color="#006600"> #
|
|
Units depend on the product</font> <br>
|
|
<font color="#006600"> dict =
|
|
TextRules.TextRules.increment_nlValue_dict(self, tree, node)</font> <br>
|
|
<font color="#006600">
|
|
dict["Wind"] = 5</font> <br>
|
|
<font color="#006600"> return
|
|
dict</font> </p>
|
|
<p>Example of non-standard rounding method (found in ConfigVariables
|
|
module): </p>
|
|
<p><font color="#006600"> def
|
|
rounding_method_dict(self, tree, node):</font> <br>
|
|
<font color="#006600"> #
|
|
Special rounding methods</font> <br>
|
|
<font color="#006600"> #</font>
|
|
<br>
|
|
<font color="#006600"> return
|
|
{</font> <br>
|
|
<font color="#006600">
|
|
"Wind": self.marineRounding,</font> <br>
|
|
<font color="#006600">
|
|
}</font> </p>
|
|
<p><font color="#006600"> def marineRounding(self,
|
|
value, mode, increment, maxFlag):</font> <br>
|
|
<font color="#006600"> #
|
|
Rounding for marine winds</font> <br>
|
|
<font color="#006600"> mode =
|
|
"Nearest"</font> <br>
|
|
<font color="#006600"> if
|
|
maxFlag:</font> <br>
|
|
<font color="#006600">
|
|
if value > 30 and value < 34:</font> <br>
|
|
<font color="#006600">
|
|
mode = "RoundDown"</font> <br>
|
|
<font color="#006600">
|
|
elif value > 45 and value < 48:</font> <br>
|
|
<font color="#006600">
|
|
mode = "RoundDown"</font> <br>
|
|
<font color="#006600">
|
|
else:</font> <br>
|
|
<font color="#006600">
|
|
mode = "Nearest"</font> <br>
|
|
<font color="#006600"> return
|
|
self.round(value, mode, increment)</font> </p>
|
|
<h4><a name="RANGEADJUSTMENT"></a>Range Adjustment</h4>
|
|
<font color="#000000">Range adjustment is a feature that allows you to
|
|
set required ranges on data values coming from the grids. For
|
|
example, if you would always like to see at least a 5 mph range in the
|
|
wind phrases, you can set the "minimum_range_nlValue_dict" for "Wind"
|
|
to
|
|
5. Then you will see phrases such as "Winds 5 to 10 mph" instead
|
|
of "Winds 10 mph." Range adjustment is rather complicated logically and
|
|
this leads to some confusion. Purists would argue against using
|
|
range adjustment as it is not 100% true to the grids -- however, with
|
|
the current suite of zone-based products, it is sometimes
|
|
desirable. For a discussion, see the FAQ <a
|
|
href="#RANGE_ADJUSTMENT_QUESTIONSANSWERS">Range Adjustment
|
|
Questions/Answers</a> section.</font>
|
|
<p><font color="#000000">The basic premise of range adjustment is that
|
|
you have to commit to the ranges you choose (and rounding increments as
|
|
well) from the beginning of processing. In other words, we can't
|
|
just slap on a range at the very end when we are building the phrase;
|
|
ranges need to be applied from the moment the grids are analyzed so
|
|
that
|
|
phrase combining and period combining are comparing pre-adjusted
|
|
values. Then, if we do combine two sub-phrases or two periods, we
|
|
have to combine their statistics and, then re-apply the range
|
|
adjustments to the new values. The system is set up to recognize these
|
|
cases when you set the range values listed below.</font> </p>
|
|
<p><font color="#000000">The following variables are used to adjust the
|
|
range reported for the data value:</font> </p>
|
|
<p><font color="#006600"> def
|
|
range_nlValue_dict(self, tree, node):</font> <br>
|
|
<font color="#006600"> # If
|
|
the range of values less than this amount, return as a single value</font>
|
|
</p>
|
|
<p><font color="#006600"> def
|
|
minimum_range_nlValue_dict(self, tree, node):</font> <br>
|
|
<font color="#006600"> # This
|
|
threshold is the "smallest" min/max difference allowed between values
|
|
reported.</font> <br>
|
|
<font color="#006600"> # For
|
|
example, if threshold is set to 5 for "MaxT", and the min value is 45</font>
|
|
<br>
|
|
<font color="#006600"> # and
|
|
the max value is 46, the range will be adjusted to at least a 5 degree</font>
|
|
<br>
|
|
<font color="#006600"> #
|
|
range e.g. 43-48. These are the values that are then submitted
|
|
for
|
|
phrasing</font> <br>
|
|
<font color="#006600"> # such
|
|
as:</font> <br>
|
|
<font color="#006600">
|
|
# HIGHS IN THE MID 40S</font> </p>
|
|
<p><font color="#006600"> def
|
|
maximum_range_nlValue_dict(self, tree, node):</font> <br>
|
|
<font color="#006600"> #
|
|
Maximum range to be reported within a phrase</font> <br>
|
|
<font color="#006600">
|
|
# e.g. 5 to 10 mph</font> <br>
|
|
<font color="#006600"> #
|
|
Units depend on the product</font> </p>
|
|
<p><font color="#006600"> def
|
|
range_bias_nlValue_dict(self, tree, node):</font> <br>
|
|
<font color="#006600"> #
|
|
"Min", "Average", "Max"</font> <br>
|
|
<font color="#006600">
|
|
# Should the range be taken from the "min" "average" or "max"
|
|
value of the current range?</font> <br>
|
|
<font color="#006600"> return
|
|
{'default': "Average"}</font> </p>
|
|
<p><font color="#006600"> def
|
|
maximum_range_bias_nlValue_dict(self, tree, node):</font> <br>
|
|
<font color="#006600"> #
|
|
"Min", "Average", "Max"</font> <br>
|
|
<font color="#006600">
|
|
# Should the maximum_range be taken from the "min" "average" or
|
|
"max" value of the current range?</font> <br>
|
|
<font color="#006600"> return
|
|
{</font> <br>
|
|
<font color="#006600">
|
|
"default": "Average",</font> <br>
|
|
<font color="#006600">
|
|
"Wind": "Max"</font> <br>
|
|
<font color="#006600">
|
|
}</font> </p>
|
|
<p><font color="#006600"> def
|
|
minimum_range_bias_nlValue_dict(self, tree, node):</font> <br>
|
|
<font color="#006600"> #
|
|
"Min", "Average", "Max"</font> <br>
|
|
<font color="#006600">
|
|
# Should the minimum_range be taken from the "min" "average" or
|
|
"max" value of the current range?</font> <br>
|
|
<font color="#006600"> return
|
|
{</font> <br>
|
|
<font color="#006600">
|
|
"default": "Average",</font> <br>
|
|
<font color="#006600">
|
|
"Wind": "Max"</font> <br>
|
|
<font color="#006600">
|
|
}</font> </p>
|
|
<p><span style="color: rgb(0, 0, 0);"><font color="#006600">NOTE:
|
|
The <span style="font-style: italic; color: rgb(153, 51, 153);">range_nlValue</span>
|
|
is applied first and thus supercedes range adjustments
|
|
(minimum/maximum ranges). So if your minimum or maximum ranges
|
|
are
|
|
not taking effect, check to make sure there is not a <span
|
|
style="font-style: italic; color: rgb(153, 51, 153);">range_nlValue </span>set
|
|
for the weather element in question.</font> <br>
|
|
</span></p>
|
|
<p><font color="#000000">Ranges are adjusted at several points in the
|
|
processing of phrases:</font> </p>
|
|
<ul>
|
|
<li> <font color="#000000">When statistics are initially calculated
|
|
and entered into the StatisticsDictionary by the ForecastNarrative
|
|
module.</font></li>
|
|
<li> <font color="#000000">When statistics are gathered over
|
|
multiple
|
|
time ranges from the StatisticsDictionary by the "tree.stats.get"
|
|
command.</font></li>
|
|
<li> <font color="#000000">When statistics are combined (e.g.
|
|
combining sub-phrases)</font></li>
|
|
</ul>
|
|
<h4> <font color="#000000">Example: Using Maximum Range and Bias</font></h4>
|
|
<font color="#000000">Fire weather users are most concerned with the
|
|
minimum RH/maximum Temp during the day, and the maximum RH/minimum Temp
|
|
at night. So, rather than give them the full range of values for a
|
|
particular zone, we'd like to be able to weight the output range of
|
|
values to the lower end of MinRH and MinT, and the higher end of MaxRH
|
|
and MaxT. Sampling could be manipulated to do this through the
|
|
moderated_dict, but then we would want those results turned into a 5
|
|
degree range (rounded to the nearest 5, if possible) returned for
|
|
non-mountain zones and a 10 degree range (rounded to the nearest 5) for
|
|
mountain zones.</font>
|
|
<p><font color="#000000">To accomplish this, include the following in
|
|
the Overrides file:</font> </p>
|
|
<p><font color="#000000"> </font><font color="#006600">
|
|
def maximum_range_nlValue_dict(self, tree, node):</font> <br>
|
|
<font color="#006600"> #
|
|
Maximum range to be reported within a vector phrase</font> <br>
|
|
<font color="#006600">
|
|
# e.g. 5 to 10 mph</font> <br>
|
|
<font color="#006600"> #
|
|
Units depend on the product</font> <br>
|
|
<font color="#006600"> dict =
|
|
TextRules.TextRules.maximum_range_nlValue_dict(self, tree, node)</font>
|
|
<br>
|
|
<font color="#006600">
|
|
mountainZones = ["area3"]</font> <br>
|
|
<font color="#006600"> if
|
|
self.currentAreaContains(tree, mountainZones):</font> <br>
|
|
<font color="#006600">
|
|
range = 10</font> <br>
|
|
<font color="#006600"> else:</font>
|
|
<br>
|
|
<font color="#006600">
|
|
range = 5</font> <br>
|
|
<font color="#006600">
|
|
dict["MaxT"] = range</font> <br>
|
|
<font color="#006600">
|
|
dict["MinT"] = range</font> <br>
|
|
<font color="#006600">
|
|
dict["MaxRH"] = range</font> <br>
|
|
<font color="#006600">
|
|
dict["MinRH"] = range</font> <br>
|
|
<font color="#006600"> return
|
|
dict</font> </p>
|
|
<p><font color="#006600"> def
|
|
maximum_range_bias_nlValue_dict(self, tree, node):</font> <br>
|
|
<font color="#006600"> #
|
|
"Min", "Average", "Max"</font> <br>
|
|
<font color="#006600">
|
|
# Should the maximum_range be taken from the "min" "average" or
|
|
"max"</font> <br>
|
|
<font color="#006600">
|
|
# value of the current range?</font> <br>
|
|
<font color="#006600"> dict =
|
|
TextRules.TextRules.maximum_range_bias_nlValue_dict(self, tree, node)</font>
|
|
<br>
|
|
<font color="#006600">
|
|
dict["MaxT"] = "Max"</font> <br>
|
|
<font color="#006600">
|
|
dict["MinT"] = "Min"</font> <br>
|
|
<font color="#006600">
|
|
dict["MaxRH"] = "Max"</font> <br>
|
|
<font color="#006600">
|
|
dict["MinRH"] = "Min"</font> <br>
|
|
<font color="#006600"> return
|
|
dict</font> </p>
|
|
<p><font color="#006600"> def
|
|
increment_nlValue_dict(self, tree, node):</font> <br>
|
|
<font color="#006600"> #
|
|
Increment for rounding values</font> <br>
|
|
<font color="#006600"> #
|
|
Units depend on the product</font> <br>
|
|
<font color="#006600"> dict =
|
|
TextRules.TextRules.increment_nlValue_dict(self, tree, node)</font> <br>
|
|
<font color="#006600">
|
|
dict["MaxT"] = 5</font> <br>
|
|
<font color="#006600">
|
|
dict["MinT"] = 5</font> <br>
|
|
<font color="#006600">
|
|
dict["MaxRH"] = 5</font> <br>
|
|
<font color="#006600">
|
|
dict["MinRH"] = 5</font> <br>
|
|
<font color="#006600"> return
|
|
dict</font> </p>
|
|
<h4><a name="DataValueExtractionandCombining"></a><font color="#000000">Data
|
|
Value Extraction and Combining</font></h4>
|
|
<font color="#000000">It is very important that the combining criteria
|
|
be consistent with the data value extraction thresholds and
|
|
variables. Combining for scalar and vector magnitudes is based
|
|
upon the following thresholds:</font>
|
|
<p><font color="#006600"> def
|
|
scalar_difference_nlValue_dict(self, tree, node):</font> <br>
|
|
<font color="#006600"> #
|
|
Scalar difference. If the difference between scalar values</font>
|
|
<br>
|
|
<font color="#006600"> # for
|
|
2 sub-periods is greater than this value,</font> <br>
|
|
<font color="#006600"> # the
|
|
different values will be noted in the phrase.</font> </p>
|
|
<p><font color="#006600"> def
|
|
vector_mag_difference_nlValue_dict(self, tree, node):</font> <br>
|
|
<font color="#006600"> #
|
|
Replaces WIND_THRESHOLD</font> <br>
|
|
<font color="#006600"> #
|
|
Magnitude difference. If the difference between magnitudes</font>
|
|
<br>
|
|
<font color="#006600"> # for
|
|
sub-ranges is greater than this value,</font> <br>
|
|
<font color="#006600"> # the
|
|
different magnitudes will be noted in the phrase.</font> <br>
|
|
<font color="#006600"> #
|
|
Units can vary depending on the element and product</font> </p>
|
|
<h4><a name="DataValueExtractionConsistency"></a><font color="#000000">Data
|
|
Value Extraction Consistency</font></h4>
|
|
<font color="#000000">Certain relationships must hold among the
|
|
thresholds and variables used for Data Extraction. In particular:</font>
|
|
<ul>
|
|
<li> <font color="#000000">the minimum_range and maximum_range must
|
|
be multiples of the increment</font></li>
|
|
<li> <font color="#000000">minimum_range must be less or equal to
|
|
the
|
|
maximum_range</font></li>
|
|
</ul>
|
|
<font color="#000000">If this is not the case, the system will
|
|
automatically set the differences accordingly.</font>
|
|
<h4><a name="STRATEGYFORHANDLINGNULLVALUES"></a>NULL VALUES</h4>
|
|
"Null" values are those that are below the "null_nlValue" or, in
|
|
the case of Wx, <"NoWx">. Here area the default thresholds
|
|
from the ConfigVariables module:
|
|
<p> <font color="#006600"> def null_nlValue_dict(self,
|
|
tree, node):</font> <br>
|
|
<font color="#006600"> #
|
|
Magnitude threshold below which values are considered "null" and
|
|
not reported.</font> <br>
|
|
<font color="#006600"> return
|
|
{</font> <br>
|
|
<font color="#006600">
|
|
"Wind": 5, # mph</font> <br>
|
|
<font color="#006600">
|
|
"TransWind": 0, # mph</font> <br>
|
|
<font color="#006600">
|
|
"FreeWind": 0, # mph</font> <br>
|
|
<font color="#006600">
|
|
"Swell": 5, # ft</font> <br>
|
|
<font color="#006600">
|
|
"Swell2": 5, # ft</font> <br>
|
|
<font color="#006600">
|
|
"WaveHeight": 3, # ft</font> <br>
|
|
<font color="#006600">
|
|
}</font> </p>
|
|
<p><font color="#000000">You may specify the phrases that will be used
|
|
to report Null values. These phrases may be the empty phrase,
|
|
"". You may want to specify a different phrase if the the
|
|
null value occurs for the entire time period or the for the first
|
|
sub-phrase versus in subsequent sub-phrases. Here are the default
|
|
null phrase dictionaries from the ConfigVariables module:</font> </p>
|
|
<p><font color="#006600"> def
|
|
first_null_phrase_dict(self, tree, node):</font> <br>
|
|
<font color="#006600"> #
|
|
Phrase to use if values THROUGHOUT the period or</font> <br>
|
|
<font color="#006600"> # in
|
|
the first period are Null (i.e. below threshold OR NoWx)</font> <br>
|
|
<font color="#006600"> #
|
|
E.g. LIGHT WINDS. or LIGHT
|
|
WINDS BECOMING N 5 MPH.</font> <br>
|
|
<font color="#006600"> return
|
|
{</font> <br>
|
|
<font color="#006600">
|
|
"Wind": "light winds",</font> <br>
|
|
<font color="#006600">
|
|
"TransWind": "",</font> <br>
|
|
<font color="#006600">
|
|
"FreeWind": "",</font> <br>
|
|
<font color="#006600">
|
|
"Swell": "light swells",</font> <br>
|
|
<font color="#006600">
|
|
"Swell2": "",</font> <br>
|
|
<font color="#006600">
|
|
"Wx": "",</font> <br>
|
|
<font color="#006600">
|
|
"WindGust": "",</font> <br>
|
|
<font color="#006600">
|
|
"Wave": "2 feet or less",</font> <br>
|
|
<font color="#006600">
|
|
}</font> </p>
|
|
<p><font color="#006600"> def null_phrase_dict(self,
|
|
tree, node):</font> <br>
|
|
<font color="#006600"> #
|
|
Phrase to use for null values in subPhrases other than the first</font>
|
|
<br>
|
|
<font color="#006600"> # Can
|
|
be an empty string</font> <br>
|
|
<font color="#006600">
|
|
# E.g. "NORTH WINDS 20 to 25 KNOTS BECOMING LIGHT"</font> <br>
|
|
<font color="#006600"> return
|
|
{</font> <br>
|
|
<font color="#006600">
|
|
"Wind": "light",</font> <br>
|
|
<font color="#006600">
|
|
"TransWind": "light",</font> <br>
|
|
<font color="#006600">
|
|
"FreeWind": "light",</font> <br>
|
|
<font color="#006600">
|
|
"Swell": "light",</font> <br>
|
|
<font color="#006600">
|
|
"Swell2": "",</font> <br>
|
|
<font color="#006600">
|
|
"Wx":"",</font> <br>
|
|
<font color="#006600">
|
|
"WindGust": "",</font> <br>
|
|
<font color="#006600">
|
|
"Wave": "2 feet or less",</font> <br>
|
|
<font color="#006600">
|
|
}</font> </p>
|
|
<h4><a name="STRATEGYFORLOCALEFFECTSPhraseBuildermodule"></a>LOCAL
|
|
EFFECTS</h4>
|
|
Local effects are set up on a per-Product Component, per-phrase basis.
|
|
When you set up a phrase to look for local effects, the system checks
|
|
for significant differences in weather element values between
|
|
contrasting edit areas. If differences are found, they will be reported
|
|
in the phrase. For example, through the GFE GUI we can define
|
|
contrasting edit areas, "AboveElev" e.g. above 6000 feet and
|
|
"BelowElev"
|
|
e.g. below 6000 feet. Then we can set up local effects for a
|
|
particular phrase within our Component Product definition by doing the
|
|
following:
|
|
<ul>
|
|
<li> <b>Define contrasting edit areas</b>. Determine what areas
|
|
might
|
|
exhibit results that are significantly different. Create edit
|
|
areas for them through the GFESuite GUI. For example, we might
|
|
expect that elevations above 10,000 feet will have temperatures
|
|
significantly different from those below 10,000 feet so we create an
|
|
edit area through the GFE for each.</li>
|
|
<li> <b>Specify the areas that need to be intersected with the
|
|
current area to examine for local effects</b>. List these by
|
|
weather element in the "intersectAreas" of the Component Product
|
|
definition.</li>
|
|
<li> <b>Specify the areas that do not need to be intersected with
|
|
the
|
|
current area to examine for local effects.</b> You might want to
|
|
list areas for local effect comparison "as is" i.e. without
|
|
intersecting
|
|
them with the current area. If so, list these in the
|
|
"additionalAreas" section of the Product Component definition.</li>
|
|
<li> <b>Set up a "localEffectsList" </b>for the phrase(s)<b> </b>for
|
|
which you want local effects to be generated. The local effects
|
|
list consists of 1 or more LocalEffects. If <font
|
|
color="#663366"> </font><font color="#000000">you have more than one
|
|
LocalEffect, each is examined in order. The first local effect to fire
|
|
will be reported. </font><font color="#990000"> NOTE: The List of
|
|
Local Effects may be specified as a Python method which will be given
|
|
arguments (tree, node) and should return a list of Local Effects.</font><font
|
|
color="#000000">A Local Effect consists of the following information:</font></li>
|
|
<ul>
|
|
<li>List of Local Effect Areas. You may list 2 or more areas
|
|
for comparison. When there are more than 2 areas, the system
|
|
determines "groupings" of areas with similar statistics and reports
|
|
them
|
|
together. <font color="#990000">NOTE: The List of Local Effects
|
|
may be specified as a Python method which will be given arguments
|
|
(tree,
|
|
node) and should return a list of Local Effect Areas.</font> Each
|
|
Local Effect Area consists of the following:</li>
|
|
<ul>
|
|
<li>Edit Area Name. This can be a special string
|
|
"__Current__" to denote the current edit area.</li>
|
|
<li>Description String: This is the string to be used in the
|
|
resulting phrase e.g. "in the mountains", "on the coast". <font
|
|
color="#990000">NOTE: the Description String can be specified as a
|
|
Python method which will be given arguments (tree, node, leArea) and
|
|
should return a description string. In this way, you can
|
|
determine
|
|
the description string on-the-fly perhaps dependent on the current edit
|
|
area.</font></li>
|
|
</ul>
|
|
<li>Difference Threshold: This is a scalar difference value to be
|
|
used in comparing the local effect areas. <font
|
|
color="#990000">NOTE: the Difference Threshold can be specified as a
|
|
Python method which will be given arguments (tree, node, localEffect,
|
|
leArea1Label, leArea2Label) and should return 1 if there is a local
|
|
effect difference detected between the two areas. This will
|
|
allow more flexibility in drawing comparisons between local effect
|
|
areas.</font></li>
|
|
<li>Local Effect Connecting Words: This is a word string to
|
|
connect local effects that are reported within one phrase.
|
|
E.g. <font color="#993300"> "Highs 45-55</font><font
|
|
color="#006600">...except</font><font color="#993300">35-45 above
|
|
timberline."</font></li>
|
|
</ul>
|
|
</ul>
|
|
The following Component definition sets up local effects for the
|
|
highs_phrase, lows_phrase, and wind_withGusts_phrase:
|
|
<p> <font color="#33cc00"> </font><font color="#006600"> def
|
|
Period_1(self):</font> <br>
|
|
<font color="#006600"> return
|
|
{</font> <br>
|
|
<font color="#006600">
|
|
"type": "component",</font> <br>
|
|
<font color="#006600">
|
|
"methodList": [</font> <br>
|
|
<font color="#006600">
|
|
self.orderPhrases,<br>
|
|
|
|
self.assemblePhrases,</font> <br>
|
|
<font color="#006600">
|
|
self.wordWrap,</font> <br>
|
|
<font color="#006600">
|
|
],</font> <br>
|
|
<font color="#006600">
|
|
"analysisList": [</font> <br>
|
|
<font color="#006600">
|
|
("MinT", self.stdDevMinMax),</font> <br>
|
|
<font color="#006600">
|
|
("MaxT", self.stdDevMinMax),</font> <br>
|
|
<font color="#006600">
|
|
("T", self.hourlyTemp),</font> <br>
|
|
<font color="#006600">
|
|
("Wind", self.vectorMedianRange, [6]),</font> <br>
|
|
<font color="#006600">
|
|
("Wind", self.vectorMinMax, [6]),</font> <br>
|
|
<font color="#006600">
|
|
("WindGust", self.avg, [6]),</font> <br>
|
|
<font color="#006600">
|
|
],</font> <br>
|
|
<font color="#006600">
|
|
"phraseList":[</font> <br>
|
|
<font color="#006600">
|
|
self.wind_summary,</font> <br>
|
|
<font color="#006600">
|
|
self.reportTrends,</font> <br>
|
|
<font color="#993399"> </font><font color="#006600">
|
|
#self.highs_phrase,</font> <br>
|
|
<font color="#006600">
|
|
#self.lows_phrase,</font> <br>
|
|
<font color="#663366">
|
|
(self.highs_phrase, self._tempLocalEffects_list()),</font> <br>
|
|
<font color="#663366">
|
|
(self.lows_phrase, self._tempLocalEffects_list()),</font> <br>
|
|
<font color="#006600">
|
|
#self.highs_range_phrase,</font> <br>
|
|
<font color="#006600">
|
|
#self.lows_range_phrase,</font> <br>
|
|
<font color="#006600">
|
|
#self.wind_withGusts_phrase,</font> <br>
|
|
<font color="#006600"> </font><font
|
|
color="#663366"> (self.wind_withGusts_phrase,
|
|
self._windLocalEffects_list()),</font> <br>
|
|
<font color="#006600">
|
|
],</font> <br>
|
|
<font color="#663366">
|
|
"intersectAreas": [</font> <br>
|
|
<font color="#663366">
|
|
# Areas listed by weather element that will be</font> <br>
|
|
<font color="#663366">
|
|
# intersected with the current area then</font> <br>
|
|
<font color="#663366">
|
|
# sampled and analysed.</font> <br>
|
|
<font color="#663366">
|
|
# E.g. used in local effects methods.</font> <br>
|
|
<font color="#663366">
|
|
("MaxT", ["Mountains", "Valleys"]),</font> <br>
|
|
<font color="#663366">
|
|
("MinT", ["Mountains", "Valleys"]),</font> <br>
|
|
<font color="#663366">
|
|
("Wind", ["Coast", "Inland"]),</font> <br>
|
|
<font color="#663366">
|
|
("WindGust", ["Coast", "Inland"]),</font> <br>
|
|
<font color="#006600"> ]</font> </p>
|
|
<p><font color="#663366"> def
|
|
_windLocalEffects_list(self):</font> <br>
|
|
<font color="#663366">
|
|
leArea1 = self.LocalEffectArea("Coast", "near the coast")</font> <br>
|
|
<font color="#663366">
|
|
leArea2 = self.LocalEffectArea("Inland", "inland")</font> <br>
|
|
<font color="#663366"> return
|
|
[self.LocalEffect([leArea1, leArea2], 10, " and ")]</font> </p>
|
|
<p><font color="#663366"> def
|
|
_tempLocalEffects_list(self):</font> <br>
|
|
<font color="#663366">
|
|
leArea1 = self.LocalEffectArea("Valleys", "")</font> <br>
|
|
<font color="#663366">
|
|
leArea2 = self.LocalEffectArea("Mountains", "in the mountains")</font> <br>
|
|
<font color="#663366"> return
|
|
[self.LocalEffect([leArea1, leArea2], 8, "...except ")]</font> </p>
|
|
<p>As a result, the system will automatically calculate the
|
|
intersection of the Mountains, Valleys, (for MaxT, MinT) and Coast,
|
|
Inland (for Wind and WindGust) areas with each edit area as it
|
|
processes
|
|
it. Sampling and Analysis statistics will be calculated for
|
|
both intersection areas for the appropriate weather elements. Then, the
|
|
local effects phrase can examine the statistics for differences and
|
|
report according to the methods and words given in the local effects
|
|
definition. For example, the following phrases could be generated
|
|
depending on the data: </p>
|
|
<p> <font color="#993300">"Highs 45-55."</font> <br>
|
|
<font color="#993300"> "Highs 45-55...except 35-45
|
|
above timberline."</font> <br>
|
|
<font color="#993300"> "North winds 20 mph."</font> <br>
|
|
<font color="#993300"> "North winds 20 mph near the
|
|
coast and west winds 10 mph inland."</font> <br>
|
|
<font color="#993300"> "Near the coast...North winds
|
|
20 mph becoming 10 mph in the afternoon. Inland...North winds 10 mph
|
|
becoming light in the afternoon."</font> </p>
|
|
<h4><a name="LocalEffectsandCompoundPhrases"></a><font color="#000000">Local
|
|
Effects and Compound Phrases</font></h4>
|
|
<font color="#000000">Some phrases are "compound" i.e. they are
|
|
composed of other phrases. In this case, you must specify the Local
|
|
Effect per phrase within the compound phrase definition as in the
|
|
following example:</font>
|
|
<p><font color="#006600"> def
|
|
skyWeather_byTimeRange_compoundPhrase(self):</font> <br>
|
|
<font color="#006600"> return
|
|
{</font> <br>
|
|
<font color="#006600">
|
|
"phraseList": [</font> <br>
|
|
<font color="#006600">
|
|
self.fireSky_phrase</font> <br>
|
|
<font color="#006600">
|
|
#self.weather_phrase,</font> <br>
|
|
<font color="#663366">
|
|
(self.weather_phrase, self._generalLocalEffects_list()),</font> <br>
|
|
<font color="#006600">
|
|
],</font> <br>
|
|
<font color="#006600">
|
|
"phraseMethods": [</font> <br>
|
|
<font color="#006600">
|
|
self.assembleSentences,</font> <br>
|
|
<font color="#006600">
|
|
self.skyWeather_finishUp,</font> <br>
|
|
<font color="#006600">
|
|
],</font> <br>
|
|
<font color="#006600">
|
|
}</font> </p>
|
|
<p><font color="#663366"> def
|
|
_generalLocalEffects_list(self):</font> <br>
|
|
<font color="#663366">
|
|
leArea1 = self.LocalEffectArea("Coast", "on the coast")</font> <br>
|
|
<font color="#663366">
|
|
leArea2 = self.LocalEffectArea("Inland", "inland")</font> <br>
|
|
<font color="#663366">
|
|
leArea3 = self.LocalEffectArea("City", "in the city")</font> <br>
|
|
<font color="#663366"> return
|
|
[self.LocalEffect([leArea1, leArea2, leArea3], 5, " ")]</font> </p>
|
|
<p><font color="#000000">Remember, as always, to include the local
|
|
effect areas in the "intersectAreas" list within the component
|
|
definition:</font> </p>
|
|
<p><font color="#006600"> def
|
|
getFirePeriod_intersectAreas(self):</font> <br>
|
|
<font color="#006600"> return
|
|
[</font> <br>
|
|
<font color="#006600">
|
|
("MinT", ["BelowElev", "AboveElev"]),</font> <br>
|
|
<font color="#006600">
|
|
("MaxT", ["BelowElev", "AboveElev"]),</font> <br>
|
|
<font color="#006600">
|
|
("MinRH", ["BelowElev", "AboveElev"]),</font> <br>
|
|
<font color="#006600">
|
|
("MaxRH", ["BelowElev", "AboveElev"]),</font> <br>
|
|
<font color="#006600">
|
|
("RH", ["BelowElev", "AboveElev"]),</font> <br>
|
|
<font color="#006600">
|
|
("Wx", ["BelowElev", "AboveElev"]),</font> <br>
|
|
<font color="#006600">
|
|
]</font> <br>
|
|
</p>
|
|
<h4><a name="ConsolidationRulesforLocalEffects"></a>Consolidation
|
|
Rules for Local Effects</h4>
|
|
Local effect phrases with multiple weather elements and time periods
|
|
could become complicated and unduly wordy. To avoid this, we
|
|
implement the following consolidation rules for local effect phrases:
|
|
<ul>
|
|
<li> <b>Embedded Local Effects</b> for the simple case of no
|
|
sub-phrases simply use the words supplied in the Local Effect
|
|
definition:</li>
|
|
<ul>
|
|
<li> <font color="#993300">"Highs 45 except 25 above timberline."</font></li>
|
|
<li> <font color="#993300">"North winds 20 to 25 mph near the
|
|
coast
|
|
and west winds 10 mph inland."</font></li>
|
|
</ul>
|
|
</ul>
|
|
<ul>
|
|
<li> <b>Conjunctive Local Effects for multiple sub-phrases</b>: If
|
|
any sub-phrase has a local effect, separate into two phrases, one for
|
|
each local effect area. Qualify each phrase with the descriptive
|
|
words for the local effect area.</li>
|
|
<ul>
|
|
<li>Instead of: <font color="#993300">"North winds 20 to 25 mph
|
|
near the coast and west winds 10 mph inland becoming 10 mph near the
|
|
coast and light inland in the afternoon."</font></li>
|
|
<br>
|
|
Produce: <font color="#993300">"Near the coast...North winds 20 to 25
|
|
mph becoming 10 mph in the afternoon. Inland...North winds 20 to
|
|
25 mph becoming light in the</font> <li><font color="#993300">afternoon."</font></li>
|
|
<li>Instead of: <font color="#993300">"North winds 20 to 25 mph
|
|
except west winds 10 mph in the valleys becoming 10 mph except light in
|
|
the valleys in the afternoon."</font></li>
|
|
<br>
|
|
<font color="#000000">Produce:</font><font color="#993300"> "North
|
|
winds 20 to 25 mph becoming 10 mph. In the valleys...west winds 10 mph
|
|
becoming light in the afternoon."</font>
|
|
</ul>
|
|
</ul>
|
|
<font color="#cc0000">NOTE: </font><font color="#000000">If you are
|
|
setting up a local effect for a multiple-element phrase, you MUST
|
|
include all the weather elements in the "intersectAreas" and/or
|
|
"additionalAreas" lists.</font>
|
|
<h4><a name="LocalEffectExamples"></a>Local Effect Examples</h4>
|
|
<h4> <a name="NullValuesandLocalEffects"></a><b>Null Values and
|
|
Local Effects</b></h4>
|
|
Below area local Effect phrases where one area has a null (below
|
|
threshold) value so that only one local effect area is mentioned.
|
|
<p>Set Up: </p>
|
|
<p><font color="#006600"> def
|
|
_windLocalEffects_list(self):</font> <br>
|
|
<font color="#006600">
|
|
srnInland = self.LocalEffectArea("Inland","")</font> <br>
|
|
<font color="#006600">
|
|
srnBeaches = self.LocalEffectArea("Beaches","at the beaches")</font> <br>
|
|
<font color="#006600"> return
|
|
[self.LocalEffect([srnInland, srnBeaches], 5, "...except ")]</font> </p>
|
|
<p>The local effect descriptor will appear at the end of the sentence
|
|
IF there is only one subphrase. </p>
|
|
<p><span style="color: rgb(153, 51, 0);">SOUTHWEST WINDS 25 TO 35 MPH
|
|
AT THE BEACHES.</span> </p>
|
|
<p>Otherwise, the sentence would be ambiguous: </p>
|
|
<p><span style="color: rgb(153, 51, 0);">SOUTHWEST WINDS 25 TO 35 MPH
|
|
INCREASING TO 40 TO 50</span> <br>
|
|
<span style="color: rgb(153, 51, 0);">MPH IN THE AFTERNOON AT THE
|
|
BEACHES.</span> </p>
|
|
<p>So the system produces: </p>
|
|
<p><span style="color: rgb(153, 51, 0);">AT THE BEACHES...SOUTHWEST
|
|
WINDS 25 TO 35 MPH INCREASING TO 40 TO 50</span> <br>
|
|
<span style="color: rgb(153, 51, 0);">MPH IN THE AFTERNOON.</span> </p>
|
|
<p><span style="font-weight: bold;">Null values and Wx:</span> For
|
|
periods in which you have Local Effects for Wx, you might want to
|
|
specify a<span style="color: rgb(102, 51, 102);"></span><span
|
|
style="font-style: italic; color: rgb(102, 51, 102);">first_null_nlValue</span>
|
|
and <span style="font-style: italic; color: rgb(102, 51, 102);">null_nlValue</span>
|
|
of "dry" so that the local effect can be correctly reported. For
|
|
example: </p>
|
|
<p><span style="color: rgb(0, 102, 0);">def null_nlValue_dict(self,
|
|
tree, node):</span> <br>
|
|
<span style="color: rgb(0, 102, 0);">
|
|
# Descriptors for phrases</span> <br>
|
|
<span style="color: rgb(0, 102, 0);">
|
|
dict = TextRules.TextRules.null_nlValue_dict(self, tree, node)</span> <br>
|
|
<span style="color: rgb(0, 102, 0);">
|
|
componentName = node.getComponentName()</span> <br>
|
|
<span style="color: rgb(0, 102, 0);">
|
|
if componentName == "Period_1":</span> <br>
|
|
<span style="color: rgb(0, 102, 0);">
|
|
dict[Wx"] = "dry"</span> <br>
|
|
<span style="color: rgb(0, 102, 0);">
|
|
return dict</span> </p>
|
|
<p>Then you will get phrases like: </p>
|
|
<p style="color: rgb(102, 51, 51);">SCATTERED SHOWERS...EXCEPT DRY IN
|
|
THE BLUE MOUNTAINS. </p>
|
|
<p>instead of just: </p>
|
|
<p style="color: rgb(102, 51, 51);">SCATTERED SHOWERS. </p>
|
|
<h4><a name="ExceptversusOtherwiseWording"></a>"Except" versus
|
|
"Otherwise" Wording</h4>
|
|
Below area examples of how to set up "except" types wording versus
|
|
"otherwise" wording in a local effect phrase. <br>
|
|
Set-up:
|
|
<p> <font color="#006600"> def
|
|
_windLocalEffects_list(self):</font> <br>
|
|
<font color="#006600">
|
|
srnInland = self.LocalEffectArea("BelowElev","")</font> <br>
|
|
<font color="#006600">
|
|
srnBeaches = self.LocalEffectArea("AboveElev","at the beaches")</font> <br>
|
|
<font color="#006600"> return
|
|
[self.LocalEffect([srnInland, srnBeaches], 5, "...except ")]</font> </p>
|
|
<p>SOUTHWEST WINDS 5 TO 15 MPH...EXCEPT SOUTHWEST 25 TO 35 MPH AT THE
|
|
BEACHES. </p>
|
|
<p>SOUTHWEST WINDS 5 TO 15 MPH. AT THE BEACHES...SOUTHWEST WINDS 25 TO <br>
|
|
35 MPH INCREASING TO 40 TO 50 MPH IN THE AFTERNOON. </p>
|
|
<p>Set-up: </p>
|
|
<p><font color="#006600"> def
|
|
_windLocalEffects_list(self):</font> <br>
|
|
<font color="#006600">
|
|
srnInland = self.LocalEffectArea("BelowElev","", "inland" )</font> <br>
|
|
<font color="#006600">
|
|
srnBeaches = self.LocalEffectArea("AboveElev","at the beaches")</font> <br>
|
|
<font color="#006600"> return
|
|
[self.LocalEffect([srnBeaches, srnInland,], 5, "...otherwise ")]</font>
|
|
</p>
|
|
<p>SOUTHWEST WINDS 25 TO 35 MPH AT THE BEACHES...OTHERWISE SOUTHWEST 5
|
|
TO <br>
|
|
15 MPH. </p>
|
|
<p>AT THE BEACHES...SOUTHWEST WINDS 25 TO 35 MPH INCREASING TO 40 TO 50
|
|
<br>
|
|
MPH IN THE AFTERNOON. INLAND...SOUTHWEST WINDS 5 TO 15 MPH. </p>
|
|
<h4><a name="LocalEffectAreasthatdonotIntersecttheCurrentArea"></a>More
|
|
Local Effect Features</h4>
|
|
The following example shows several features of the Local Effects
|
|
capability:
|
|
<ul>
|
|
<li>using "additional" (not "intersect") areas for Local Effects</li>
|
|
<li>using a method for defining the LocalEffect list based on the
|
|
current edit area</li>
|
|
<li>using the __Current__ area for comparison</li>
|
|
<li>checking for multiple Local Effects in order of precedence</li>
|
|
</ul>
|
|
In the following set-up, we have a small area (area1) which is a subset
|
|
of the larger zone. This area is used instead of the larger zone
|
|
for phrase reporting. However, in the case of temperature, we
|
|
want
|
|
to identify if certain regions (the Rush Valley or the Benches) within
|
|
the zone exhibit temperatures significantly different from the small
|
|
area. This applies to only one area (area1) . For
|
|
other areas in the product , we do not want to identify any Local
|
|
Effects. Since the comparison areas (Rush_Valley and Benches) do
|
|
not intersect area1, we specify them in the product component as
|
|
"additionalAreas" instead of "intersectAreas" AND we set the
|
|
"intersectFlag" to zero when defining them as LocalEffectAreas.
|
|
<p>Set-up: </p>
|
|
<p>In the product component definition, we specify the local effects
|
|
list as a method rather returning a list. This is necessary since
|
|
we want to define the list "on-the-fly" based on the current edit area:
|
|
</p>
|
|
<p> <font
|
|
color="#006600">(self.highs_phrase, self._tempLocalEffects_list),</font>
|
|
<br>
|
|
<font color="#006600">
|
|
(self.lows_phrase, self._tempLocalEffects_list),</font> </p>
|
|
<p><font color="#000000">Then we add in the additonal areas to be
|
|
sampled and analyzed:</font> </p>
|
|
<p><font color="#006600">
|
|
"additionalAreas": [</font> <br>
|
|
<font color="#006600">
|
|
# Areas listed by weather element that will be</font> <br>
|
|
<font color="#006600">
|
|
# intersected with the current area then</font> <br>
|
|
<font color="#006600">
|
|
# sampled and analyzed.</font> <br>
|
|
<font color="#006600">
|
|
# E.g. used in local effects methods.</font> <br>
|
|
<font color="#006600">
|
|
("MaxT", ["Benches", "Rush_Valley"]),</font> <br>
|
|
<font color="#006600">
|
|
("MinT", ["Benches", "Rush_Valley"]),</font> <br>
|
|
<font color="#006600">
|
|
],</font> </p>
|
|
<p><font color="#000000">Finally, we provide the method for defining
|
|
the local effects list "on-the-fly."</font> </p>
|
|
<p><font color="#006600"> def
|
|
_tempLocalEffects_list(self, tree, node):</font> <br>
|
|
<font color="#006600"> if
|
|
self.currentAreaContains(tree, ["area1"]):</font> <br>
|
|
<font color="#006600">
|
|
leArea1 = self.LocalEffectArea(</font> <br>
|
|
<font color="#006600">
|
|
"__Current__","",intersectFlag=0)</font> <br>
|
|
<font color="#006600">
|
|
leArea2 = self.LocalEffectArea("Rush_Valley",</font> <br>
|
|
<font color="#006600">
|
|
"in the rush valley", intersectFlag=0)</font> <br>
|
|
<font color="#006600">
|
|
leArea3 = self.LocalEffectArea(</font> <br>
|
|
<font color="#006600">
|
|
"Benches", "in the benches",intersectFlag=0)</font> <br>
|
|
<font color="#006600">
|
|
return [</font> <br>
|
|
<font color="#006600">
|
|
self.LocalEffect([leArea1,leArea2],5,"...except "),</font> <br>
|
|
<font color="#006600">
|
|
self.LocalEffect([leArea1,leArea3],5,"...except "),</font> <br>
|
|
<font color="#006600">
|
|
]</font> <br>
|
|
<font color="#006600"> else:</font>
|
|
<br>
|
|
<font color="#006600">
|
|
return []</font> </p>
|
|
<p><font color="#000000">Note that the Rush Valley will be checked
|
|
first. If a local effect is found, it will be reported:</font> </p>
|
|
<p><font color="#993500">HIGHS IN THE UPPER 50S...EXCEPT IN THE UPPER
|
|
20S TO UPPER 40S IN THE RUSH VALLEY.</font> </p>
|
|
<p><font color="#000000">If not, the Benches will be checked and if a
|
|
local effect is found, it will be reported:</font> </p>
|
|
<p><font color="#973500">HIGHS IN THE UPPER 50S...EXCEPT IN THE UPPER
|
|
20S TO UPPER 40S IN THE BENCHES.</font> </p>
|
|
<p><font color="#000000">Finally, if neither area triggers a local
|
|
effect, a simple phrase will be reported:</font> </p>
|
|
<p><font color="#973500">HIGHS IN THE UPPER 50S.</font> <br>
|
|
</p>
|
|
<h4><a name="LocalEffectsforSnowAccumulationandTotalSnowAccumulation"></a>Local
|
|
Effects for Snow Accumulation and Total Snow Accumulation -- Using a
|
|
Method for the Checking the Local Effect Threshold</h4>
|
|
This section outlines how to produce local effect phrases such as the
|
|
following:
|
|
<p><font color="#993300">SNOW ACCUMULATION 4 INCHES...EXCEPT 7 INCHES
|
|
ABOVE</font> <br>
|
|
<font color="#993300">TIMBERLINE. TOTAL SNOW ACCUMULATION 9
|
|
INCHES...EXCEPT 18 INCHES</font> <br>
|
|
<font color="#993300">ABOVE TIMBERLINE.</font> </p>
|
|
<p>In your overrides file, you must override the product component(s)
|
|
for
|
|
which you want to report local effects for the snow_phrase and/or
|
|
total_snow_phrase. In these component definitions, specify the local
|
|
effect as follows: </p>
|
|
<p><font color="#006600">
|
|
(self.snow_phrase,self._snowAmtLocalEffects_list()),</font> <br>
|
|
<font color="#006600">
|
|
(self.total_snow_phrase,self._totalSnowAmtLocalEffects_list()),</font> </p>
|
|
<p>Next, add the "intersectAreas" to these components for SnowAmt and
|
|
IceAmt (note that IceAmt is handled by the SnowAmt phrase): </p>
|
|
<p> <font color="#006600">
|
|
"intersectAreas": [</font> <br>
|
|
<font color="#006600">
|
|
# Areas listed by weather element that will be</font> <br>
|
|
<font color="#006600">
|
|
# intersected with the current area then</font> <br>
|
|
<font color="#006600">
|
|
# sampled and analysed.</font> <br>
|
|
<font color="#006600">
|
|
# E.g. used in local effects methods.</font> <br>
|
|
<font color="#006600">
|
|
("SnowAmt", ["BelowElev", "AboveElev"]),</font> <br>
|
|
<font color="#006600">
|
|
("IceAmt", ["BelowElev", "AboveElev"]),</font> <br>
|
|
<font color="#006600">
|
|
],</font> </p>
|
|
<p><font color="#000000">IMPORTANT NOTE: The total_snow_phrase
|
|
looks AHEAD one period for information about snow ending (SnowAmt = 0).
|
|
Therefore, you must include the "intersectAreas" in the component
|
|
FOLLOWING the ones in which you are specifying a local effect for the
|
|
total_snow_phrase. For example, in the ZFP_<site>_Overrides file
|
|
using the 10-503
|
|
directive, if I set up a total_snow_phrase local effect for Period_1
|
|
and
|
|
Period_2_3, I must also include the "intersectAreas" for Period_4_5.</font>
|
|
</p>
|
|
<p><font color="#000000">Finally, include the following local
|
|
effect lists in your Overrides file:</font> </p>
|
|
<p><font color="#006600"> def
|
|
_snowAmtLocalEffects_list(self):</font> <br>
|
|
<font color="#006600">
|
|
leArea1 = self.LocalEffectArea("BelowElev", "")</font> <br>
|
|
<font color="#006600">
|
|
leArea2 = self.LocalEffectArea("AboveElev", "above timberline")</font> <br>
|
|
<font color="#006600"> return
|
|
[self.LocalEffect([leArea1, leArea2], 2, "...except ")]</font> </p>
|
|
<p><font color="#006600"> def
|
|
_totalSnowAmtLocalEffects_list(self):</font> <br>
|
|
<font color="#006600">
|
|
leArea1 = self.LocalEffectArea("BelowElev", "")</font> <br>
|
|
<font color="#006600">
|
|
leArea2 = self.LocalEffectArea("AboveElev", "above timberline")</font> <br>
|
|
<font color="#006600"> return
|
|
[self.LocalEffect(</font> <br>
|
|
<font color="#006600">
|
|
[leArea1, leArea2], self._checkTotalSnow, "...except ")]</font> </p>
|
|
<p><font color="#006600"> def _checkTotalSnow(self,
|
|
tree, node, localEffect, leArea1Label, leArea2Label):</font> <br>
|
|
<font color="#006600">
|
|
totalSnow1 = self.getTotalSnow(tree, node, leArea1Label)</font> <br>
|
|
<font color="#006600">
|
|
totalSnow2 = self.getTotalSnow(tree, node, leArea2Label)</font> <br>
|
|
<font color="#006600"> if
|
|
totalSnow1 is None or totalSnow2 is None:</font> <br>
|
|
<font color="#006600">
|
|
return 0</font> <br>
|
|
<font color="#006600"> if
|
|
abs(totalSnow1 - totalSnow2) > 3:</font> <br>
|
|
<font color="#006600">
|
|
return 1</font> <br>
|
|
<font color="#006600"> return
|
|
0</font> </p>
|
|
<h4><a name="LocalEffectsfortheCombinedSkyPopWxPhrase"></a>Local
|
|
Effects for the Combined SkyPopWx Phrase</h4>
|
|
You can set up Local Effects for the combined skyPopWx_phrase just like
|
|
any other phrase. This phrase has primary element of Wx
|
|
with
|
|
Sky and PoP as secondary elements. So local effects (as well as
|
|
sub-phrase combining) is based upon Wx. If you are
|
|
using the skyPopWx_phrase, you must also include the independent Sky,
|
|
PoP, and Wx phrases in your phraseList and then
|
|
include local effects for these phrases as well. It is
|
|
recommended that you use the following Local Effect
|
|
Lists. So, you would have: <br>
|
|
|
|
<p><font color="#006600"> "phraseList":[</font>
|
|
<br>
|
|
<font color="#006600">
|
|
(self.sky_phrase, self._skyLocalEffects_list()),<br>
|
|
</font><font color="#006600">
|
|
(self.skyPopWx_phrase, self._skyPopWxLocalEffects_list()),<br>
|
|
</font><font color="#006600">
|
|
(self.weather_phrase,self._wxLocalEffects_list()),<br>
|
|
</font><font color="#006600">
|
|
|
|
(self.popMax_phrase, self._popLocalEffects_list()),<br>
|
|
</font><font color="#006600">
|
|
...<br>
|
|
|
|
],
|
|
</font>
|
|
<br>
|
|
</p>
|
|
<p>And also within the product component definition: </p>
|
|
<p><font color="#006600">
|
|
"intersectAreas": [</font> <br>
|
|
<font color="#006600">
|
|
("Sky", ["AboveElev", "BelowElev"]),<br>
|
|
|
|
("Wx", ["AboveElev", "BelowElev"]),<br>
|
|
|
|
("PoP", ["AboveElev", "BelowElev"]),<br>
|
|
</font><font color="#006600">
|
|
],</font> </p>
|
|
Set up the Local Effects lists as follows:<br>
|
|
<br>
|
|
<span style="color: rgb(0, 102, 0);">def
|
|
_skyLocalEffects_list(self):</span><br style="color: rgb(0, 102, 0);">
|
|
<span style="color: rgb(0, 102, 0);">
|
|
leArea1 = self.LocalEffectArea("AboveElev", "windward")</span><br
|
|
style="color: rgb(0, 102, 0);">
|
|
<span style="color: rgb(0, 102, 0);">
|
|
leArea2 = self.LocalEffectArea("BelowElev", "leeward")</span><br
|
|
style="color: rgb(0, 102, 0);">
|
|
<span style="color: rgb(0, 102, 0);">
|
|
return [self.LocalEffect([leArea1, leArea2], self.checkSkyDifference,
|
|
"...")]</span><br style="color: rgb(0, 102, 0);">
|
|
<span style="color: rgb(0, 102, 0);"> </span><br
|
|
style="color: rgb(0, 102, 0);">
|
|
<span style="color: rgb(0, 102, 0);"> def
|
|
_wxLocalEffects_list(self):</span><br style="color: rgb(0, 102, 0);">
|
|
<span style="color: rgb(0, 102, 0);">
|
|
leArea1 = self.LocalEffectArea("AboveElev", "windward")</span><br
|
|
style="color: rgb(0, 102, 0);">
|
|
<span style="color: rgb(0, 102, 0);">
|
|
leArea2 = self.LocalEffectArea("BelowElev", "leeward")</span><br
|
|
style="color: rgb(0, 102, 0);">
|
|
<span style="color: rgb(0, 102, 0);">
|
|
return [self.LocalEffect([leArea1, leArea2], 0, "...")]</span><br
|
|
style="color: rgb(0, 102, 0);">
|
|
<br style="color: rgb(0, 102, 0);">
|
|
<span style="color: rgb(0, 102, 0);"> def
|
|
_popLocalEffects_list(self):</span><br style="color: rgb(0, 102, 0);">
|
|
<span style="color: rgb(0, 102, 0);">
|
|
leArea1 = self.LocalEffectArea("AboveElev", "windward")</span><br
|
|
style="color: rgb(0, 102, 0);">
|
|
<span style="color: rgb(0, 102, 0);">
|
|
leArea2 = self.LocalEffectArea("BelowElev", "leeward")</span><br
|
|
style="color: rgb(0, 102, 0);">
|
|
<span style="color: rgb(0, 102, 0);">
|
|
return [self.LocalEffect([leArea1, leArea2], 20, "...")]</span><br
|
|
style="color: rgb(0, 102, 0);">
|
|
<br style="color: rgb(0, 102, 0);">
|
|
<span style="color: rgb(0, 102, 0);"> def
|
|
_skyPopWxLocalEffects_list(self):</span><br
|
|
style="color: rgb(0, 102, 0);">
|
|
<span style="color: rgb(0, 102, 0);">
|
|
leArea1 = self.LocalEffectArea("AboveElev", "windward")</span><br
|
|
style="color: rgb(0, 102, 0);">
|
|
<span style="color: rgb(0, 102, 0);">
|
|
leArea2 = self.LocalEffectArea("BelowElev", "leeward")</span><br
|
|
style="color: rgb(0, 102, 0);">
|
|
<span style="color: rgb(0, 102, 0);">
|
|
# Set threshold to be used by checkSkyWxDifference</span><br
|
|
style="color: rgb(0, 102, 0);">
|
|
<span style="color: rgb(0, 102, 0);">
|
|
self._skyLocalEffectThreshold = 38</span><br
|
|
style="color: rgb(0, 102, 0);">
|
|
<span style="color: rgb(0, 102, 0);">
|
|
return [self.LocalEffect([leArea1, leArea2],</span><br
|
|
style="color: rgb(0, 102, 0);">
|
|
<span style="color: rgb(0, 102, 0);">
|
|
self.checkSkyWxDifference, "...")]</span><br
|
|
style="color: rgb(0, 102, 0);">
|
|
<br>
|
|
<h4> <a name="PERIODCOMBINING"></a>PERIOD COMBINING</h4>
|
|
Narrative products include a period combining capability that attempts
|
|
to combine periods with similar weather forecast values. To activate
|
|
period combining uncomment the following line in your Overrides file.
|
|
<p> <font color="#006600">Definition["periodCombining"]
|
|
= 1 # If 1, do period combining</font> <br>
|
|
</p>
|
|
<p>Period combining is set up by methods found in the PhraseBuilder
|
|
module: </p>
|
|
<p>1) If the periodCombining flag is set to 1 in the product, we add a
|
|
method to the product narrative tree top level node called
|
|
"combineComponents" (in PhraseBuilder module). <br>
|
|
2) The "combineComponents" method is called at the top of the tree and
|
|
compares all consecutive components for similarity. Also, we are
|
|
only combining components that begin 36 hours after the issuance time
|
|
of the product. <br>
|
|
3) If two components are deemed similar (according to the "<i><font
|
|
color="#993399">periodCombining_elementList</font></i>" (in
|
|
ConfigVariables)), then the component nodes are collapsed into one
|
|
node with the time range spanning the original nodes. <br>
|
|
4) From here all phrases and processing pretty much the same as it
|
|
would have been for the original nodes. To simplify combined
|
|
period
|
|
phrasing, there is a threshold "<i><font color="#993399">collapsedSubPhrase_hours</font></i>"
|
|
(in ConfigVariables) which is set to 12 hours as the default. If the
|
|
period is longer than these hours, subphrases will automatically be
|
|
collapsed. <br>
|
|
</p>
|
|
<p>Periods can be combined providing the differences between the
|
|
adjacent periods are small. There is one method per weather
|
|
element that determines whether two periods should be combined or
|
|
not. These methods are found in the PhraseBuilder module.
|
|
Each of them begin with "similar" followed by the weather element
|
|
name. The table below shows the methods that have been
|
|
implemented
|
|
thus far and their thresholds. <br>
|
|
<br>
|
|
<table nosave="" border="1" cols="3" width="100%">
|
|
<caption><br>
|
|
</caption><tbody>
|
|
</tbody> <tbody>
|
|
<tr>
|
|
<td> Element Name as listed in the <i><font color="#993399">periodCombining_elementList</font></i></td>
|
|
<td> Method Name (in PhraseBuilder module)</td>
|
|
<td> Thresholds</td>
|
|
</tr>
|
|
<tr>
|
|
<td> Sky</td>
|
|
<td> <i><font color="#993399">similarSky</font></i></td>
|
|
<td> Sky words are similar<br>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td> Wind</td>
|
|
<td> <i><font color="#993399">similarWind</font></i></td>
|
|
<td> mag within 10 knots <br>
|
|
dir within 45 degrees</td>
|
|
</tr>
|
|
<tr>
|
|
<td> Wx</td>
|
|
<td> <i><font color="#993399">similarWx</font></i></td>
|
|
<td> Identical wx keys per each analyzed sub-range<br>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="vertical-align: top;"> PoP<br>
|
|
</td>
|
|
<td style="vertical-align: top;"> <i><font color="#993399">similarPoP</font></i><br>
|
|
</td>
|
|
<td style="vertical-align: top;">PoPs are equal or both below<i><font
|
|
color="#993399"> pop_lower_threshold </font></i>or both above<i><font
|
|
color="#993399"> pop_upper_threshold<br>
|
|
</font></i></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="vertical-align: top;"> MaxT<br>
|
|
</td>
|
|
<td style="vertical-align: top;"><i><font color="#993399">similarMaxT</font></i></td>
|
|
<td style="vertical-align: top;">MaxT within 5 degrees<br>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="vertical-align: top;"> MinT</td>
|
|
<td style="vertical-align: top;"><i><font color="#993399">similarMinT</font></i></td>
|
|
<td style="vertical-align: top;">MinT within 5 degrees<br>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="vertical-align: top;">WaveHeight<br>
|
|
</td>
|
|
<td style="vertical-align: top;"><i><font color="#993399">similarWaveHeight</font></i></td>
|
|
<td style="vertical-align: top;">WaveHeights within 4 feet<br>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="vertical-align: top;">DiurnalSkyWx</td>
|
|
<td style="vertical-align: top;"><i><font color="#993399">similarDiurnalSkyWx</font></i></td>
|
|
<td style="vertical-align: top;">DiurnalSkyWx will combine if
|
|
there is a diurnal pattern of sky and wx. For example, "CLOUDY IN
|
|
THE NIGHT AND MORNING...OTHERWISE CLEAR." or "LOW CLOUDS AND FOG IN THE
|
|
NIGHT AND MORNING...OTHERWISE CLEAR."<br>
|
|
Note that it will also combine if the sky and wx are similar without a
|
|
diurnal pattern. <br>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</p>
|
|
<p>Each of these methods can be overridden in your Overrides
|
|
file. In
|
|
general, the threshold values are defined near the top of the method,
|
|
so
|
|
you won't need to hunt for them or change them in several places.
|
|
If you desire to change the thresholds, copy the method into your
|
|
Overrides
|
|
file and modify the threshold value. You can also modify the
|
|
algorithm, if you like. The default method retrieves the
|
|
statistics and examines them to see if the values between each
|
|
component
|
|
are close enough to combine. You will likely want to leave the
|
|
code that retrieves the statistics unmodified. But you can choose
|
|
to change the logic that decides if the values are "similar". </p>
|
|
<p>When components are collapsed, we do not want phrases to have
|
|
detailed sub-phrases as we would in a normal 12-hour period.
|
|
Sub-phrases are then automatically collapsed if the combined period
|
|
exceeds the <i><font color="#993399">collapsedSubPhrase_hours </font></i><font
|
|
color="#000000"> found in the ConfigVariables module. When
|
|
sub-phrases are collapsed, the data is summarized according to the </font><i><font
|
|
color="#993399">mergeMethod</font></i><font color="#000000"> for the
|
|
weather element being collapsed. These settings can be overridden
|
|
in your Overrides file.</font> </p>
|
|
<p> <font color="#006600"> def
|
|
collapseSubPhrase_hours_dict(self, tree, node):</font> <br>
|
|
<font color="#006600"> # If
|
|
the period is longer than these hours, subphrases will automatically</font>
|
|
<br>
|
|
<font color="#006600"> # be
|
|
collapsed.</font> <br>
|
|
<font color="#006600"> return
|
|
{</font> <br>
|
|
<font color="#006600">
|
|
"otherwise": 24,</font> <br>
|
|
<font color="#006600">
|
|
#"Wx": 24,</font> <br>
|
|
<font color="#006600">
|
|
}</font> </p>
|
|
<p><font color="#006600"> def mergeMethod_dict(self,
|
|
tree, node):</font> <br>
|
|
<font color="#006600"> #
|
|
Designates the mergeMethod to use when sub-phrases are automatically
|
|
collapsed.</font> <br>
|
|
<font color="#006600"> return
|
|
{</font> <br>
|
|
<font color="#006600">
|
|
"otherwise": "Average",</font> <br>
|
|
<font color="#006600">
|
|
"MinT": "Min",</font> <br>
|
|
<font color="#006600">
|
|
"MaxT": "Max",</font> <br>
|
|
<font color="#006600">
|
|
"PoP": "Max",</font> <br>
|
|
<font color="#006600">
|
|
"Wx": "List", # Still want Wx to be broken out</font> <br>
|
|
<font color="#006600">
|
|
}</font> </p>
|
|
<h4> <a name="STRATEGYFORPHRASECONSOLIDATION"></a>PHRASE
|
|
CONSOLIDATION</h4>
|
|
Phrases with multiple weather elements and complex temporal resolution
|
|
can become very complicated and unduly wordy. To avoid these
|
|
situations, we implement a set of consolidation rules described in this
|
|
section. These rules are for Scalar and Vector elements.
|
|
For information on Weather consolidation see the Section on <a
|
|
href="#WEATHERKEYFILTERING">Weather Phrasing.</a><br>
|
|
<p>Definitions: Phrases are composed of sub-phrases depending on the
|
|
temporal resolution of the statistics. For example, the Wind
|
|
phrase in the ZFP is composed of 2 6-hour sub-phrases, e.g. "North wind
|
|
10-15 mph increasing to 20 mph in the afternoon." A phrase can report
|
|
on
|
|
multiple elements (e.g. Wind and WindGust). "North wind 10-15 mph
|
|
with gusts up to 35 mph." Weather elements in these phrases are
|
|
considered "primary" and "secondary". </p>
|
|
<ul>
|
|
<li>More than one element can be designated as "primary" in a phrase.
|
|
For example, for the wind phrase "Wind" and "WindGust" would both be
|
|
primary.</li>
|
|
<li>Though there can be more than one primary element for
|
|
consolidation purposes, the sub-phrase time ranges will be based upon
|
|
the first element's statistics.</li>
|
|
<li> <b>Consolidation Rule: Separate any "primary elements" that are
|
|
similar throughout the time period into a separate phrase.</b></li>
|
|
<ul>
|
|
<li>Instead of: <font color="#993300">"North wind 10 mph with
|
|
gusts up to 35 mph increasing to 20 mph with gusts up to 35 mph in the
|
|
afternoon."</font></li>
|
|
<li>Produce: <font color="#993300">"North wind 10 mph increasing
|
|
to 20 mph in the afternoon. Gusts up to 35 mph."</font></li>
|
|
</ul>
|
|
<li>Elements can still be designated as secondary so that when
|
|
combined, an average, min, max, or sum of their values can be used.
|
|
Suppose that Swell and Swell2 are primary and Period and Period2 are
|
|
secondary.</li>
|
|
<ul>
|
|
<li>Instead of: <font color="#993300">"North swell 10 ft at 5
|
|
seconds and northeast swell 12 ft at 5 seconds becoming north swell 10
|
|
ft at 15 seconds and north swell 15 ft at 5 seconds"</font></li>
|
|
<li>Produce: <font color="#993300">"North swell 10 ft at 10
|
|
seconds and northeast swell 12-15 ft at 5 seconds."</font></li>
|
|
</ul>
|
|
<li> <b>Consolidation Rule For Vector Direction: If there are no
|
|
secondary elements and the direction is a progression with similar
|
|
magnitudes, report only the first and last directions.</b></li>
|
|
<ul>
|
|
<li>Instead of: <font color="#993300">"North wind 10 mph becoming
|
|
northeast 15 mph in the late morning becoming east 10 mph."</font></li>
|
|
<li>Produce: <font color="#993300">"North wind 10-15 mph becoming
|
|
east 10 mph in the afternoon."</font></li>
|
|
</ul>
|
|
<li> <b>Consolidation Rule For Trends: If there are no secondary
|
|
elements and the magnitude is a progression over the time period,
|
|
report
|
|
only the first and last magnitudes with no time descriptors.</b></li>
|
|
<ul>
|
|
<li>Instead of: <font color="#993300">"Waves 2 to 4 feet building
|
|
to 3 to 6 ft in the late morning and early afternoon building to 4 to 7
|
|
feet."</font></li>
|
|
<li>Produce: <font color="#993300">"Waves 2 to 4 feet building to
|
|
4 to 7 feet."</font></li>
|
|
</ul>
|
|
</ul>
|
|
<h4> <a name="PHRASEORDERING"></a>PHRASE ORDERING</h4>
|
|
You might want to re-order the phrases of a component based on the
|
|
forecast data. For example, suppose we have the following:
|
|
<p><font color="#993300">.TODAY...STRONG WINDS. THUNDERSTORMS WITH
|
|
HEAVY RAINFALL. HIGHS</font> <br>
|
|
<font color="#993300">AROUND 80. SOUTHEAST WINDS AROUND 70 MPH BECOMING
|
|
SOUTH AROUND 105</font> <br>
|
|
<font color="#993300">MPH IN THE AFTERNOON.</font> </p>
|
|
<p><font color="#000000">The winds are the most dominant feature and
|
|
thus you might want to move the "wind_withGusts_phrase" closer to the
|
|
beginning of the forecast. To re-order phrases on-the-fly, follow
|
|
steps similar to this example:</font> </p>
|
|
<p><font color="#000000">--Make sure the Product Component Definition
|
|
for any Periods in which you'd like to order the phrases has the
|
|
method, "orderPhrases", prior to "assembleSubPhrases":</font> </p>
|
|
<p><font color="#006600"> def Period_1(self):</font> <br>
|
|
<font color="#006600">
|
|
component = {</font> <br>
|
|
<font color="#006600">
|
|
"type": "component",</font> <br>
|
|
<font color="#006600">
|
|
"methodList": [</font> <br>
|
|
<font color="#006600">
|
|
self.orderPhrases,</font> <br>
|
|
<font color="#006600">
|
|
self.assemblePhrases,</font> <br>
|
|
<font color="#006600">
|
|
self.wordWrap,</font> <br>
|
|
<font color="#006600">
|
|
],</font> <br>
|
|
<font color="#006600">
|
|
....</font> </p>
|
|
<p><font color="#000000"> --Modify the
|
|
"orderPhrases"(PhraseBuilder) method, for example:</font> </p>
|
|
<p><font color="#006600"> def orderPhrases(self,
|
|
tree, component):</font> <br>
|
|
<font color="#006600">
|
|
reorderList = []</font> <br>
|
|
<font color="#006600">
|
|
timeRange = component.getTimeRange()</font> <br>
|
|
<font color="#006600">
|
|
areaLabel = component.getAreaLabel()</font> </p>
|
|
<p><font color="#006600"> #
|
|
Put in some logic to see if you want to re-arrange the order</font> <br>
|
|
<font color="#006600"> # of
|
|
the phrases. For example:</font> <br>
|
|
<font color="#006600"> #
|
|
Check for high winds</font> <br>
|
|
<font color="#006600">
|
|
windMax, dir = tree.stats.get("Wind", timeRange, areaLabel,
|
|
mergeMethod="Max")</font> <br>
|
|
<font color="#006600"> if
|
|
windMax > 50:</font> <br>
|
|
<font color="#006600">
|
|
# Put wind phrase first</font> <br>
|
|
<font color="#006600">
|
|
reorderList.append(("wind_withGusts_phrase", "weather_phrase"))</font> </p>
|
|
<p><font color="#006600"> #
|
|
Apply any reorderings that were identified</font> <br>
|
|
<font color="#006600"> for
|
|
name1, name2 in reorderList:</font> <br>
|
|
<font color="#006600">
|
|
self.moveAbove(tree, component, name1, name2)</font> <br>
|
|
<font color="#006600"> return
|
|
self.DONE()</font> </p>
|
|
<h4><a name="UNTILPHRASING"></a>"UNTIL" PHRASING</h4>
|
|
In some phrases, you might want more resolution on the time descriptors
|
|
such as in the following:
|
|
<p> <font color="#660000"> "</font><font
|
|
color="#993300">North winds 20 mph until 10 AM then 35 mph."</font> </p>
|
|
<p>To accomplish this, override the flags below from the
|
|
ConfigVariables module. Be sure that if you want higher temporal
|
|
resolution in your phrase, to set the temporal resolution in the
|
|
analysisList accordingly. For example: </p>
|
|
<p>
|
|
("Wind", self.vectorMedianRange, [0]), </p>
|
|
<p><font color="#006600"> def
|
|
untilPhrasing_flag_dict(self, tree, node):</font> <br>
|
|
<font color="#006600"> # If
|
|
set to 1, "until" time descriptor phrasing will be used.</font> <br>
|
|
<font color="#006600"> # E.g.
|
|
"NORTH WINDS 20 MPH UNTIL 10 AM...THEN 35 MPH"</font> <br>
|
|
<font color="#006600"> return
|
|
{</font> <br>
|
|
<font color="#006600">
|
|
"otherwise": 0,</font> <br>
|
|
<font color="#006600">
|
|
#"Wind" : 1,</font> <br>
|
|
<font color="#006600">
|
|
}</font> </p>
|
|
<p><font color="#006600"> def
|
|
onTheFly_untilPhrasing_flag_dict(self, tree, node):</font> <br>
|
|
<font color="#006600"> # If
|
|
set to 1, "until" time descriptor phrasing will be used ONLY if</font> <br>
|
|
<font color="#006600"> # the
|
|
time range for a sub-phrase does not end on a 3-hour boundary.</font> <br>
|
|
<font color="#006600"> return
|
|
{</font> <br>
|
|
<font color="#006600">
|
|
"otherwise": 1,</font> <br>
|
|
<font color="#006600">
|
|
#"Wind" : 1,</font> <br>
|
|
<font color="#006600">
|
|
}</font> </p>
|
|
<p><font color="#006600"> def
|
|
untilPhrasing_format_dict(self, tree, node):</font> <br>
|
|
<font color="#006600"> #
|
|
Format for "until" time descriptors.</font> <br>
|
|
<font color="#006600"> # If
|
|
"military": UNTIL 1000</font> <br>
|
|
<font color="#006600"> # If
|
|
"standard": UNTIL 10 AM</font> <br>
|
|
<font color="#006600"> return
|
|
{</font> <br>
|
|
<font color="#006600">
|
|
"otherwise": "military",</font> <br>
|
|
<font color="#006600">
|
|
#"Wind": "standard",</font> <br>
|
|
<font color="#006600">
|
|
}</font> </p>
|
|
<p><font color="#000000">The untilPhrasing may apply to only certain
|
|
components of your product. You can make this distinction as in
|
|
this example from the FWF:</font> </p>
|
|
<p><font color="#006600"> def
|
|
untilPhrasing_flag_dict(self, tree, node):</font> <br>
|
|
<font color="#006600"> # If
|
|
set to 1, "until" time descriptor phrasing will be used.</font> <br>
|
|
<font color="#006600"> # E.g.
|
|
"NORTH WINDS 20 MPH UNTIL 10 AM...THEN 35 MPH"</font> <br>
|
|
<font color="#006600"> # Be
|
|
sure to increase the temporal resolution if desired:</font> <br>
|
|
<font color="#006600"> #
|
|
E.g. ("MixHgt", self.minMax, [0]),</font> <br>
|
|
<font color="#006600"> dict =
|
|
TextRules.TextRules.untilPhrasing_flag_dict(self, tree, node)</font> <br>
|
|
<font color="#006600">
|
|
dict["LAL"] = 1</font> <br>
|
|
<font color="#006600">
|
|
componentName = node.getComponent().get("name")</font> <br>
|
|
<font color="#006600"> if
|
|
componentName == "FirePeriod":</font> <br>
|
|
<font color="#006600">
|
|
dict["Sky"] = 1</font> <br>
|
|
<font color="#006600">
|
|
dict["Wx"] = 1</font> <br>
|
|
<font color="#006600"> return
|
|
dict</font> </p>
|
|
<h4><a name="HANDLINGVISIBILITY"></a><font color="#000000">VISIBILITY</font></h4>
|
|
Visibility is an attribute of the Wx grid and is reported on a
|
|
sub-phrase level within the <font color="#006600">weather_phrase</font>.
|
|
Since each sub-phrase can have multiple subkeys, we report
|
|
the lowest visibility over the subkeys. The
|
|
visibility
|
|
attribute is specified in the grids in statute miles. You can
|
|
specify the output units ("SM" or "NM" for nautical miles) for
|
|
visibility in the <i><font color="#993366">element_outUnits_dict </font></i><font
|
|
color="#000000">for "Visibility"</font><i><font color="#993366">. </font></i>Here's
|
|
an example:
|
|
<p>Example 1: <br>
|
|
Grids: <br>
|
|
Hour 1-6
|
|
Patchy F 1/4SM Chc R 1/2SM <br>
|
|
Hour 7-12 Sct RW </p>
|
|
<p> Phrase: <br>
|
|
CHANCE OF LIGHT RAIN AND PATCHY FOG WITH VISIBILITY LESS THAN 1 NM THEN
|
|
SCATTERED RAIN <br>
|
|
SHOWERS IN THE AFTERNOON. </p>
|
|
<p>Example 2: <br>
|
|
Grids: <br>
|
|
Hour 1-6
|
|
Patchy F 1/4SM Chc R 1/2SM <br>
|
|
Hour 7-12 Sct RW
|
|
11/2SM </p>
|
|
<p> Phrase: CHANCE OF LIGHT RAIN AND PATCHY FOG WITH
|
|
VISIBILITY LESS THAN 1 NM THEN SCATTERED RAIN SHOWERS WITH 2 NM
|
|
VISIBILITY IN THE AFTERNOON. </p>
|
|
<p><font color="#000000">The wording for visibility within the weather
|
|
phrase can be configured by overriding the</font><i><font
|
|
color="#993366">
|
|
visibility_weather_phrase_nlValue.</font></i> </p>
|
|
<p>You can set the <i><font color="#993366">null_nlValue </font></i>
|
|
for "Visibility" so that only visibilities below the threshold are
|
|
reported. The value should be in nautical miles. Suppose we have
|
|
set this value to 3 nautical miles, Then: </p>
|
|
<p>Example 3: <br>
|
|
Grids: <br>
|
|
Hour 1-6
|
|
Patchy F 4SM Chc R <br>
|
|
Hour 7-12 Sct RW </p>
|
|
<p> Phrase: <br>
|
|
CHANCE OF LIGHT RAIN AND PATCHY FOG THEN SCATTERED RAIN SHOWERS IN THE
|
|
AFTERNOON. </p>
|
|
<p>You can set the <i><font color="#993366">visibility_wx_threshold</font></i>
|
|
so that weather is only reported if visibility is below the
|
|
threshold. Also, in this case you might want to set up a
|
|
list of <i><font color="#993366">significant_wx_visibility_subkeys. </font></i><font
|
|
color="#000000"> If any of these subkeys appear in the sub-phrase, the
|
|
weather will be reported regardless of the visibility. </font><i><font
|
|
color="#993366"> </font></i>Suppose we have: </p>
|
|
<p> <font color="#006600"> def
|
|
visibility_wx_threshold(self, tree, node):</font> <br>
|
|
<font color="#006600"> #
|
|
Weather will be reported if the visibility is below</font> <br>
|
|
<font color="#006600"> # this
|
|
threshold (in NM) OR if it includes a</font> <br>
|
|
<font color="#006600"> #
|
|
significant_wx_visibility_subkey (see below)</font> <br>
|
|
<font color="#006600"> return
|
|
3</font> </p>
|
|
<p><font color="#006600"> def
|
|
significant_wx_visibility_subkeys(self, tree, node):</font> <br>
|
|
<font color="#006600"> #
|
|
Weather values that constitute significant weather to</font> <br>
|
|
<font color="#006600"> # be
|
|
reported regardless of visibility.</font> <br>
|
|
<font color="#006600"> # If
|
|
your visibility_wx_threshold is None, you do not need</font> <br>
|
|
<font color="#006600"> # to
|
|
set up these subkeys since weather will always be</font> <br>
|
|
<font color="#006600"> #
|
|
reported.</font> <br>
|
|
<font color="#006600"> # Set
|
|
of tuples of weather key search tuples in the form:</font> <br>
|
|
<font color="#006600">
|
|
# (cov type inten)</font> <br>
|
|
<font color="#006600"> #
|
|
Wildcards are permitted.</font> <br>
|
|
<font color="#006600"> return
|
|
[("* T"), ("* ZY")]</font> </p>
|
|
<p>then: </p>
|
|
<p>Example 4: <br>
|
|
Grids: <br>
|
|
Hour 1-6
|
|
Patchy F 1/4SM Chc R 4SM <br>
|
|
Hour 7-12 Sct RW </p>
|
|
<p> Phrase: CHANCE OF LIGHT RAIN AND PATCHY FOG WITH
|
|
VISIBILITY LESS THAN 1 NM IN THE MORNING. </p>
|
|
<p>Example 5: <br>
|
|
Hour 1-6 F 1/4SM RW
|
|
1/2SM <br>
|
|
Hour 7-12 TRW </p>
|
|
<p> Phrase: CHANCE OF LIGHT RAIN AND PATCHY FOG WITH
|
|
VISIBILITY LESS THAN 1 NM THEN SCATTERED SHOWERS AND <br>
|
|
THUNDERSTORMS IN THE AFTERNOON. </p>
|
|
<p>Finally, there is a consolidation method (<font color="#006600">consolidateVisibility</font>
|
|
in WxPhrases). If the low visibility is constant across
|
|
sub-phrases, visibility is separated out into its own phrase: </p>
|
|
<p>Example 6: <br>
|
|
Hour 1-6 F 1/4SM RW
|
|
1/2SM <br>
|
|
Hour 7-12 TRW 1/4SM </p>
|
|
<p> Phrase: CHANCE OF LIGHT RAIN AND PATCHY FOG THEN
|
|
SCATTERED SHOWERS AND THUNDERSTORMS IN THE AFTERNOON. VISIBILITY LESS
|
|
THAN 1 NM. </p>
|
|
<p><font color="#000000">The wording for visibility within the
|
|
visibility_phrase can be configured by overriding the</font><i><font
|
|
color="#993366"> visibility_phrase_nlValue.</font></i> <br>
|
|
</p>
|
|
<p>If you always want visibility reported in its own phrase, you can
|
|
include the <font color="#006600">visibility_phrase</font> in your
|
|
phrase list ANDmake sure to set the <i><font color="#993366">embedded_visibility_flag</font></i><font
|
|
color="#000000"> to zero so that it does not appear redundantly within
|
|
the weather phrase.</font> <br>
|
|
</p>
|
|
<h4><a name="WEATHERKEYFILTERING"></a><font color="#000000">WEATHER
|
|
PHRASING</font></h4>
|
|
Also see sections on <br>
|
|
<a href="#dominantWx">Algorithm for rankedWx
|
|
and dominantWx</a><br>
|
|
<a href="#CustomizingWeatherPhrases">Customizing
|
|
Weather Phrases</a><br>
|
|
<a href="#PopWx_Consistency">PoP/Wx
|
|
Consistency</a><br>
|
|
<a href="#LocalEffectsfortheCombinedSkyPopWxPhrase">Local
|
|
Effects for the Combined SkyPopWx Phrase</a><br>
|
|
<br>
|
|
<font color="#000000">Weather phrasing in the formatters involves many
|
|
modules and logic threads as outlined in the following diagram:<br>
|
|
<br>
|
|
<img src="images/WxDesign.png" alt="Weather Phrase Design"
|
|
style="width: 979px; height: 1181px;"><br>
|
|
<br>
|
|
Weather phrasing is complex, but centers around two primary
|
|
methods: "makeAggregateSubkey" (CommonUtils) and
|
|
"checkWeatherSimilarity" (PhraseBuilder). These methods are
|
|
ultimately employed throughout the many phases of text generation:
|
|
Analysis, Merging of grid statistics, Sub-phrase Combining, Local
|
|
Effects, Period Combining and Weather Wording. This ensures
|
|
consistency throughout the process and makes customizing easier.<br>
|
|
<br>
|
|
The <span style="font-weight: bold;">makeAggregateSubkey</span> method
|
|
consolidates two subkeys according to the following:<br>
|
|
</font>
|
|
<ul>
|
|
<li><font color="#000000">coverage and intensity: choose
|
|
highest ranked, or if similar ranks, strongest</font></li>
|
|
<li><font color="#000000">visibility: choose lowest visibility</font></li>
|
|
<li><font color="#000000">attributes: make aggregate list <br>
|
|
</font></li>
|
|
</ul>
|
|
<font color="#000000">It uses the </font><i><font color="#993366">rankFuzzFactor</font></i>
|
|
(CommonUtils) to determine if 2 ranks are similar. It refers to
|
|
the <i><font color="#993366">wxHierarchies </font></i>(WxPhrases) to
|
|
determine which coverage or intensity is stronger.<br>
|
|
<br>
|
|
The<span style="font-weight: bold;"> checkWeatherSimilarity</span>
|
|
method compares two rankLists i.e. lists of (subkey, rank)
|
|
tuples. It uses <i><font color="#993366">similarWxTypes,
|
|
similarCoverageLists </font></i><font color="#000000"> and </font><i><font
|
|
color="#993366">similarIntensities</font></i><font color="#000000"> to
|
|
determine if subkeys are similar. To
|
|
be deemed similar, the rankLists must meet the following criteria:<br>
|
|
</font>
|
|
<ul>
|
|
<li>Have the same number of subkeys,</li>
|
|
<li>If there is just one subkey per rankList, the subkeys must have
|
|
the same weather type, similar intensities AND similar coverages,</li>
|
|
<li>The rankLists differ only in intensity (this test is skipped if
|
|
"noIntensityCombining" is turned on for the node e.g.
|
|
severeWeather_phrase),<br>
|
|
</li>
|
|
<li>If there is more than one subkey per rankList, they must pass the
|
|
"checkSubkeysSimilarity" test:<br>
|
|
</li>
|
|
<ul>
|
|
<li>The set of wxTypes in rankList1 is equal to the set of wxTypes
|
|
in rankList2 AND <br>
|
|
</li>
|
|
<li>Each wxType individually can be combined i.e. they have similar
|
|
coverages. <br>
|
|
</li>
|
|
</ul>
|
|
<li>In the case that they can be combined, the
|
|
"checkSubkeysSimilarity" method returns an aggregate "rankList" which
|
|
it creates using "makeAggregateSubkey". <br>
|
|
</li>
|
|
</ul>
|
|
<br>
|
|
<font color="#000000"><span style="font-weight: bold;">Analysis:</span>
|
|
The "rankedWx" method is used for weather phrasing and is discussed in
|
|
detail in the section </font><a href="#dominantWx">Algorithm
|
|
for rankedWx
|
|
and dominantWx</a>. Of note, here, is that the algorithm uses the
|
|
"aggregateCov_algorithm" (default is "getAggregateCov") to
|
|
compute an aggregate coverage,
|
|
and the "getAggregate" method to determine the aggregate
|
|
intensity, visibility, and attributes according to the rules of
|
|
the "makeAggregateSubkey" (CommonUtils) method. <br>
|
|
<font color="#000000"><br>
|
|
In the Analysis phase, we also <span style="font-weight: bold;">Filter</span>
|
|
the subkeys. Just as Scalar and Vector statistics are
|
|
automatically converted and rounded, weather subkeys are automatically
|
|
filtered according to the following criteria:</font>
|
|
<ul>
|
|
<li> <font color="#000000">If the</font><font color="#660000"> </font><i><font
|
|
color="#993366">filter_subkeys_flag</font></i><font color="#000000">
|
|
is
|
|
set to 0, no filtering is done. Default is 1.</font></li>
|
|
<li><font color="#000000">Subkeys with the same weather type are
|
|
combined using the "makeAggregateSubkey" method.<br>
|
|
</font></li>
|
|
<li> <font color="#000000">Subkeys with differing weather types are
|
|
combined according to the </font><i><font color="#993366">wxCombinations
|
|
</font></i><font color="#000000">list:</font></li>
|
|
</ul>
|
|
<font color="#000000"> </font><font color="#006600">
|
|
def wxCombinations(self):</font> <br>
|
|
<font color="#006600"> # This
|
|
is the list of which wxTypes should be combined into one.</font> <br>
|
|
<font color="#006600"> # For
|
|
example, if ("RW", "R") appears, then wxTypes of "RW" and "R" will</font>
|
|
<br>
|
|
<font color="#006600"> # be
|
|
combined into one key and the key with the dominant coverage will</font>
|
|
<br>
|
|
<font color="#006600"> # be
|
|
used as the combined key.</font> <br>
|
|
<font color="#006600"> # You
|
|
may also specify a method which will be</font> <br>
|
|
<font color="#006600">
|
|
# -- given arguments subkey1 and subkey2 and</font> <br>
|
|
<font color="#006600">
|
|
# -- should return</font> <br>
|
|
<font color="#006600">
|
|
# -- a flag = 1 if they are to be combined, 0
|
|
otherwise</font> <br>
|
|
<font color="#006600">
|
|
# -- the combined key to be used</font> <br>
|
|
<font color="#006600">
|
|
# Note: The method will be called twice, once with (subkey1,
|
|
subkey2)</font> <br>
|
|
<font color="#006600">
|
|
# and once with (subkey2, subkey1) so you can assume one ordering.</font>
|
|
<br>
|
|
<font color="#006600">
|
|
# See the example below, "combine_T_RW"</font> <br>
|
|
<font color="#006600"> #</font>
|
|
<br>
|
|
<font color="#006600"> return
|
|
[</font> <br>
|
|
<font color="#006600">
|
|
("RW", "R"),</font> <br>
|
|
<font color="#006600">
|
|
("SW", "S"),</font> <br>
|
|
<font color="#006600">
|
|
self.combine_T_RW,</font> <br>
|
|
<font color="#006600">
|
|
]</font>
|
|
<p><font color="#006600"> def
|
|
combine_T_RW(self, subkey1, subkey2):</font> <br>
|
|
<font color="#006600"> #
|
|
Combine T and RW only if the coverage of T</font> <br>
|
|
<font color="#006600"> # is
|
|
dominant over the coverage of RW</font> <br>
|
|
<font color="#006600">
|
|
wxType1 = subkey1.wxType()</font> <br>
|
|
<font color="#006600">
|
|
wxType2 = subkey2.wxType()</font> <br>
|
|
<font color="#006600"> if
|
|
wxType1 == "T" and wxType2 == "RW":</font> <br>
|
|
<font color="#006600">
|
|
order = self.dominantCoverageOrder(subkey1, subkey2)</font> <br>
|
|
<font color="#006600">
|
|
if order == -1:</font> <br>
|
|
<font color="#006600">
|
|
return 1, subkey1</font> <br>
|
|
<font color="#006600"> return
|
|
0, None</font> <br>
|
|
</p>
|
|
<font color="#000000">All weather filtering variables are located in
|
|
the WxPhrases module and can be overridden by copying them into your
|
|
Overrides file.</font> <br>
|
|
<br>
|
|
<span style="font-weight: bold;">Merging of statistics </span>occurs
|
|
when a tree.stats.get command requests statistics for a time period
|
|
spanning more than one in the Statistics Dictionary. For example,
|
|
if we request Wx statistics with a 3-hour temporal resolution and
|
|
request the statistics for a 6-hour period, we must merge the 3-hour
|
|
statistics. Again, we must filter subkeys and ultimately
|
|
employ the "makeAggregateSubkey" method.<br>
|
|
<br>
|
|
<span style="font-weight: bold;">Sub-phrase Combining. </span>There
|
|
are various weather phrases for which we must combine
|
|
sub-phrases. The "skyPopWx_phrase" is used for simpler cases in
|
|
which the resulting phrase only requires 1 or 2 sub-phrases. For
|
|
more complex scenarios, the "weather_phrase" is triggered. The
|
|
"severeWeather_phrase" and "heavyPrecip_phrase" are special cases, but
|
|
use the same combining scheme to determine the appropriate sub-phrasing.<br>
|
|
<ul>
|
|
<li>"weather_phrase", "severeWeather_phrase", "heavyPrecip_phrase"
|
|
rely on the "preProcessWx" method to combine the weather types found in
|
|
the time period of interest. This method uses the
|
|
"checkWeatherSimilarity" method to determine if subkeys can be combined
|
|
and the "makeAggregateSubkey" method to create new subkeys for the
|
|
resulting sub-phrases. Subkeys are put into sub-phrases with
|
|
others of the same time span within the time period. This method
|
|
looks at all the subkeys for all sub-phrases at one time. For
|
|
example, if you had <br>
|
|
</li>
|
|
<ul>
|
|
<li>Hours 1-3: Wide R, SChc S</li>
|
|
<li>Hours 4-6: SChc S</li>
|
|
<li>Hours 7-12: SChc S Lkly ZR</li>
|
|
</ul>
|
|
</ul>
|
|
you would
|
|
end up with<br>
|
|
<ul>
|
|
<ul>
|
|
<li>SubPhrase 1: Hours 1-3: Wide R</li>
|
|
<li>SubPhrase 2: Hours 1-12: SChc S</li>
|
|
<li>SubPhrase 3: Hours 7-12: Lkly ZR</li>
|
|
</ul>
|
|
</ul>
|
|
and
|
|
wording: "Widespread rain in the early morning. Slight
|
|
chance of snow through the day. Freezing rain likely in the
|
|
afternoon."<br>
|
|
<ul>
|
|
<li>"skyPopWx_phrase": This phrase is used only for the simpler case
|
|
of 1 or 2 resulting sub-phrases. Thus, we use the simpler
|
|
sub-phrase by sub-phrase combining method, "combineStats" which also
|
|
employs the "checkWeatherSimilarity" and "makeAggregateSubkey"
|
|
methods. The sub-phrase by sub-phrase combining allows us
|
|
to have phrases such as: "Rain and snow in the morning then snow in the
|
|
afternoon." instead of "Rain in the morning. Snow through
|
|
the day."</li>
|
|
</ul>
|
|
<span style="font-weight: bold;">Local Effects. </span>For
|
|
consistency, local effects for the weather phrases uses the same
|
|
underlying "checkWeatherSimilarity" method. Local effects
|
|
for the weather_phrase will use the general
|
|
"checkLocalEffectDifference" (PhraseBuilder) method which in turn calls
|
|
"checkWeatherSimilarity". For information on setting up local
|
|
effects for the "skyPopWx_phrase", see the section: <a
|
|
href="#LocalEffectsfortheCombinedSkyPopWxPhrase">Local
|
|
Effects for the Combined SkyPopWx Phrase.</a><br>
|
|
<span style="font-weight: bold;"><br>
|
|
Period Combining. </span>If you choose to examine Wx
|
|
similarities as a basis for period combining, the "similarWx" method
|
|
will call "checkWeatherSimilarity" for it's comparison of Wx across
|
|
periods.<br>
|
|
<span style="font-weight: bold;"><br>
|
|
Weather Words. </span>The words for each weather
|
|
sub-phrase are created by the following steps:<br>
|
|
<ul>
|
|
<li><font color="#000000">If the PoP is below the </font><i><font
|
|
color="#993366">pop_wx_lower_threshold, pop_related_wxTypes</font></i><font
|
|
color="#000000"> are removed.</font></li>
|
|
<li><font color="#000000">Check for weather wording dependent on the
|
|
visibility threshold. See section: </font><a
|
|
href="#HANDLINGVISIBILITY">Visibility</a></li>
|
|
<li>If <i><font color="#993366">useSimple </font></i>(default
|
|
is 2 or fewer subkeys), use old-style simpler wording i.e. do not
|
|
use "mixed with", "pockets of", etc. Examples of Simple wording:
|
|
"Rain and snow likely in the evening." "Chance of rain and snow and
|
|
slight chance of sleet in the evening." "Chance of showers." "Mostly
|
|
cloudy with rain likely and a slight chance of
|
|
thunderstorms." Example of Complex wording: "Rain
|
|
mixed with snow likely in the evening." "Chance of rain mixed with snow
|
|
and sleet in the evening."</li>
|
|
<li>Otherwise, use ranking of subkeys to form wording:</li>
|
|
<ul>
|
|
<li>For subkeys with similar rank and coverages, use "mixed with"
|
|
wording .</li>
|
|
<li>For subkeys with lesser coverage than the highest ranked, use
|
|
"possibly mixed with".</li>
|
|
<li>For subkeys with greater coverage than the highest ranked, use
|
|
"with pockets of"</li>
|
|
</ul>
|
|
</ul>
|
|
Only switch once
|
|
to "mixed with", "possibly mixed with" or "with pockets of". The <i><font
|
|
color="#993366">rankFuzzFactor</font></i> (CommonUtils) is used to
|
|
determine if ranks are similar and the <i><font
|
|
color="#993366">similarCoverages </font></i> method is used to
|
|
determine if coverages are similar. The wording can be adjusted
|
|
for <i><font color="#993366">mixedWith, possiblyMixedWith,
|
|
withPocketsOf </font></i>and<i><font color="#993366">
|
|
wxConjunction.<br>
|
|
</font></i>
|
|
<ul>
|
|
<li>The "weather_value" method constructs the words for each
|
|
subkey. This wording can be adjusted and is described in the
|
|
section: <a href="#CustomizingWeatherPhrases">Customizing
|
|
Weather Phrases.</a></li>
|
|
<li>Add embedded visibility wording if needed.</li>
|
|
</ul>
|
|
<br>
|
|
<br>
|
|
<h1><a name="Appendix_A"></a>Appendix A</h1>
|
|
<h2>Local Effects Re-design/Design to Handle Combined Phrases<br>
|
|
</h2>
|
|
<h2>Phrase Processing Steps including Local Effects</h2>
|
|
<ul>
|
|
<li><span style="font-weight: bold;">CONSOLIDATE</span> --<span
|
|
style="font-weight: bold;">Phrase Level</span>:
|
|
e.g. separateNonPrecip (separate out non-precip events such as Fog from
|
|
RW), consolidateWx (if RW appears throughout the period and S is just
|
|
in the afternoon, split them into separate phrases), consolidatePhrase
|
|
(if Gusts are the same throughout the period and the Wind changes,
|
|
split them into separate phrases).</li>
|
|
<li><span style="font-weight: bold;">CHECK FOR LOCAL EFFECTS </span>--<span
|
|
style="font-weight: bold;"> Phrase Level</span>: If local
|
|
effects are triggered, create separate Conjunctive phrases for each
|
|
local effect area (or group of areas). <br>
|
|
</li>
|
|
<li><span style="font-weight: bold;">COMBINE </span>-- <span
|
|
style="font-weight: bold;">Phrase Level</span>: Combine
|
|
sub-phrases based on similar data.</li>
|
|
<li><span style="font-weight: bold;">CREATE WORDS</span> -- <span
|
|
style="font-weight: bold;">Sub-phrase Level</span>: Create words for
|
|
each sub-phrase.</li>
|
|
<li><span style="font-weight: bold;">CONSOLIDATE SUB-PHRASES --
|
|
Component Level</span>:
|
|
Consolidate so that we do not have duplicate phrasing within local
|
|
effect areas. <br>
|
|
</li>
|
|
<li><span style="font-weight: bold;">ASSEMBLE SUB-PHRASES -- Phrase
|
|
Level</span>. <br>
|
|
</li>
|
|
<li><span style="font-weight: bold;">ASSEMBLE PHRASES -- Component
|
|
Level</span>: <br>
|
|
</li>
|
|
<ul>
|
|
<li>Order Wx Phrases <br>
|
|
</li>
|
|
<li>Consolidate Local Effect Phrases</li>
|
|
<ul>
|
|
<li>Incorporate Non Local Effect phrases (not implemented) OR</li>
|
|
<li>Convert to Embedded phrases if possible</li>
|
|
<li>Order Local Effect phrases that remain Conjunctive</li>
|
|
</ul>
|
|
<li>Assemble Component Words with appropriate qualifiers<br>
|
|
</li>
|
|
</ul>
|
|
</ul>
|
|
<h2>Examples of Phrase Processing Steps</h2>
|
|
The following examples show the progression through the phrase
|
|
processing steps. They are rough sketches, not intended to be
|
|
complete. They use these abbreviations:<br>
|
|
<ul>
|
|
<li>Area1 is the entire area while WW (Windward) and LW
|
|
(Leeward) are local effect areas.</li>
|
|
<li>SPW = skyPopWx_phrase</li>
|
|
<li>Wx = weather_phrase</li>
|
|
<li>PoP = popMax_phrase</li>
|
|
<li>Sky = sky_phrase</li>
|
|
<li>>> Means "executes"<br>
|
|
</li>
|
|
<li>--> Means "results in"</li>
|
|
</ul>
|
|
<h3>Test Case 3_3 F20 <br>
|
|
</h3>
|
|
Grids:<br>
|
|
|
|
Area1:
|
|
Iso T (hours 0-6) Chc R Lkly S Sky
|
|
90 (hours 0-12)<br>
|
|
|
|
(The Wx is the result when we sample the combined Windward and Leeward
|
|
values).<br>
|
|
|
|
Windward: Iso T (hours
|
|
0-6) Lkly R Lkly S PoP 90 Sky
|
|
90 (hours 0-12)<br>
|
|
|
|
Leeward:
|
|
Iso T (hours 0-6) Chc
|
|
R
|
|
PoP 40 Sky 90 (hours 0-12)<br>
|
|
<br>
|
|
Words:<br>
|
|
ISOLATED THUNDERSTORMS IN THE
|
|
MORNING.<br>
|
|
RAIN AND SNOW LIKELY WINDWARD...A
|
|
40 PERCENT CHANCE OF RAIN LEEWARD<br>
|
|
...CHANCE OF PRECIPITATION 70
|
|
PERCENT WINDWARD.<br>
|
|
<br>
|
|
Note: The PoP is reported separately for WW because it is greater
|
|
than 60.<br>
|
|
<br>
|
|
Steps:<br>
|
|
<ul>
|
|
<li>Sky Phrase >> includeSky == 0 since same throughout, so
|
|
kept phrase >> empty words since PoP > 60<br>
|
|
</li>
|
|
<li>SPW Area1 >> Consolidation --> <br>
|
|
</li>
|
|
<ul>
|
|
<li> SPW Area1 for Chc R Lkly S >>
|
|
CheckLocalEffects --></li>
|
|
<ul>
|
|
<li>SPW WW for Lkly R Lkly S --> RAIN AND SNOW LIKELY WINDWARD</li>
|
|
<li>SPW LW for Chc R --> A 40 PERCENT CHANCE OF RAIN LEEWARD</li>
|
|
</ul>
|
|
<li>SPW Area1 for Iso T >> CheckLocalEffects -->
|
|
ISOLATED THUNDERSTORMS IN THE MORNING.<br>
|
|
</li>
|
|
</ul>
|
|
<li>Wx Area1 >> Consolidation (preProcessWx rearranges
|
|
sub-phrases) >> CheckLocalEffects --></li>
|
|
<ul>
|
|
<li>Wx WW >> removed by SPW Windward Lkly R Lkly S</li>
|
|
<li>Wx LW >> removed by SPW Leeward Chc R</li>
|
|
</ul>
|
|
<li>Pop Area1 >> Removed by SPW Windward and Leeward <br>
|
|
</li>
|
|
</ul>
|
|
<h3>Test Case 3_3 F6 <br>
|
|
</h3>
|
|
Grids:<br>
|
|
|
|
Area1:
|
|
<br>
|
|
|
|
Windward: Sct RW
|
|
Sky 70 PoP 50<br>
|
|
|
|
Leeward:
|
|
NoWx Sky 20 PoP 0<br>
|
|
<br>
|
|
Words:<br>
|
|
SUNNY LEEWARD...MOSTLY CLOUDY WITH
|
|
SCATTERED SHOWERS WINDWARD...CHANCE OF SHOWERS 50 PERCENT WINDWARD<br>
|
|
Steps:<br>
|
|
<ul>
|
|
<li>Sky Area1 >> CheckLocalEffects --></li>
|
|
<ul>
|
|
<li>Sky WW --> Removed by SPW for WW<br>
|
|
</li>
|
|
<li>Sky LW --> SUNNY<br>
|
|
</li>
|
|
</ul>
|
|
<li>SPW Area1 >> Consolidation >>
|
|
CheckLocalEffects --><br>
|
|
</li>
|
|
<ul>
|
|
<li>SPW WW --> MOSTLY CLOUDY WITH SCATTERED SHOWERS<br>
|
|
</li>
|
|
<li>SPW LW -- Removed because there is NoWx<br>
|
|
</li>
|
|
</ul>
|
|
<li>Wx Area1 >> CheckLocalEffects --></li>
|
|
<ul>
|
|
<li>Wx WW --> removed by SPW WW --> <br>
|
|
</li>
|
|
<li>Wx LW --> empty<br>
|
|
</li>
|
|
</ul>
|
|
<li>Pop Area1 >> CheckLocalEffects --></li>
|
|
<ul>
|
|
<li>Pop WW --> CHANCE OF SHOWERS 50 PERCENT</li>
|
|
<li>Pop LW --> empty<br>
|
|
</li>
|
|
</ul>
|
|
</ul>
|
|
<h3>Test Case 3_3 F30 Sub-phrase consolidation Case 1<br>
|
|
</h3>
|
|
This is an example in which we need the Consolidate Sub-phrases step.<br>
|
|
Case 1: duplicate sub-phrases are for the same areaLabel.<br>
|
|
<br>
|
|
Grids:<br>
|
|
|
|
Area1:
|
|
<br>
|
|
|
|
Windward: (hours 9-12) Wx:
|
|
Patchy:F PoP 20 Sky 50<br>
|
|
|
|
Leeward:
|
|
(hours 9-12) Wx: Wide:F PoP 0 Sky 50<br>
|
|
<br>
|
|
Words:<br>
|
|
MOSTLY SUNNY. <br>
|
|
WINDWARD...PATCHY FOG LATE IN THE
|
|
AFTERNOON. <br>
|
|
LEEWARD...WIDESPREAD FOG LATE IN
|
|
THE AFTERNOON.<br>
|
|
<br>
|
|
<ul>
|
|
<li>Sky Area1 --> MOSTLY SUNNY.<br>
|
|
</li>
|
|
<li>SPW Area1 >> Consolidation --><br>
|
|
</li>
|
|
<ul>
|
|
<li>Spawned Wx Area1 (F) --> Consolidation -->
|
|
CheckLocalEffects --></li>
|
|
<ul>
|
|
<li>Wx WW Patchy F</li>
|
|
<li>Wx Leeward Widespread F<br>
|
|
</li>
|
|
</ul>
|
|
</ul>
|
|
<li>Wx Area1 >> CheckLocalEffects --></li>
|
|
<ul>
|
|
<li>Wx WW --> Patchy F<br>
|
|
</li>
|
|
<li>Wx LW --> Widespread F<br>
|
|
</li>
|
|
</ul>
|
|
<li>Pop Area1 >> No PoP reported.<br>
|
|
</li>
|
|
</ul>
|
|
<ul>
|
|
<li>>> All these subPhrases are processed by
|
|
ConsolidateSubPhrases which finds Case 1:</li>
|
|
<ul>
|
|
<li>Wx WW Patchy F</li>
|
|
<li>Wx WW Patchy F</li>
|
|
<li>Wx LW Widespread F</li>
|
|
<li>Wx LW Widespread F</li>
|
|
</ul>
|
|
<li>After Consolidating Sub-Phrases: --></li>
|
|
<ul>
|
|
<li>Wx WW Patchy F</li>
|
|
<li>Wx LW Widespread F</li>
|
|
</ul>
|
|
</ul>
|
|
<h3 style="font-weight: bold;">Test Case 3_3 F22 Sub-phrase
|
|
consolidation Case 2</h3>
|
|
This is an example in which we need the Consolidate Sub-phrases step.<br>
|
|
Case 2: duplicate subphrases are for a local effect and cover all
|
|
possible local effect areas for their phrase, create a new phrase for
|
|
component.getAreaLabel() with this subPhrase wording. Remove the local
|
|
effect subPhrases.<br>
|
|
<br>
|
|
Grids:<br>
|
|
|
|
Area1:
|
|
<br>
|
|
|
|
Windward: Chc T (hours
|
|
0-6) Lkly RW PoP 70<br>
|
|
|
|
Leeward:
|
|
Chc T (houts 0-6) Chc RW PoP 40<br>
|
|
<br>
|
|
Words:<br>
|
|
CLOUDY. CHANCE OF
|
|
THUNDERSTORMS IN THE MORNING.<br>
|
|
WINDWARD...SHOWERS LIKELY...CHANCE
|
|
OF SHOWERS AND THUNDERSTORMS 70 PERCENT.<br>
|
|
LEEWARD...CHANCE OF SHOWERS IN THE
|
|
AFTERNOON...CHANCE OF SHOWERS AND THUNDERSTORMS<br>
|
|
40 PERCENT.<br>
|
|
<br>
|
|
Steps:<br>
|
|
<ul>
|
|
<li>Sky Area1 --> CLOUDY.<br>
|
|
</li>
|
|
<li>SPW Area1 >> Consolidation (Chc T is not the same
|
|
throughout period) >> CheckLocalEffects --><br>
|
|
</li>
|
|
<ul>
|
|
<li>SPW WW >> Consolidation --> <br>
|
|
</li>
|
|
<ul>
|
|
<li>SPW WW for Chc T --> CHANCE OF THUNDERSTORMS IN THE MORNING</li>
|
|
<li>SPW WW for Lkly RW --> SHOWERS LIKELY</li>
|
|
</ul>
|
|
<li>SPW LW >> Consolidation --> <br>
|
|
</li>
|
|
<ul>
|
|
<li>SPW LW for Chc T --> CHANCE OF THUNDERSTORMS IN THE MORNING</li>
|
|
<li>SPW LW for Chc RW --> CHANCE OF SHOWERS IN THE AFTERNOON</li>
|
|
</ul>
|
|
</ul>
|
|
<li>Wx Area1 >> CheckLocalEffects --></li>
|
|
<ul>
|
|
<li>Wx WW --> removed by SPW WW<br>
|
|
</li>
|
|
<li>Wx LW --> removed by SPW LW<br>
|
|
</li>
|
|
</ul>
|
|
<li>Pop Area1 >> CheckLocalEffects --></li>
|
|
<ul>
|
|
<li>Pop WW --> CHANCE OF SHOWERS AND THUNDERSTORMS 70 PERCENT</li>
|
|
<li>Pop LW --> CHANCE OF SHOWERS AND THUNDERSTORMS 40 PERCENT</li>
|
|
</ul>
|
|
</ul>
|
|
<ul>
|
|
<li>>> All these subPhrases are processed by
|
|
ConsolidateSubPhrases which finds Case 2:</li>
|
|
<ul>
|
|
<li>SPW WW CHANCE OF THUNDERSTORMS</li>
|
|
<li>SPW LW CHANCE OF THUNDERSTORMS</li>
|
|
</ul>
|
|
<li>After Consolidating Sub-Phrases: --></li>
|
|
<ul>
|
|
<li>SPW Area1 Chc T --> CHANCE OF THUNDERSTORMS IN THE MORNING</li>
|
|
<li><br>
|
|
</li>
|
|
<li>SPW WW for Lkly RW --> SHOWERS LIKELY</li>
|
|
<li>SPW LW for Chc RW --> CHANCE OF SHOWERS IN THE AFTERNOON</li>
|
|
</ul>
|
|
</ul>
|
|
Note: The leeward showers
|
|
are "in the afternoon" because T and RW are combined if their<br>
|
|
the coverage of T is greater or
|
|
equal to that of RW.<br>
|
|
<h3>Test Case 3_3 F45 Need checkSkyPopWx to remove pop phrases for
|
|
component as well as local effect area.</h3>
|
|
Grids:<br>
|
|
|
|
Windward: Sky:
|
|
Cloudy
|
|
SChc S PoP 20<br>
|
|
|
|
Leeward:
|
|
Sky: Partly Sunny Chc R PoP 30<br>
|
|
<br>
|
|
Words:<br>
|
|
CLOUDY WITH A 20 PERCENT CHANCE OF SNOW
|
|
WINDWARD...<br>
|
|
PARTLY SUNNY WITH A 30 PERCENT CHANCE OF
|
|
RAIN LEEWARD <br>
|
|
<br>
|
|
(No extra PoP phrase)<br>
|
|
<br>
|
|
Steps:<br>
|
|
<ul>
|
|
<li>Sky >> CheckLocalEffects --></li>
|
|
<ul>
|
|
<li>Sky Windward >> removed by SPW Windward<br>
|
|
</li>
|
|
<li>Sky Leeward >> removed by SPW Leeward<br>
|
|
</li>
|
|
</ul>
|
|
<li>SPW Area1 >> CheckLocalEffects --> </li>
|
|
<ul>
|
|
<li>SPW Windward >> CLOUDY WITH A 20 PERCENT CHANCE OF
|
|
SNOW WINDWARD... </li>
|
|
<li>SPW Leeward >> PARTLY SUNNY
|
|
WITH A 30 PERCENT CHANCE OF RAIN LEEWARD </li>
|
|
</ul>
|
|
<li>Wx Area1 >> CheckLocalEffects --></li>
|
|
<ul>
|
|
<li>Wx Windward >> removed by SPW Windward <br>
|
|
</li>
|
|
<li>Wx Leeward >> removed by SPW Leeward<br>
|
|
</li>
|
|
</ul>
|
|
<li>PoP Area1 >> removed by SPW Windward and/or Leeward (which
|
|
removes both the LE area and Area1). This works because there is
|
|
never a case where you have a local effect PoP reported AND you also
|
|
want an Area1 PoP reported.<br>
|
|
</li>
|
|
</ul>
|
|
<h3></h3>
|
|
<h2>Design Changes Made from Original Local Effect Strategy to New</h2>
|
|
Basically, we were trying to do too much upstream, making
|
|
assumptions
|
|
that were ok for simple 1-dimensional phrases, but did not hold for
|
|
multi-element phrases. Now we have moved much of the decision-making
|
|
downstream when we know more about the outcome.<br>
|
|
<ul>
|
|
<li><span style="font-weight: bold;">"checkLocalEffects"
|
|
method: </span>Change: "checkLocalEffects" must run after
|
|
spawning new phrases.
|
|
We cannot assume that "checkLocalEffects" runs as the first phrase
|
|
method. With phrases that might split into multiple phrases, we need to
|
|
check for local effects AFTER phrases have been split, say, into
|
|
separate sky and weather phrases or separate wind and wind gust
|
|
phrases. <br>
|
|
</li>
|
|
<ul>
|
|
<li>"checkLocalEffects" was automatically added as the first
|
|
phraseList method by ForecastNarrative.</li>
|
|
<li><span style="color: rgb(255, 0, 0);"><span
|
|
style="color: rgb(0, 153, 0);">Now Phrase Definitions must list
|
|
"checkLocalEffects" explicitly. </span><br>
|
|
</span></li>
|
|
<ul>
|
|
<li><span style="color: rgb(255, 0, 0);"><span
|
|
style="color: rgb(0, 153, 0);">"standard_phraseMethods"</span> <span
|
|
style="color: rgb(51, 0, 51);"> (PhraseBuilder)</span><br>
|
|
</span></li>
|
|
<li><span style="color: rgb(255, 0, 0);"><span
|
|
style="color: rgb(0, 153, 0);">"standard_vector_phraseMethods" </span><span
|
|
style="color: rgb(51, 0, 51);">(VectorRelatedPhrases)</span><br>
|
|
</span></li>
|
|
<li><span style="color: rgb(255, 0, 0);"><span
|
|
style="color: rgb(0, 153, 0);">"standard_weather_phraseMethods</span><span
|
|
style="color: rgb(51, 0, 51);"><span style="color: rgb(0, 153, 0);">" </span>(WxPhrases)</span><br>
|
|
</span></li>
|
|
<li><span style="color: rgb(255, 0, 0);"><span
|
|
style="color: rgb(0, 153, 0);">"skyPopWx_phrase"</span> <span
|
|
style="color: rgb(51, 0, 51);">(CombinedPhrases)</span><br>
|
|
</span></li>
|
|
<li><span style="color: rgb(255, 0, 0);"><span
|
|
style="color: rgb(0, 153, 0);">"sky_phrase"</span><span
|
|
style="color: rgb(51, 0, 51);"> (ScalarPhrases)</span></span></li>
|
|
<li><span style="color: rgb(255, 0, 0);"><span
|
|
style="color: rgb(51, 0, 51);"><span style="color: rgb(255, 0, 0);"><span
|
|
style="color: rgb(0, 153, 0);">"fireSky_phrase",
|
|
"trend_DayOrNight_phrase", "dayOrNight_phrase", "haines_phrase",
|
|
"lal_phrase"</span> </span>(FirePhrases)<br>
|
|
</span></span></li>
|
|
</ul>
|
|
<li>Must carry over "localEffects" information when spawning new
|
|
phrases in <span style="color: rgb(0, 153, 0);">"splitPhrase" <span
|
|
style="color: rgb(51, 0, 51);">and </span>"splitWxPhrases"</span>
|
|
(PhraseBuilder)</li>
|
|
<li>Must apply "disabledSubkeys" when checking local effects in <span
|
|
style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 153, 0);">"checkThreshold",
|
|
"checkSkyWxDifference"</span><span style="color: rgb(51, 0, 51);"><span
|
|
style="color: rgb(0, 153, 0);"> </span>(PhraseBuilder)</span></span><br>
|
|
</li>
|
|
</ul>
|
|
<li><span style="font-weight: bold;">All local effects start out as
|
|
conjunctive. </span>Change: Make all local effects conjunctive when
|
|
created then after all processing is done, convert to embedded if
|
|
appropriate.<span style="font-weight: bold;"> </span>(<span
|
|
style="color: rgb(0, 153, 0);">"checkLocalEffects"</span> in
|
|
PhraseBuilder and <span style="color: rgb(0, 153, 0);">"makeLocalEffectNodes"</span>)
|
|
We used to try and determine if a phrase could be embedded at the
|
|
beginning of processing when we first discovered there was a local
|
|
effect. Later, we would find that some of the conjunctive phrases
|
|
degenerated and could be turned into embedded. <br>
|
|
</li>
|
|
<ul>
|
|
<li><span style="color: rgb(0, 153, 0);">"localEffect_hook"</span>
|
|
used to try and decide which phrases could be eliminated. When SPW
|
|
became more complex, this job was not possible and caused duplicate and
|
|
missing phrases. Now we generate them all and remove duplicate
|
|
information:</li>
|
|
<ul>
|
|
<li>In the <span style="color: rgb(0, 153, 0);">"checkSkyPopWx"</span>
|
|
method</li>
|
|
<li>Through consolidation in the Consolidate Sub Phrases step.</li>
|
|
</ul>
|
|
</ul>
|
|
<li><span style="font-weight: bold;">Create subPhrase words.</span>
|
|
Proceed as normal to create subPhrase words for local effect and other
|
|
subPhrases.</li>
|
|
<li><span style="font-weight: bold;">Consolidate SubPhrases</span>:
|
|
At product Component Level: <br>
|
|
</li>
|
|
</ul>
|
|
<div style="margin-left: 80px;">
|
|
## Timing: This method runs at the component level<br>
|
|
## AFTER all
|
|
sub-phrase words have been set and<br>
|
|
## BEFORE they have
|
|
been assembled into phrases at the phrase level.<br>
|
|
##<br>
|
|
## Purpose: If for all
|
|
possible areaLabels per phrase or phrase type<br>
|
|
|
|
## we repeat a particular
|
|
subPhrase and timeRange,<br>
|
|
|
|
## Factor it out into an un-qualified
|
|
phrase<br>
|
|
##<br>
|
|
## For example:<br>
|
|
## Chance
|
|
of thunderstorms in the morning (windward)<br>
|
|
## Chance
|
|
of thunderstorms in the morning (leeward)<br>
|
|
## Chance
|
|
of rain in the afternoon (windward)<br>
|
|
## Chance
|
|
of snow in the afternoon (leeward)<br>
|
|
##<br>
|
|
## becomes:<br>
|
|
## Chance
|
|
of thunderstorms in the morning (unqualified)<br>
|
|
## Chance
|
|
of rain in the afternoon (windward)<br>
|
|
## Chance
|
|
of snow in the afternoon (leeward)<br>
|
|
</div>
|
|
<ul>
|
|
<ul>
|
|
<li><span style="color: rgb(255, 0, 0);"><span
|
|
style="color: rgb(255, 0, 0);">All Product components must list
|
|
"consolidateSubPhrases"</span> <span style="color: rgb(0, 153, 0);"><span
|
|
style="color: rgb(51, 0, 51);">before </span>"assemblePhrases" <span
|
|
style="color: rgb(51, 0, 51);">or</span>
|
|
"assembleIndentedPhrases"</span></span></li>
|
|
<ul>
|
|
<li><span style="color: rgb(255, 0, 0);"><span
|
|
style="color: rgb(51, 0, 51);">In all</span> <span
|
|
style="color: rgb(51, 0, 51);">Narrative Standard products</span></span></li>
|
|
<li><span style="color: rgb(255, 0, 0);"><span
|
|
style="color: rgb(51, 0, 51);">In FirePhrases compound phrases: <span
|
|
style="color: rgb(0, 153, 0);">"skyWeather_byTimeRange_compoundPhrase",
|
|
"fireWind_compoundPhrase", "fireValleyWind_compoundPhrase",
|
|
"fireRidgeWind_compoundPhrase"</span></span></span></li>
|
|
<li><span style="color: rgb(255, 0, 0);"><span
|
|
style="color: rgb(51, 0, 51);"><span style="color: rgb(255, 0, 0);"><span
|
|
style="color: rgb(51, 0, 51);">In FWS_Overrides:</span> <span
|
|
style="color: rgb(0, 153, 0);"> "fireEyeWind_compoundPhrase"</span><br>
|
|
</span></span></span></li>
|
|
</ul>
|
|
</ul>
|
|
</ul>
|
|
<ul>
|
|
<ul>
|
|
<li>Because consolidateSubPhrases waits until all subPhrases are
|
|
finished AND executes
|
|
before assembleSubPhrases (and assemblePhrases), phrases can no
|
|
longer
|
|
wait for other phrases to completely finish. They can, however,
|
|
wait
|
|
for all subphrases to finish. Thus, "findWords" (PhraseBuilder)
|
|
now
|
|
just returns concatenated subPhrases instead of concatenated completed
|
|
phrases. All methods should use "findWords" rather than waiting
|
|
for phrases to complete. <br>
|
|
</li>
|
|
</ul>
|
|
<ul>
|
|
<ul style="color: rgb(0, 153, 0);">
|
|
<li>"extremeTemps_words" <span style="color: rgb(51, 0, 51);">must
|
|
be changed to use</span> "findWords" OR <span
|
|
style="color: rgb(51, 0, 51);">the system will give </span>"21
|
|
PASSES" <span style="color: rgb(51, 0, 51);">message since it is
|
|
waiting for the
|
|
reportTrends_phrase to finish.</span></li>
|
|
</ul>
|
|
<li><span style="color: rgb(255, 0, 0);"><span
|
|
style="color: rgb(51, 0, 51);">Enhanced <span
|
|
style="color: rgb(0, 153, 0);">"checkRepeatingString"</span>
|
|
(PhraseBuilder) to handle local effect situations.</span><br>
|
|
</span></li>
|
|
</ul>
|
|
<li><span style="color: rgb(255, 0, 0);"><span
|
|
style="color: rgb(51, 0, 51);"><span style="font-weight: bold;">Assemble
|
|
Sub Phrases</span>: <span style="color: rgb(0, 153, 0);">"assembleSubPhrases"</span>
|
|
(PhraseBuilder) now needs consolidateSubPhrases_trigger to make
|
|
sure
|
|
that subPhrases have been consolidated before we assemble them.</span></span></li>
|
|
<li><span style="color: rgb(255, 0, 0);"><span
|
|
style="color: rgb(51, 0, 51);"><span style="font-weight: bold;">Assemble
|
|
Phrases</span>:<span style="color: rgb(0, 153, 0);"> </span><span
|
|
style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 153, 0);">"assemblePhrases",
|
|
"assembleIndentedPhrases", "assembleSentences":</span><span
|
|
style="color: rgb(51, 0, 51);"><span style="color: rgb(0, 153, 0);"> </span><br>
|
|
</span></span></span></span></li>
|
|
<ul>
|
|
<li><span style="color: rgb(255, 0, 0);"><span
|
|
style="color: rgb(51, 0, 51);"><span style="color: rgb(255, 0, 0);"><span
|
|
style="color: rgb(51, 0, 51);"><span style="font-weight: bold;">Consolidate
|
|
Local Effects</span>: Replace "combineConjunctiveLocalEffects"
|
|
with
|
|
"consolidateLocalEffects"</span></span>.
|
|
<br>
|
|
</span></span></li>
|
|
</ul>
|
|
</ul>
|
|
<span style="color: rgb(255, 0, 0);"><span
|
|
style="color: rgb(51, 0, 51);">
|
|
|
|
# Organize the local effect and non-local
|
|
effect phrases.<br>
|
|
|
|
# "node" can be a
|
|
component or a compound phrase.<br>
|
|
|
|
# Convert to embedded
|
|
local effect phrases if appropriate.<br>
|
|
|
|
# Apply the
|
|
Local Effect thresholds:<br>
|
|
|
|
|
|
# repeatingEmbedded_localEffect_threshold<br>
|
|
|
|
|
|
# repeatingPhrase_localEffect_threshold<br>
|
|
<br>
|
|
</span></span>
|
|
<ul style="margin-left: 80px;">
|
|
<li>Calls "incorporateNonLocalEffectPhrases":<br>
|
|
# Try to incorporate
|
|
non-qualified phrases<br>
|
|
# If there
|
|
is exactly one leArea group in the set of phrases<br>
|
|
|
|
# AND this group is composed of intersect
|
|
areas<br>
|
|
|
|
# AND there is more than one local effect
|
|
phrase<br>
|
|
|
|
# AND the number of non-local effect
|
|
phrases<br>
|
|
|
|
# <
|
|
repeatingPhrase_localEffect_threshold:<br>
|
|
|
|
# Convert them to
|
|
conjunctive local effect phrases<br>
|
|
|
|
# (one for each
|
|
intersect local effect area)<br>
|
|
|
|
# return 1<br>
|
|
# Else:<br>
|
|
|
|
# return 0<br>
|
|
<br>
|
|
# EXAMPLE:<br>
|
|
# Instead of:<br>
|
|
#
|
|
Chance of thunderstorms in the morning.<br>
|
|
#
|
|
Windward...Cloudy...Rain likely...Chance of precipitation 70 percent.<br>
|
|
#
|
|
Leeward...Partly cloudy...Scattered showers...Chance of precipitation 30<br>
|
|
#
|
|
percent. Highs in the 40s. Winds 20 mph.<br>
|
|
#<br>
|
|
# We will
|
|
produce:<br>
|
|
#
|
|
Windward...Cloudy....Rain likely...Chance of thunderstorms in the
|
|
morning...<br>
|
|
#
|
|
Chance of precipitation 70 percent.<br>
|
|
#
|
|
Leeward...Partly cloudy...Scattered showers...Chance of thunderstorms in<br>
|
|
#
|
|
the morning...Chance of precipitation 30 percent. Highs in the 40s.<br>
|
|
#
|
|
Winds 20 mph.</li>
|
|
<br>
|
|
<li>If cannot incorporate, then calls
|
|
"convertToEmbedded": (updated <span
|
|
style="color: rgb(0, 153, 0);">"makeEmbeddedFromConjunctive"</span>)<br>
|
|
#<br>
|
|
# Converts
|
|
conjunctive local effects to embedded if possible.<br>
|
|
# For each
|
|
leGroup:<br>
|
|
|
|
# If number of possible embedded phrases<br>
|
|
|
|
#
|
|
< repeatingEmbedded_localEffect_threshold<br>
|
|
|
|
# AND there are NO
|
|
mandatory conjunctives:<br>
|
|
|
|
#
|
|
Replace conjunctive phrases with embedded phrase(s).</li>
|
|
</ul>
|
|
<ul style="margin-left: 80px;">
|
|
<li>Finally, calls<span style="color: rgb(0, 153, 0);">
|
|
"orderLocalEffectPhrases"</span>: See Test Cases F8, F14, F15,
|
|
F16, F22, F37, F38, F46<br>
|
|
#<br>
|
|
# Group all
|
|
conjunctive local effect phrases<br>
|
|
|
|
# for each local effect area together<br>
|
|
|
|
# (at the location of the first
|
|
occurrence).<br>
|
|
#<br>
|
|
# EXAMPLE:<br>
|
|
#
|
|
LEEWARD...SUNNY IN THE MORNING THEN BECOMING PARTLY SUNNY...SCATTERED
|
|
SHOWERS.<br>
|
|
#
|
|
WINDWARD...MOSTLY CLOUDY WITH SCATTERED SHOWERS<br>
|
|
# <br>
|
|
# instead of:<br>
|
|
#
|
|
LEEWARD...SUNNY IN THE MORNING THEN BECOMING PARTLY SUNNY.<br>
|
|
#
|
|
WINDWARD...MOSTLY CLOUDY WITH SCATTERED SHOWERS.<br>
|
|
#
|
|
LEEWARD...SCATTERED SHOWERS.
|
|
# </li>
|
|
</ul>
|
|
<ul>
|
|
<ul>
|
|
<li><span style="font-weight: bold;">Qualify conjunctive local
|
|
effect phrases</span>: Modified<span
|
|
style="color: rgb(0, 153, 0);"> "qualifyWords"</span>
|
|
to handle local effect qualifiers in this new design and to remove some
|
|
bugs from previous design. Added "addPeriod" argument to <span
|
|
style="color: rgb(0, 153, 0);">"sentence"</span> (StringUtils) and
|
|
removal of extra space from <span style="color: rgb(0, 153, 0);">"combineSentences"</span>
|
|
(StringUtils).</li>
|
|
</ul>
|
|
</ul>
|
|
<ul>
|
|
<li> <span style="font-weight: bold;"> New ConfigVariables:</span>
|
|
</li>
|
|
</ul>
|
|
<div style="margin-left: 80px;"> #### Component-Level
|
|
Local Effect thresholds<br>
|
|
def repeatingEmbedded_localEffect_threshold(self,
|
|
tree, component):<br>
|
|
# Number of embedded local
|
|
effect phrases allowed in a component<br>
|
|
# before they are gathered
|
|
together into a conjunctive local<br>
|
|
# effect clause. For
|
|
example, with the threshold set to 2:<br>
|
|
#<br>
|
|
# Instead of:<br>
|
|
#
|
|
Cloudy windward and partly cloudy leeward.<br>
|
|
#
|
|
Rain likely windward and scattered showers leeward.<br>
|
|
#
|
|
Chance of precipitation 50 percent windward and 30<br>
|
|
#
|
|
percent leeward.<br>
|
|
#<br>
|
|
# We will produce:<br>
|
|
#
|
|
Windward...Cloudy...Rain likely...Chance of precipitation 50 percent.<br>
|
|
#
|
|
Leeward...Partly cloudy...Scattered showers...Chance of precipitation<br>
|
|
# 30
|
|
percent.<br>
|
|
#<br>
|
|
# NOTE: If we have
|
|
even one conjunctive local effect, however, all will be left<br>
|
|
#
|
|
conjunctive. For example, instead of:<br>
|
|
#<br>
|
|
#
|
|
Cloudy windward and partly cloudy leeward.<br>
|
|
#
|
|
Windward...Rain likely in the morning.<br>
|
|
#
|
|
Leeward...Scattered showers in the afternoon.<br>
|
|
#<br>
|
|
# We will produce:<br>
|
|
#
|
|
Windward...Cloudy...Rain likely in the morning.<br>
|
|
#
|
|
Leeward...Partly cloudy...Scattered showers in the afternoon.<br>
|
|
#<br>
|
|
return 2<br>
|
|
<br>
|
|
def repeatingPhrase_localEffect_threshold(self,
|
|
tree, component):<br>
|
|
# Number of repeating local
|
|
effect phrases allowed inside a<br>
|
|
# set of conjunctive local
|
|
effects for each of the<br>
|
|
# repeatingPhrase_categories
|
|
(see below).<br>
|
|
#<br>
|
|
# For example, with the
|
|
default of 1 and the categories below,<br>
|
|
#<br>
|
|
# Instead of:<br>
|
|
# Chance
|
|
of thunderstorms in the morning.<br>
|
|
#
|
|
Windward...Cloudy...Rain likely...Chance of precipitation 70 percent.<br>
|
|
#
|
|
Leeward...Partly cloudy...Scattered showers...Chance of precipitation 30<br>
|
|
# percent.
|
|
Highs in the 40s. Winds 20 mph.<br>
|
|
#<br>
|
|
# We will produce:<br>
|
|
#
|
|
Windward...Cloudy....Rain likely...Chance of thunderstorms in the
|
|
morning...<br>
|
|
# Chance
|
|
of precipitation 70 percent.<br>
|
|
#
|
|
Leeward...Partly cloudy...Scattered showers...Chance of thunderstorms in<br>
|
|
# the
|
|
morning...Chance of precipitation 30 percent. Highs in the 40s.<br>
|
|
# Winds 20
|
|
mph.<br>
|
|
#<br>
|
|
# Note that if we had:<br>
|
|
#
|
|
Windward...Cloudy....Rain likely...Chance of precipitation 70 percent.<br>
|
|
#
|
|
Leeward...Partly cloudy...Scattered showers......Chance of precipitation<br>
|
|
# 30
|
|
percent. Highs in the 40s. Winds 20 mph.<br>
|
|
#<br>
|
|
# The phrasing would remain
|
|
unchanged since there are 2 phrases (Temps and Winds)<br>
|
|
# in the "ALL OTHER PHRASES"
|
|
category that would have to be repeated within the<br>
|
|
# conjunctive local effects.<br>
|
|
return 1<br>
|
|
<br>
|
|
def repeatingPhrase_localEffect_categories(self,
|
|
tree, component):<br>
|
|
return [<br>
|
|
|
|
["skyPopWx_phrase", "sky_phrase", "weather_phrase", "popMax_phrase"],<br>
|
|
|
|
["ALL OTHER PHRASES"],<br>
|
|
]<br>
|
|
<br>
|
|
def lePhraseNameGroups(self, tree, component):<br>
|
|
# Groups of phrase names
|
|
that can be combined into embedded local effect phrases.<br>
|
|
# If the phrase is not
|
|
listed here, it is assumed that only phrases with the<br>
|
|
# same name can be combined
|
|
with it into an embedded local effect phrase.<br>
|
|
# For example:<br>
|
|
# With the
|
|
group: ("skyPopWx_phrase", "weather_phrase"), we will allow:<br>
|
|
#<br>
|
|
# A 20 percent
|
|
chance of rain windward and areas of fog leeward.<br>
|
|
#<br>
|
|
# Since
|
|
"skyPopWx_phrase" and "wind_phrase" do not appear as group, we will<br>
|
|
# not allow:<br>
|
|
#<br>
|
|
# A 20
|
|
percent chance of rain windward and north winds 20 mph leeward.<br>
|
|
#<br>
|
|
#<br>
|
|
return [("skyPopWx_phrase",
|
|
"weather_phrase")]<br>
|
|
<br>
|
|
</div>
|
|
<br>
|
|
</body>
|
|
</html>
|