GFESuite Text Product User Guide - PowerPoint PPT Presentation

1 / 149
About This Presentation
Title:

GFESuite Text Product User Guide

Description:

Familiarity with GFESuite including writing Smart Tools and/or Smart Init ... timeRange -- beginning and ending time usually in GMT. Definition Section Exercises ... – PowerPoint PPT presentation

Number of Views:89
Avg rating:3.0/5.0
Slides: 150
Provided by: tomlef
Category:

less

Transcript and Presenter's Notes

Title: GFESuite Text Product User Guide


1
GFESuite Text ProductUser Guide
  • Tracy Hansen

2
Overview
  • Part 1
  • Introduction
  • Core Product Set-up
  • Basic Customizations
  • Part 2
  • Basic Customizations Continued
  • Help and Feedback

3
Part 1
4
Introduction
  • Concepts and Prerequisites
  • Product Generation Dialog
  • Steps to Product Creation
  • Inheritance Hierarchy for Text Products

5
Introduction Concepts
  • Local Formatters
  • Templates
  • Good enough
  • Still being field-tested
  • Text Formatter Infrastructure
  • Python modules --gt Extendable
  • For extending existing products
  • For creating new products

6
Introduction Prerequisites
  • Familiarity with GFESuite including writing Smart
    Tools and/or Smart Init
  • Basic Knowledge of Python
  • Basic Knowledge of Object-Oriented Principles

7
Introduction Product Generation Dialog
  • Main Menu Products-gt Generate Products
  • Select Product(s)
  • Select Database
  • Run

8
Introduction Resulting Product in Text
Window
9
Introduction Steps To Product Creation
10
Introduction Sampler Grids to Histograms
11
Introduction Steps To Product Creation
12
Introduction Steps To Product Creation
13
Introduction Inheritance Hierarchy for Smart
Text Products
Base Class
14
Introduction Inheritance Hierarchy for Smart
Text Products
Sample Analysis
TextRules
15
Introduction Inheritance Hierarchy for Smart
Text Products
Sample Analysis Analysis Methods avg, min, max
TextRules Thresholds and Variables Narrative
Phrases Table Library Methods
Text Product Definitions Product Format Product
Components
Local Text Product Local Definitions Local
Thresholds and Variables Local Narrative Phrases
16
Steps to Set-up Core Products
  • Set-up Generic Edit Areas
  • Read Documentation for Standard File
  • Activate Local File
  • Definition Section -- displayName
  • Run the Product
  • Set-up Customized Edit Areas

17
Product Set-up Set-up Generic Edit Areas
  • Start the GFE from a terminal window (e.g.
    ./runGFE)
  • Log in to GFE as a new user e.g. TextTest
  • Create Edit Areas
  • area1, area2, area3
  • Within area1 city1, city2
  • Within area2 city3
  • Within area3 city4

18
Product Set-upRead Standard File Documentation
  • Choose a core product to set-up
  • GFE--gtDefine Text Products Dialog

19
Product Set-upDefine Text Products Dialog
20
Product Set-upRead Standard File Documentation
  • MB3--gtView the Standard file
  • See if there are additional Edit Areas that you
    will need to create.
  • FWF FireArea, AboveElev, BelowElev, Valleys,
    Ridges
  • GLF Specially-named lake edit areas

21
Product Set-upActivate the Local File
  • MB3--gtModify the Local file displayName

22
Product Set-upDefinition Section - displayName
FWF Standard File Definition
displayName None,
includeMultipleElementTable 0,
FWF_Local File Definition
copy.deepcopy(FWF.TextProduct.Definition)
DefinitiondisplayName FWF
23
Product Set-upDefinition Section - displayName
FWF Standard File Definition
displayName None,
includeMultipleElementTable 0,
FWF_Local File Definition
copy.deepcopy(FWF.TextProduct.Definition)
DefinitiondisplayName FWF
24
Product Set-upRun the Product
  • Products --gt Generate Products
  • Select the Product
  • Select the Database (e.g. Fcst)
  • Click Run
  • Results
  • Text Window appears with product
  • If not, Check for Error messages in the Terminal
    Window.
  • Refer to Text Reference Guide Trouble-shooting
    Section.

25
Product Set-upSet-up Customized Edit Areas
  • Using XNOW
  • http//www.srh.noaa.gov/ama/xnow
  • Using defaultEditAreas
  • Using Combinations file
  • AreaDictionary and Area Header

26
Product Set-upSet-up Customized Edit Areas
Local File DefinitiondefaultEditA
reas (area1, Label
1), (area2, Label 2),

