No. 11.4

Adding Productivity Tools to the WFO-Advanced Meteorological Workstation

Anne Wilson*, Dennis M. Rodgers, and U. Herb Grote
NOAA Forecast Systems Laboratory (FSL)Boulder, Colorado
To be presented at the 15th Conference on IIPS for Meteorology, Oceanography, and Hydrology, January 10 - 15, 1999, Dallas, Texas.

1. INTRODUCTION

The WFO-Advanced workstation is a central component of the AWIPS modernization effort. In addition to providing data display and manipulation capabilities, WFO-Advanced also provides hooks that allow software developers to incorporate additional functionality. One example of such functionality is MetGen, a productivity tool being developed at the Forecast Systems Laboratory (FSL) for the generation of aviation weather products. MetGen, designed for use by forecasters at the NCEP Aviation Weather Center, generates AIRMETS as well as consistent high-resolution grids of the hazards for which AIRMETs are issued, such as icing and turbulence (Rodgers et al. 1999). Development of MetGen is funded by the FAA Aviation Weather Research Program under the auspices of the FAA Product Development Team for the Aviation Gridded Forecast System.

Using MetGen as an illustration, this paper describes the types of additional functionality the workstation supports, and the high level requirements for creating such a tool.

2. ADDITIONAL FUNCTIONALITY SUPPORTED BY WFO-ADVANCED

MetGen (Figure 1) uses the WFO-Advanced extension framework (Kelly, 1997b) which allows the creation of simple, editable geometric shapes (in latitude and longitude space) that include points, lines, polylines, and polygons. These shapes can be annotated, created, moved, edited, and deleted. Various line styles, such as dotted or dashed, are supported along with a variety of vertex markers such as a square, triangle, bull's-eye, and cross hair.


Figure 1. MetGen AIRMET Generation Tool on WFO-Advanced.

The extension framework supports multiple overlays of editable shapes. This is useful for handlingtime-sequenced series, such as matching the path of a storm with a series of time-stamped data displayed on the workstation. Editable shapes can belong to more than one overlay, easing housekeeping overhead for the developer and minimizing interprocess communication.

3. METGEN FUNCTIONALITY

MetGen allows forecasters to graphically delineate "from lines," i.e. areas of hazards, on meteorological data displays. From line vertices are called anchor points. To support AIRMET operational requirements, MetGen translates anchor points from latitudes and longitudes to distance/bearings relative to the nearest VOR (an aviation navigational aid). It snaps anchor points to 10-mile increments and orders anchor points in a clockwise direction. AIRMETs are required to list U.S. states affected by a from line. MetGen determines the states affected by a particular from line and labels each one in the display. Via the graphics, the user can toggle off state labels to remove those states from the list.

MetGen also has a graphical user interface (GUI), a window containing menu bars, buttons, selection lists, etc. (widgets, in GUI terminology), to allow forecasters to specify other AIRMET details.Thus, there are two ways in which a user interacts with MetGen: via interaction with the editable shapes, or via the GUI.

Finally, MetGen creates most of the AIRMET text automatically, and also provides editing capabilities for forecasters to add free form text to the final product.

4. WFO-ADVANCED TERMINOLOGY

Before discussing how the workstation supports the development and incorporation of a new tool, it is necessary to elaborate on some terminology in the context of the WFO-Advanced system: Object-oriented programming, Interactive Graphics Capability, extension, and application.

Object-Oriented Programming - This is a style of programming where a program models a suite of interacting objects. Objects interact by sending each other messages. An object's behavior, the list of messages it recognizes, is defined by the object's class. An object of type X is an instantiation of class X. A new class may be subclassed (also called derived) from an existing class, allowing it to inherit all the functionality of the parent class. WFO-Advanced is written mainly in C++, an object-oriented programming language. In the upcoming discussion, class names and messages, as well as bits of C++ code, are printed in bold face.

Process - In the computer science sense, a process is a program - a separate and distinct piece of executable code. Since it is often desired that processes interact, the operating system provides mechanisms for processes to communicate with each other. WFO-Advanced uses these mechanisms to provide higher level abstractions for developers to use for interprocess communication.

Interactive Graphics Capability - The WFO-Advanced display capability is designed around the concept of an Interactive Graphics Capability (IGC), which is a process that retrieves and displays data. Each display monitor hosts five IGCs, one for each data display pane. A single "user interface" process manages the five IGCs and their interaction. See Biere (1998) and Grote and Biere (1998) for more information about WFO-Advanced software structure.

Extension - In WFO-Advanced, an extension is a process that provides the interactive graphics functionality described earlier. In addition to MetGen, WFO-Advanced extensions include WarnGen and Baselines. Although many extensions can be loaded at one time, only one extension can be active at a time.

Application - In the context of WFO-Advanced, an application is simply a separate program that can be invoked from the workstation. Much simpler in concept than an extension, an application is only minimally integrated into the workstation. In particular, only limited communication between the workstation and the application is supported. Applications will not be described further in this paper,and are mentioned here only for completeness. See Kelly (1997a) for more information.