27
Product Set-upSet-up Customized Edit Areas
Local File DefinitiondefaultEditA
reas (CO_039,
Boulder), (CO_040,
Denver),
28
Product Set-upSet-up Customized Edit Areas
Local File DefinitiondefaultEditA
reas ((40.0, -105.0, 10),
Boulder), ((39.0, -104.0,
10), Denver),
29
Product Set-upSet-up Customized Edit Areas
Local File DefinitiondefaultEditA
reas Combinations
Combinations File (Define Text Products Text
Utilities Window) Combinations
(area1, area2, Combo Label 1),
(area3, Combo Label 2),
30
Product Set-upSet-up Customized Edit Areas
Local File DefinitiondefaultEditAreas
\ Combinations_BOUZFPBOU
Combinations File Combinations_BOUZFPBOU
Combinations (CO_039, CO_040,
Boulder/Denver), (CO_041,
Douglas),
31
Product Set-upSet-up Customized Edit Areas
AreaDictionary (Found in Define Text Products
Dialog --gt Text
Utilities Window) AreaDictionary
area1 ugcCode STZ001,
ugcName AREA 1,
ugcCityString CITY1CITY2,
ugcTimeZone MST7MDT,
32
Product Set-upSet-up Customized Edit Areas
AreaDictionary CO_039
ugcCode COZ039, ugcName
BOULDER, ugcCityString
BOULDERLONGMONT, ugcTimeZone
MST7MDT, CO_040
ugcCode COZ040, ugcName
DENVER, ugcCityString DENVER,
ugcTimeZone MST7MDT,
33
Product Set-upSet-up Customized Edit Areas
Area Header COZ039-COZ040- BOULDER-DENVER- INCLUD
ING THE CITIES OF BOULDERLONGMONTDENVER 12
1 PM MDT MON JUL 14 2003
34
Product Set-Up Exercises
  • Product Set-up Exercise 1 Choose a Tabular-type
    product. Set it up to run with generic edit areas
    then with customized edit areas.
  • Product Set-up Exercise 2 Choose a
    Narrative-type product. Set it up to run with
    generic edit areas then with customized edit
    areas.

35
Basic Customizations
  • Smart Text Product Template
  • Definition Section
  • Overriding Methods
  • Customizing Narrative Products
  • Handling Headlines
  • Local File Organization

36
Basic Customizations Product Template
  • What is a Template?
  • Standard format for text products
  • Why have a Template?
  • Consistency --gt
  • Easier to Understand --gt
  • Easier to Customize and Support

37
Basic Customization Inheritance Hierarchy for
Smart Text Products
Sample Analysis
TextRules
38
Basic Customizations Standard Product Template
39
Basic Customizations Documentation
  • Purpose/Description
  • Standard and Local File names and location
  • Customization Points
  • Weather Elements Needed
  • Edit Areas Needed
  • Associated Utility Files e.g. Combinations
  • Component Products
  • Programmers and Support
  • Example Output
  • Additional Information

40
Basic Customizations Standard Product Template
Inheritance
41
Basic Customizations Standard Product Main
Method
42
Basic Customizations Standard Product
Sub-Methods
43
Basic Customizations Standard Product Template
44
Basic Customizations Local Product Template
45
Basic CustomizationsDefinition Section -
Standard File
In CCF Standard file class TextProduct(TextRules
.TextRules,
SampleAnalysis.SampleAnalysis) Definition
type smart,
displayName None, outputFile
/awips/GFESuite/products/TEXT/CCF.txt,
OPTIONAL CONFIGURATION ITEMS
alwaysIncludeSnow 1,
46
Basic CustomizationsDefinition Section - Local
File
In CCF_Local file class TextProduct(CCF.TextProd
uct) Definition copy.deepcopy(CCF.TextProdu
ct.Definition) DefinitiondisplayName
CCF DefinitionoutputFile
/awips/GFESuite/products/TEXT/CCF.txt
OPTIONAL CONFIGURATION ITEMS
DefinitionalwaysIncludeSnow 0
47
Basic CustomizationsDefinition Section - Local
File
In CCF_Local file class TextProduct(CCF.TextProd
uct) Definition copy.deepcopy(CCF.TextProdu
ct.Definition) DefinitiondisplayName
CCF DefinitionoutputFile CCF.txt
OPTIONAL CONFIGURATION ITEMS
DefinitionalwaysIncludeSnow 0
48
Basic CustomizationsDefinition Section - Local
File
In CCF_Local file class TextProduct(CCF.TextProd
uct) Definition copy.deepcopy(CCF.TextProdu
ct.Definition) DefinitiondisplayName
CCF DefinitionoutputFile CCF.txt
OPTIONAL CONFIGURATION ITEMS
DefinitionalwaysIncludeSnow 0
49
Basic CustomizationsDefinition Section - Flags
Standard File Definition
displayName None,
alwaysIncludeSnow 1,
Local File Definition copy.deepcopy(CCF.T
extProduct.Definition) DefinitiondisplayNa
me CCF DefinitionalwaysIncludeSnow
0
50
Basic CustomizationsDefinition Section - Flags
Standard File Definition
displayName None,
alwaysIncludeSnow 1,
Local File Definition copy.deepcopy(CCF.T
extProduct.Definition) DefinitiondisplayNa
me CCR DefinitionalwaysIncludeSnow
0
51
Basic CustomizationsDefinition Section -
Product Header
Local File entries for Product Header
DefinitionproductName \ ZONE
FORECAST PRODUCT DefinitionfullStationID
KBOU DefinitionwmoID FOUS45
Definitionpil ZFPBOU
DefinitionareaName \ NORTHEAST
AND CENTRAL COLORADO DefinitionwfoCity
DENVER DefinitionwfoState CO
52
Basic CustomizationsDefinition Section -
Product Header
Product Header FOUS45 KBOU 141953
ZFPBOU ZONE FORECASTS FOR NORTHEAST AND
CENTRAL COLORADO NATIONAL WEATHER SERVICE
DENVER CO 153 PM MDT MON JUL 14 2003
53
Basic CustomizationsDefinition Section - Store
to AWIPS
Default Local File entry for Storing to AWIPS
DefinitionawipsProductID To store
to AWIPS, uncomment and enter name
DefinitionawipsProductID PDXCWFPDX
54
Basic CustomizationsOverriding Methods
  • To override a method in the Local file
  • Copy the METHOD only from the inherited file into
    Local file
  • Be sure and copy WITHIN the class preserving
    indentation
  • Modify in Local file

55
Basic CustomizationsOverriding Methods
From Standard File, copied into Local File
class TextProduct(CCF.TextProduct) def
__init__(self) CCF.TextProduct.__init__
(self) def _postProcessProduct (self,
argDict, fcst) fcst fcst \n
return fcst
56
Basic Customizations Text Product Arguments
  • argDict -- holds information about the current
    product
  • fcst -- the text string representing the product.
  • editArea -- holds edit area name and data points
  • areaLabel -- text string label
  • timeRange -- beginning and ending time usually in
    GMT

57
Definition Section Exercises
  • Definition Section Exercise 1 In the Standard
    file for your Tabular Product, read the
    Customization Points documentation. In the
    Local file, re-set Definition section flags and
    variables and verify their effect by re-running
    the product.
  • Definition Section Exercise 2 Repeat Exercise 1
    for your Narrative Product.

58
Basic CustomizationsCustomizing Narrative
Products
  • Thresholds and Variables
  • Product Component Definitions
  • Basic Local Effects
  • Narrative Definitions
  • Configurable Issuance

59
Basic CustomizationsThresholds and Variables
  • Examples of Overriding Thresholds
  • Naming Conventions
  • Dictionaries
  • Non-linear Values
  • Arguments and Accessing Information

60
Basic Customization Inheritance Hierarchy for
Smart Text Products
Sample Analysis
TextRules
61
Basic CustomizationsThresholds and Variables
  • Override from SampleAnalysis or Text Rules
    Library of Modules
  • Most common appear in Local file already
  • Otherwise,
  • Locate in SampleAnalysis or Text Rules Modules
    (READ-ONLY)
  • Copy into Local file
  • Modify in Local file

62
Basic Customizations Thresholds and Variables
Examples
Already appears in ZFP_Local File def
pop_lower_threshold(self, tree, node)
PoP values below this amount will not be
reported return 20 def
pop_upper_threshold(self, tree, node)
PoP values above this amount will not be
reported return 70
63
Basic Customizations Thresholds and Variables
Examples
ZFP_Local file class TextProduct(AreaFcst.TextPr
oduct) def __init__(self)
AreaFcst.TextProduct.__init__(self)
Copied into Local file from Text Rules library
def gust_wind_difference_threshold (self, tree,
node) Difference between gust and
max wind below which gusts are not
mentioned return 15
64
Basic Customizations Thresholds and Variables
Examples
  • From SampleAnalysis Temporal Coverage
  • def temporalCoverage_percentage(self, parmHisto,
    timeRange, componentName)
  • Grids included in the analysis must cover
    this
  • percentage of the time range OR
  • be completely included within the time
    range.
  • return 20

65
Basic Customizations Thresholds and Variables
Examples
temporalCoverage_percentage set to 20
For a grid to be included in the Analysis, it
must cover 20 percent of the time range OR be
completely included in the time range.