5. IGC/EXTENSION INTERACTION

Each extension process is linked with a single IGC process (although an IGC process may be linked with multiple extensions). Note that not only are they two separate objects, they are separate processes.

Why require an extension to be a separate process? WFO-Advanced designers wanted to support extension of the workstation functionality. At the same time, it is necessary to protect the core workstation code from breakage, performance hits, etc. For this reason a limited set of messages is provided for communication between an extension and an IGC. Thus, it is not necessary to recompile the workstation to build an extension. Also, an extension problem or crash will not affect the core workstation, although it is still possible for the extension to overwhelm the CPU, as there is no protection in the workstation against this.

To illustrate IGC/extension interaction, recall that there are two ways in which a user may interact with an extension: via the graphics and via a GUI.

In summary, if the user interacts with the graphics, the IGC handles the interaction then sends a message to the extension. If the user interacts via the GUI, the extension handles the event then sends a message to the IGC.

6. BUILDING METGEN

MetGen is written in two programming languages: C++ and Python (Lutz 1996). The choice ofusing two languages was made for ease of building a GUI. Python was chosen because it is an object- oriented, interpreted language with an object-oriented GUI toolkit called Tkinter. An object-oriented approach is excellent for GUIs as it provides a very natural mapping from objects to widgets.

Each language has its own strengths and weaknesses. C++ is a compiled language, and therefore relatively fast for execution. Python is an interpreted language, thus it is slower in execution than C++; however, development can be faster since changes can be tested immediately without recompilation. Often, developers prototype in an interpreted language like Python, then do final coding in a compiled language for speed. However, interpreted languages can be quite sufficient for handling user interaction as user-generated events are relatively slow.

6.1 The C++ Side of MetGen

An extension process must include one or more objects whose class is derived from the existing class Extension. The Extension class defines default behavior for messages received from the IGCsuch as editedPolygon, and deleteElement messages. The new subclass may override the default behavior provided in the Extension class if desired, and provide any additional functionality required. For MetGen a new subclass of Extension, IGC_Interface, was defined. Among other tasks, IGC_Interface receives all messages from the IGC.

This new Extension object must contain one or more interactive depictable objects, instantiated from the class InteractiveDepictableExt. This object is the blank canvas on which editable shapes are drawn and displayed. In particular, an extension may use a multiple InteractiveDepictableExt objects to create a sequence of time-stamped displays.

The way AIRMETs are currently defined, a single from line describes a forecast over a 6-hourperiod, a "smearing" of the phenomenon over time. (Text is added to describe the position of the phenomenon more precisely over the forecast period.) Since there is no need to define a from line for more than one time period per issuance, MetGen uses only one InteractiveDepictableExt. If, likeMetGen, an extension does not require a sequence of time-stamped displays and thus uses only one InteractiveDepictableExt, it is called a static extension.

However, if operational requirements were to change, multiple time-stamped from lines could be created to track a single hazard more precisely over the 6-hour time period. In this case MetGen would instantiate multiple InteractiveDepictableExt objects, one for each time period, and become a nonstatic extension. Nonstatic extensions are more complex than static extensions, as the developer must manage the InteractiveDepictableExt sequence when the number of frames in the underlying data display changes (due to user actions or automatic updates).

An InteractiveDepictableExt will contain one or more EditableElements, the editable shapes inan extension: Points, PointSequences, Lines, Polylines, and Polygons (all of which are subclasses of EditableElements). EditableElements are defined in world coordinates, and can be used to represent a variety of data. MetGen uses EditablePolygons to represent from lines and EditablePoints to create the state IDs that are displayed and toggled graphically.

MetGen keeps a list of anchor points and affected states for each from line from which text is generated. Thus, in the class IGC_Interface, MetGen redefines the editedPolygon method and the editedPoint method to track changes to from lines or state labels so that the lists are always current. As an example of MetGen specific behavior, when the IGC_Interface object receives an editedPolygon message from the IGC indicating that the user edited a from line, it massages the respective edited polygon to meet operational requirements as follows. First the anchor points are ordered clockwise. Then, for each anchor point, the nearest VOR is determined, and the point's position in latitude and longitude space is mapped to a distance and bearing relative to that VOR using a 16- point compass. Finally, the point is snapped to the nearest 10-mile increment along that bearing. These tasks are computationally intensive, thus better handled by C++ than by Python. Finally, the adjusted polygon information is sent to the Python side for text generation purposes.

Other supporting classes on the C++ side of MetGen include IGC_FromLine and IGC_FromLineList, both of which help manage from lines.

6.2. The Python Side of MetGen

The Python portion of MetGen creates and handles user interactions with the GUI, thus it is the main driver of the extension. The Python portion of MetGen also handles the final text generation.

Python classes defined for MetGen include:

Note that both the C++ side and the Python side of MetGen have "from line" objects. These objects hold different form line information. For example, the IGC_FromLine stores anchor points in world coordinates while the Python FromLine stores them in distance/bearings.

The AGenMgr (for AIRMET generation manager), the first object instantiated, is the top manager in the hierarchy of managers. It instantiates a FromLineMgr, MetMgr, and a FrameMgr. The FromLineMgr instantiates and manages FromLine objects as the user creates them graphically via the IGC. If the user interacts with the GUI, the FrameMgr reports that back to the AGenMgr. As the user requests AIRMETs to be generated, the MetMgr instantiates Met objects. FromLine objects are managed separately from Met objects as a from line may appear in more than one "met."

Once the extension process is invoked, the AGenMgr passes control to the Tkinter event loop. This loop simply waits for the user to interact with the GUI via mouse buttons. Each mouse event is received by the widget invoked by the user. The widget responds and subsequently eports to the FrameMgr,which then sends a message to the AGenMgr where the request is handled appropriately.

7. SUGGESTIONS FOR DEVELOPERS

7.1 What's Easy, What's Hard

Several additional significant aspects to building an extension are common to all extensions but are beyond the scope of this paper. These include updating informational tables and ensuring that the communication between the IGC and the extension is set up correctly (Kelly 1997b). Also, a more etailed report on MetGen and extension construction will be available within the next year.

The main difficulty in building an extension is attending to all the details so that interaction between the IGC and the extension is successful. Once this is achieved, creating and manipulating shapes and managing time sequences is easy.

Note that the existing software does not support mixing colors in a single extension. Also, users may not create editable shapes by graphically "poking" their initial location. Instead, all initial points for an editable shape must be provided to the IGC at one time, and the shape will appear at that location on the screen. Then one may move the shape or add or delete vertices.

7.2 Languages Choices

Object-oriented programming experience would be helpful in building an extension. At the very least, as long as one subclass is created from the class Extension and calls made properly to the IGC, the rest of the software could be written in C.

MetGen incorporates two different programming languages. Integrating two languages into a single executable can be tricky, but for MetGen the flexibility is well worth it. However, there are GUI toolkits available written in C, such as Motif, that would obviate the need for any compiler or interpreter other than the C++ compiler.

7.3 Tips

Running the full FX-Advanced workstation uses extensive system resources. Development of an extension can be simplified by not using the full workstation during development. Instead, one can run a single IGC to use for development and testing, then run the full workstation for final testing. Extension interaction occurs as usual.

When an extension creates or modifies an editable shape, the IGC will perform the modification immediately. For large batches of such requests, it can be more efficient and produce a better response time if requests are buffered so that they are all handled at once.

The IGC recognizes a message that will buffer requests - InteractiveDepictExt::refreshIGC(false,igcProcess()).

Buffering can be turned off via a different form of this same message -InteractiveDepictExt::refreshIGC(true, igcProcess()).

Python is recommended as an easy language to learn to read and write. With it, one can practice object-oriented programming skills. It is freely available from http://www.python.org/.

8. REFERENCES

Biere, M., 1998: WFO-Advanced Two-Dimensional Display Software Design. 14th International Conference on Interactive Information and Processing Systems (IIPS) for Meteorology, Oceanography and Hydrology, Phoenix, AZ, Amer. Meteor. Soc., 376 - 379.

Grote, U. H., and M. Biere, 1998: The WFO-Advanced System Software Architecture. 14th International Conference on Interactive Information and Processing Systems (IIPS) for Meteorology, Oceanography and Hydrology, Phoenix, AZ, Amer. Meteor. Soc., 321 - 324.

Kelly, S., 1997a: The Application Interface for the WFO-Advanced Forecaster Workstation, D2D. 13th International Conference on Interactive Information and Processing Systems (IIPS) for Meteorology, Oceanography and Hydrology, Long Beach, CA, Amer. Meteor. Soc., 328 - 331.

Kelly, S., 1997b: An Object-oriented Framework for Local Extension to the WFO-Advanced Forecaster Display Workstation, D2D. 13th International Conference on Interactive Information and Processing Systems (IIPS) for Meteorology, Oceanography and Hydrology, Long Beach, CA, Amer. Meteor. Soc., 324 - 327.

Lutz, M. 1996: Programming Python, O Reilly & Associates, Sebastopol, CA.

Rodgers, D. M., A. Wilson, G. Pratt, and J. Frimel, 1999: An Update on the Development of Forecaster Productivity Tools for the Aviation Weather Center. Eighth Conference on Aviation, Range, and Aerospace Meteorology, Dallas, TX, Amer. Meteor. Soc.


Footnotes

*
Corresponding Author Address: Anne Wilson, NOAA/ERL/FSL, Mail Code: R/E/FS4, 325 Broadway,Boulder, CO 80303-3328 [no longer at FSL; contact Herb Grote].

HTML document prepared and maintained by Joe Wakefield.
Last updated 11 Dec 98