66
Basic Customizations Thresholds and Variables
Naming Conventions
  • _percentage -- number from 1-100
  • _weight -- number from 0-1
  • _threshold -- typically a data value
  • _dict -- a Python dictionary
  • _list -- a Python list
  • _valueList -- a Python list of phrase values
  • _nlValue -- non-linear values

67
Basic Customizations Thresholds and Variables
Dictionaries
As it appears in the original Text Rules library
class def phrase_descriptor_dict (self,
tree, node) return
Wind winds, WindChill wind
chill readings, WindGust gusts
up to, SnowLevel snow level,
SnowAmt snow accumulation,
Swell swell,

68
Basic Customizations Thresholds and Variables
Dictionaries
Copied into ZFP_Local def
phrase_descriptor_dict (self, tree, node)
dict TextRules.TextRules.phrase_descriptor_dic
t(self, tree, node) dictWind
wind return dict
69
Basic Customizations Thresholds and Variables
Dictionaries
In Text Rules library class def
phrase_descriptor_dict (self, tree, node)
return PoP
self.allAreal_or_chance_pop_descriptor,
Wind winds, WindChill
wind chill readings, WindGust
gusts up to, SnowLevel snow
level, SnowAmt snow
accumulation,

70
Basic Customizations Thresholds and Variables
Dictionaries
def allAreal_or_chance_pop_descriptor (
self, tree, node, key, elementName)
Logic for determining descriptor ...
if use_areal 1 return
areal coverage of else
return chance of
71
Basic Customizations Thresholds and Variables
Dictionaries
In TextRules library class def
thenConnector_dict (self, tree, node)
Used in long phrases such as N wind 10
to 20 kt rising to 30 kt early in the
afternoonthen rising to gales to 40 kt late
in the afternoon. return
otherwise then, Wx
, Sky ,

72
Basic Customizations Thresholds and Variables
Non-Linear Thresholds
In the Local file def minimum_range_nlValue_d
ict (self, tree, node) dict
TextRules.TextRules.minimum_range_nlValue_dict(sel
f, tree, node) dictWind 5
return dict
73
Basic Customizations Thresholds and Variables
Non-Linear Thresholds
In the Local file def minimum_range_nlValue_d
ict (self, tree, node) dict
TextRules.TextRules.minimum_range_nlValue_dict(sel
f, tree, node) dictWind
(0,5) 0, (5,25) 5,
default 10,
return dict
74
Basic Customizations Thresholds and Variables
Arguments
  • SampleAnalysis arguments
  • parmHisto -- holds histogram sample information
    about a particular weather element
  • timeRange -- time range over which statistics are
    to be generated
  • componentName -- name of current narrative
    product component (for tabular products, this is
    None)

75
Basic Customizations Thresholds and Variables
Arguments
  • TextRules arguments
  • tree -- holds information about the narrative
    product
  • node -- holds information about current section
    of the narrative product
  • elementName -- name of weather element e.g.
    MaxT, Wind

76
Basic Customizations Thresholds and Variables
Arguments
From TextRules library of classes def
gust_wind_difference_threshold (self, tree,
node) Difference between gust and
max wind below which gusts are not
mentioned return 15
77
Basic Customizations Thresholds and Variables
Arguments
Based on the current edit area def
gust_wind_difference_threshold (self, tree,
node) Difference between gust and
max wind below which gusts are not
mentioned mountains area1,
area2 if self.currentAreaContains(tre
e, mountains) return 25
else return 15
78
Basic Customizations Thresholds and Variables
Arguments
Based on the current component def
gust_wind_difference_threshold (self, tree,
node) Difference between gust and
max wind below which gusts are not
mentioned componentName
node.getComponentName() if
componentName Period_1 return
15 else return 25
79
Basic Customizations Thresholds and Variables
Customizing Weather
Instead of rain showers we
want showers In Local File def
wxTypeDescriptors (self) list
TextRules.TextRules.wxTypeDescriptors(self)
list.append((, RW, , ,
showers)) return list
80
Thresholds and Variables
ExercisesLocated in Text Product Reference Guide
  • Thresholds Exercise 1 Modifying a Pre-existing
    Override
  • Thresholds Exercise 2 Working with the
    temporalCoverage_percentage
  • Thresholds Exercise 3 Working with a
    Non-linear Threshold
  • Thresholds Exercise 4 Basing a Threshold on the
    Current Edit Area

81
Summary End of Part 1
  • Product Set-Up
  • Definition Section
  • Thresholds and Variables

82
Exercises Part 1
  • Product Set-Up Exercises
  • Definition Section Exercises
  • Thresholds and Variables Exercises
  • Found in the Text Product Reference Guide

83
Part 2
84
Basic CustomizationsProduct Components
  • Component Definition
  • Analysis-driven Phrases
  • Locating Relevant Thresholds and Variables

85
Basic CustomizationsProduct Components
  • type component
  • methodList methods to assemble the component
  • analysisList Weather Elements
  • analysis methods from SampleAnalysis
  • phraseList Text Rules to create phrases
  • phrase methods from Text Rules libraries

86
Basic CustomizationsProduct Components
def Period_1(self) return type
component, methodListself.assemblePhras
es,self.wordWrap, "analysisList"
( "MinT", self.avg), (
"MaxT", self.avg), (
"T", self.hourlyTemp),
( "Sky", self.minmax),
( "PoP", self.avg), (
"Snow", self.minmax), (
"Wind", self.vectorMinMax),
( "Wx", self.dominantWx)
, phraseList"
self.reportTrends,
self.wind_summary,
self.sky_phrase,
self.weather_phrase,
self.snow_phrase,
self.highs_phrase,
self.lows_phrase,
self.wind_phrase,
self.pop_phrase,
,
87
Basic CustomizationsComponent Analysis
"analysisList" ( "MinT",
self.avg), ( "MaxT",
self.avg), ( "T",
self.hourlyTemp), ( "Sky",
self.minMax), ( "PoP",
self.avg), ( "Snow",
self.minmax), ( "Wind",
self.vectorMinMax), ( "Wx",
self.dominantWx) ,
88
Basic Customizations Component Phrases
phraseList"
self.reportTrends,
self.wind_summary,
self.sky_phrase,
self.weather_phrase,
self.snow_phrase,
self.highs_phrase,
self.lows_phrase,
self.wind_phrase,
self.pop_phrase,
,
89
Basic Customizations Component Phrase Result
Warmer. Windy. Partly cloudy. Isolated rain
showers. Highs around 60. Winds northeast at 35
to 40 mph. Probability of precipitation 20
percent.
90
Basic Customizations Analysis-Driven Phrases
"analysisList" ( "MinT",
self.avg), ( "MaxT",
self.avg), ( "T",
self.hourlyTemp), ( "Sky",
self.minMax), ( "PoP",
self.avg), ( "Snow",
self.minMax), ( "Wind",
self.vectorMinMax), ( "Wx",
self.dominantWx) ,
91
Basic CustomizationsAnalysis-Driven Phrases
def Period_1(self) return type
component, methodListself.assemblePhras
es,self.wordWrap, "analysisList"
( "MinT", self.avg), (
"MaxT", self.avg), (
"T", self.hourlyTemp),
( "Sky", self.minmax),
( "PoP", self.avg), (
"Snow", self.minmax), (
"Wind", self.vectorMinMax),
( "Wx", self.dominantWx)
, phraseList"
self.reportTrends,
self.wind_summary,
self.sky_phrase,
self.weather_phrase,
self.snow_phrase,
self.highs_phrase,
self.lows_phrase,
self.wind_phrase,
self.pop_phrase,
,
92
Basic Customizations Analysis-Driven Phrases
"analysisList" ( "MinT",
self.avg), ( "MaxT",
self.avg), ( "T",
self.hourlyTemp), ( "Sky",
self.minmax), ( "PoP",
self.avg), ( "Snow",
self.minmax), ( "Wind",
self.vectorAvg), ( "Wx",
self.dominantWx) ,
93
Basic Customizations Analysis-Driven Phrases
Using vectorMinMax Winds northeast at 35 to 40
mph.
Using vectorAvg Winds northeast at 35 mph.
94
Basic CustomizationsSampleAnalysis Reference
Method Return Value -------------
---------------------------------- vectorMinMax
((minMag, maxMag) dir) vectorAvg
(mag, dir)
95
Basic CustomizationsSampleAnalysis Reference
Method Return
Value --------------------------------------------
--- vectorModeratedMinMax ((minMag, maxMag)
dir) Returns the min and max values after
filtering based on the percentage defined in
moderated_dict

96
Basic CustomizationsSampleAnalysis Reference
Variable Explanation ------------
----------------------------------- moderated_dict
Percentages for
filtering high and
low values
97
Basic Customizations Analysis-Driven Phrases
  • From SampleAnalysis
  • def moderated_dict (self, parmHisto, timeRange,
    componentName)
  • This dictionary defines the low and high
    limit at which outliers will be removed when
    calculating moderated stats. By convention, the
    first value listed is the percentage allowed for
    low values and second the percentage allowed for
    high values.
  • return
  • Wind (20,20)

98
Basic Customizations Analysis-Driven Phrases
Using vectorMinMax Winds northeast at 25 to 40
mph.
Using vectorModeratedMinMax Winds northeast at
30 to 35 mph.
99
Basic Customizations Analysis-Driven Phrases
Temporal resolution "analysisList"
( "MinT", self.avg), (
"MaxT", self.avg), (
"T", self.hourlyTemp),
( "Sky", self.minmax),
( "PoP", self.avg), (
"Snow", self.minmax), (
"Wind", self.vectorAvg), (
"Wx", self.dominantWx)
,
100
Basic Customizations Analysis-Driven Phrases
Temporal resolution "analysisList"
( "MinT", self.avg), (
"MaxT", self.avg), (
"T", self.hourlyTemp),
( "Sky", self.minmax),
( "PoP", self.avg), (
"Snow", self.minmax), (
"Wind", self.vectorAvg, 6),
( "Wx", self.dominantWx)
,
101
Basic Customizations Analysis-Driven Phrases
Using vectorAvg Winds northeast at 35 mph.
Using vectorAvg, 6 Winds northeast at 35 mph
increasing to 40 mph in the afternoon.
102
Basic Customizations Analysis-Driven Phrases
"analysisList" ( "MinT",
self.avg), ( "MaxT",
self.avg), ( "T",
self.hourlyTemp), ( "Sky",
self.minmax), ( "PoP",
self.avg), ( "Snow",
self.minmax), ( "Wind",
self.vectorAvg), ( "Wind",
self.vectorMinMax), ( "Wx",
self.dominantWx) ,
103
Basic Customizations Analysis-Driven Phrases
"analysisList" ( "MinT",
self.avg), ( "MaxT",
self.avg), ( "T",
self.hourlyTemp), ( "Sky",
self.minmax), ( "PoP",
self.avg), ( "Snow",
self.minmax), ( "Wind",
self.vectorAvg), ( "Wx",
self.dominantWx) ,
104
Basic Customizations Analysis-Driven Phrases
"analysisList" ( "MinT",
self.avg), ( "MaxT",
self.avg), ( "T",
self.hourlyTemp), ( "Sky",
self.minmax), ( "PoP",
self.avg), ( "Snow",
self.minmax), ( "Wind",
self.vectorAvg), ( "Wx",
self.dominantWx, 0) ,
105
Basic Customizations Analysis-Driven Phrases
Using dominantWx Widespread rain and snow.
Using dominantWx, 0 Widespread rain then snow
in the late afternoon. or Widespread rain in the
morning then snow in the late afternoon.
106
Basic Customizations Choosing an Alternate
Phrase
phraseList"
self.reportTrends,
self.wind_summary,
self.sky_phrase,
self.wind_phrase,
self.weather_phrase,
self.snow_phrase,
self.highs_phrase,
self.lows_phrase,
self.pop_phrase,
,
107
Basic Customizations TextRules Reference
Weather Phrase Element Method ------------
----------------------------------- Wind wind_p
hrase Wind wind_withGusts_phrase
108
Basic Customizations Choosing and Alternate
Phrase
phraseList"
self.reportTrends,
self.wind_summary,
self.sky_phrase,
self.wind_withGusts_phrase,
self.weather_phrase,
self.snow_phrase,
self.highs_phrase,
self.lows_phrase,
self.pop_phrase,
,
109
Basic Customizations Changing the Order of
Phrases
phraseList"
self.reportTrends,
self.wind_summary,
self.sky_phrase,
self.weather_phrase,
self.snow_phrase,
self.highs_phrase,
self.lows_phrase,
self.wind_withGusts_phrase,
self.pop_phrase,
,
110
Basic Customizations Locating Thresholds and
Variables
phraseList"
self.reportTrends,
self.wind_summary,
self.sky_phrase,
self.windRange_phrase,
self.weatherRange_phrase,
self.snow_phrase,
self.highs_phrase,
self.lows_phrase,
self.pop_phrase,
,
111
Basic Customizations TextRules Reference
Weather Phrase Element Method ------------
----------------------------------- SnowAmt snow
_phrase
112
Basic Customizations TextRules Reference
  • Example phrase Snow accumulation 2 inches.
  • Statistics Required SnowAmt Scalar
    Statistics
  • Thresholds and Variables
  • phrase_descriptor_dict
  • pop_snow_lower_threshold
  • getSnowReportEndDay
  • increment_dict

113
Basic Customization Inheritance Hierarchy for
Smart Text Products
Sample Analysis
TextRules
114
Basic CustomizationsText Rules Modules
115
Basic CustomizationsText Rules Classes
  • ConfigVariables -- many common thresholds and
    variables
  • ScalarPhrases -- Sky, PoP, MinT, MaxT
  • VectorRelatedPhrases -- Wind, WindGust
  • WxPhrases -- Wx, Weather descriptors
  • CombinedPhrases -- skyPopWx_phrase
  • MarinePhrases -- Wave, Period, Swell
  • FirePhrases -- FWF-related
  • DiscretePhrases -- Headlines

116
Basic Customiza-tions Basic Local Effects
  • def Period_1(self)
  • return
  • type component,
  • methodList
  • self.assembleChildWords,
  • self.wordWrap,
  • analysisList
  • Sky, self.median, 6),
  • PoP, self.stdDevMaxAvg, 6),
  • Wind, self.vectorMedianRange, 6),
  • WindGust, self.avg, 6)
  • phraseList
  • self.sky_phrase,
  • self.wind_phrase,
  • ,

117
Basic Customiza-tions Basic Local Effects
  • def Period_1(self)
  • return
  • type component,
  • methodList
  • self.assembleChildWords,
  • self.wordWrap,
  • analysisList
  • Sky, self.median, 6),
  • PoP, self.stdDevMaxAvg, 6),
  • Wind, self.vectorMedianRange, 6),
  • WindGust, self.avg, 6)
  • phraseList
  • self.sky_phrase,
  • (self.wind_phrase,self._windLocalEffectLi
    st()),
  • ,

118
Basic Customizations Basic Local Effects
  • def _windLocalEffectsList(self)
  • leArea1 self.LocalEffectArea(Coast,
    near the coast)
  • leArea2 self.LocalEffectArea(Inland,
    inland)
  • return self.LocalEffect(leArea1, leArea2,
    10, and)

119
Basic Customiza-tions Basic Local Effects
  • def Period_1(self)
  • return
  • type component,
  • methodList
  • self.assembleChildWords,
  • self.wordWrap,
  • analysisList
  • Sky, self.median, 6),
  • PoP, self.stdDevMaxAvg, 6),
  • Wind, self.vectorMedianRange, 6),
  • WindGust, self.avg, 6)
  • phraseList
  • self.sky_phrase,
  • (self.wind_phrase,self._windLocalEffectLi
    st()),
  • ,
  • intersectAreas (Wind, Coast,
    Inland),

120
Basic Customizations Basic Local Effects
  • North winds 20 mph near the coast and west winds
    10 mph inland.
  • Embedded Local Effect One time period
  • Near the coastNorth winds 20 mph becoming 10
    mph in the afternoon. InlandNorth winds 10 mph
    becoming light in the afternoon.
  • Conjunctive Local Effect Multiple time periods

121
Basic Customizations Basic Local Effects
  • Can be specified as a method to be determined at
    run-time
  • Local Effects List
  • Local Effect Areas
  • Threshold
  • Descriptive labels
  • Can have multiple areas and multiple local
    effects per phrase

122
Product Component
ExercisesLocated in Text Product Reference Guide
  • Component Exercise 1 Working with
    Analysis-Driven Wind Phrasing
  • Component Exercise 2 Working with
    Analysis-Driven Weather Phrasing
  • Component Exercise 3 Choosing an Alternate
    Phrase
  • Component Exercise 4 Customizing a Phrase
  • Component Exercise 5 Working with Local Effects

123
Basic Customizations Narrative Products
  • Determine Product Components
  • Determine Time Period for each Component

124
Basic Customizations Narrative Product
Definition
NarrativeDef" ("Period_1,12),
("Period_2_3", 12), ("Period_2_3",12),
("Period_4_5",12), ("Period_4_5",12),
(Period_6, 6),
("Extended",24), ("Extended",24),
("Extended",24) ,
125
Basic Customizations Narrative Product
.TODAY...VERY WINDY. HIGHS IN THE MID 30S.
TEMPERATURES FALLING IN THE AFTERNOON. SOUTHEAST
WINDS 5 TO 15 MPH BECOMING NORTH 40 TO 45 MPH IN
THE AFTERNOON. .TONIGHTMOSTLY CLOUDY. LOWS IN
THE UPPER 20S. LIGHT WINDS. .WEDNESDAYPARTLY
CLOUDY. HIGHS IN THE MID 20S. LIGHT
WINDS. .WEDNESDAY NIGHTMOSTLY CLOUDY. LOWS 18.
CHANCE OF PRECIPITATION 20 PERCENT.
126
Basic CustomizationsConfigurable Issuance
127
Basic Customizations Configurable Issuance
  • From Standard File
  • def _issuance_list (self,argDict)
  • narrativeDefAM (Period_1, 12),
    ("Period_2_3", 12),
  • ("Period_2_3",12), ("Period_3_4",12),
  • ("Period_3_4",12)
  • return
  • (Morning, self.DAY(), self.NIGHT(),
    self.NIGHT(),
  • .TODAY, early in the morning,
  • late in the afternoon, 1,
  • narrativeDefAM),
  • ..

128
Configurable Issuance
ExercisesLocated in the Text Product Reference
Guide
  • Configurable Issuance Exercise 1 Working with
    Configurable Issuance

129
Basic CustomizationsHeadlines
  • Headlines are generated from the Headlines
    Discrete weather element
  • If a Headline grid is defined, Headlines will
    automatically appear in your product.

130
Basic Customizations Headlines
131
Basic CustomizationsHeadlines Configuration
  • FLOOD WATCH UNTIL 9 PM MDT
  • WINTER STORM WARNING TUESDAY NIGHT
  • You can configure
  • Allowed Headlines by product
  • Time descriptors e.g. afternoon, evening

132
Basic Customizations Headlines Configuration
def allowedHeadlines(self)
BlzrdWRN, WintStmWRN,
HiWndWA, TornWA,

133
Basic Customizations Headlines Configuration
def allowedHeadlines(self)
BlzrdWRN, WintStmWRN,
HiWndWA, TornWA,
HvySnowWRN,

134
Basic CustomizationsHeadline Configuration
  • Time Descriptor configuration
  • Increase the temporal resolution
  • High Wind Watch Tuesday
  • High Wind Watch Tuesday Evening
  • Time Descriptor labels
  • High Wind Watch Tuesday Night
  • High Wind Watch Tuesday Overnight

135
Basic CustomizationsMarine Headlines
  • More complex
  • Ordering of allowedHeadlines list defines
    priority
  • IN EFFECT and EXPECTED wording can be
    specified in the allowedHeadlines list.
  • useAutomaticHeadlines

136
Headline ExercisesLocated in the Text
Product Reference Guide
  • Headline Exercise 1 Generating Headlines
  • Headline Exercise 2 Altering the
    allowedHeadlines

137
Basic Customizations Local File Organization
Standard Version
Local Version
138
Basic Customizations Local File Organization
Standard Version
Local Version
139
Basic CustomizationLocal File Organization
  • Override Section -- perhaps by source
  • Clearly comment lines changed from baseline
  • Check Release Notes for changes to overrides and
    update if necessary
  • Patches Section -- code to be removed with next
    release
  • Trouble-Shooting Section -- code to be removed
    when problem is solved

140
Basic CustomizationInheriting External Files
  • Comment out all overrides in the Local file
  • Create Utility file e.g. Regional_ZFP
  • In Local file import and inherit Utility file

141
Basic Customizations Inheriting of External
Files
class Regional_ZFP Put overrides here
def pop_lower_threshold (self, tree, node)
return 20
142
Basic Customizations Inheriting of External
Files
import Regional_ZFP class TextProduct
(Regional_ZFP.Regional_ZFP,
AreaFcst.TextProduct) Definition
copy.deepCopy( Regional_ZFP.
TextProduct.Definition)
143
Help and Feedback
  • Multi-faceted approach
  • FSL Developers
  • Local Formatter Development Team
  • RPP Participants
  • IFPS Focal Points
  • List server RPP
  • Regional Support

144
Help and Feedback Trouble-shooting Tips
  • Product doesnt run
  • Run from terminal window to see error messages.
  • Override problem code and include print
    statements.
  • If problem code is not clear Comment out all
    Local overrides and incrementally add them back
    in to isolate problem code.

145
Help and Feedback Using the Listserver
  • Product doesnt run. Include ALL of the following
    in your listserver message
  • IFPS Version
  • Product (ZFP, CCF, etc)
  • Include complete description of the problem.
  • Include ENTIRE error message.
  • Include Local file.
  • Include results of print statements

146
Help and Feedback Using the Listserver
  • Undesirable results
  • Check documentation for the offending phrase to
    see if customization would help.
  • If not, submit example of current output.
  • Include desired results.
  • Include Local file.
  • Describe the data in the grids.

147
Help and Feedback Exercises
  • Help Exercise 1 Write a Help Request to the RPP
    Listserver. Be sure to include ALL information
    listed in this section.
  • Help Exercise 2 Answer (or think how you might
    answer) a Help Request on the RPP listserver.

148
Summary - End of Part 2
  • Product Components
  • Analysis-Driven
  • Thresholds and variables for Phrases
  • Local Effects
  • Configurable Issuance
  • Headline
  • Help and Feedback

149
Exercises- Part 2
  • Product Component Exercises
  • Configurable Issuance Exercises
  • Headline Exercises
  • Help and Feedback Exercises
  • Found in the Text Product Reference Guide
Write a Comment
User Comments (0)
About PowerShow.com