Prompts and Menus
The ability to guide the user through the rough task of selecting options is critical for most programs. WXP employs a system of prompts and menus to guide the user to the final product. Even though the menu system can provide access to many types of plots, the command line and resource interface is far more powerful. There is a balance between providing basic capabilities to the user through the menus and overwhelming the user with choices.
NOTE for Windows 95/98/NT Version -- In all graphics applications, there is no ability to print messages, prompts and menus to standard output. For these applications, the menus and prompts are disabled. As a result, all pertinant information must be specified on the command line.
Program Prompts
Many WXP programs prompt the user for information. A prompt is used when the number of options is fairly limited and explanation is not required. Each prompt is a request for a resource value. In some cases, you will enter the exact value for the resource as in a filename.
/home/wxp/convert/96112205_sao.wxp /home/wxp/convert/96112206_sao.wxp Enter the surface filename: 96112206
The filename is entered from the list of files. You can abbreviate the value in some cases as in the above example.
In other cases, you will enter an abbreviation for the resource.
Display (D) or Postscript (P):
The abbreviations will be clearly listed at the prompt.
Program Menus
If more information is needed in order to select a resource or parameter, a menu is displayed and the selection is from taken from the menu listing. Menus have a couple of added features. First, they can be nested so that the user can select more than one parameter to display from within a single program. For example, you can select to plot temperature for the Midwest. When you are done looking at this plot, you can select another variable such as temperature or go up a menu level and select a different region. Second, menus often have many more parameters to select than those listed. The programs have predefined variable types, not all of which can be displayed in a simple menu. You can still select the variable type but it will not appear on the menu.
When a resource is to be selected via a menu, a list of choices will appear. Each menu item has a resource value associated with it. By entering the number from the menu, you are essentially entering that value. It is just an abbreviation for the value.
Region Menu 1: Contiguous US -------------------- 2: New England 10: Western Canada 3: Atlantic 11: Eastern Canada 4: Southeastern 12: Northern Canada 5: Midwestern 13: North America 6: Southern Plains 14: Indiana 7: Northwestern 15: Lafayette 8: Southwestern 0: Return to previous menu -1: Exit program Enter the region:
There are several ways of entering data at a menu prompt. First, you can enter the number associated with the selection. For example, the Midwest region can be selected by entering "5" at the prompt. Second, the full menu listing can be there is the menu listing. You could have entered "Midwestern". There is also the resource value. To get a list of possible resource values, you can type "?" at the menu prompt:
Enter the region: ? back,us,ne,at,se,mw,sp,nw,sw,--,wc,ec,nc,namer,ind,laf
The values are then listed and the prompt returns. You can see that the associated value is "mw" so this could have been entered as well. There are a number of preset regions that don't show up on the menu because of space concerns. To get a full list of predefined regions, use the "list" command:
Enter the region: list Abbr Description us Contiguous US ne New England at Atlantic ... namer North America nhem North Hemisphere shem South Hemisphere hi Hawaii ak Alaska globe Global ... europe Europe easia East Asia ... aust Australia wpac West Pacific antarc Antarctica
Often the values are short and mostly easy to remember. As you get more adept at using WXP, you will rarely look at the menu but will almost always enter the resource value or abbreviation.
Finally, there are non-menu resource values that can be selected. For the region menu, a full plot domain value can be entered. This really generalizes the use of menus to being interfaces into setting the resource:
Enter the region: 40,-105,1.4
Here, the values represent the central latitude, longitude and the scale size of the plot (1 is appropriate for regional plots).
Most WXP resources can be set from the WXP prompt. To view a list of set resources (those with values other than the program defaults), use the "set" command:
Enter the variable: set Set resources default: /home/wxp/etc file_path: /home/wxp/etc data_path: /home/wxp/data con_path: /home/wxp/convert grid_path: /home/wxp/grid raw_path: /home/wxp/raw name_conv: name_conv current: la
You can then change any of these or set a new one by specifying the resource and its value:
Enter the variable: set color_map=lblue
The resource is then set and the variable menu prompt returns. This does not work for all resources because these resources have been already been used (for example filename). This will work for those resources that have yet to be used such as colors, plot types, etc.
Finally, two more options are available. If the user wishes to exit the program, they can enter "-1" at the menu prompt and the program will terminate immediately and return to either the WXP shell or the operating system prompt. When working with menus and submenus, the user can enter "0" to return to a main menu when within a submenu. If the user is at the top menu level or main menu, this option will exit the program.
Typical Prompts and Menus
Most programs use a similar order to the prompts and menus.
- Filename:
In general, there is a prompt for filename in which a list of files is displayed and a prompt for the appropriate filename.List of available files: /home/wxp/convert/96112205_sao.wxp /home/wxp/convert/96112206_sao.wxp Enter the surface filename: 96112206
The filename can be entered as the full path "/home/wxp/convert/96112206_sao.wxp", the name of the file "96112206_sao.wxp" or just the date portion of the file "96112206". WXP handles putting the extension and the path on the filename if not specified.
You can also specify latest for the filename. If you enter "cu", the current data file is selected. If the current data file does not exist, an error will be printed and the prompt will reappear. If you enter "la", the last available file is searched for. The current resource will have more information on the options. - Region:
There is a prompt for display region, which represents the area, and the projection the plot will be drawn to.Region Menu 1: Contiguous US -------------------- 2: New England 10: Western Canada 3: Atlantic 11: Eastern Canada 4: Southeastern 12: Northern Canada 5: Midwestern 13: North America 6: Southern Plains 14: Indiana 7: Northwestern 15: Lafayette 8: Southwestern 0: Return to previous menu -1: Exit program Enter the region:
The region can be selected from this list, the full list of predefined regions (see "list" option) or a variable region can be selected:
Enter the region: 40,-105,1.4
The values represent the central latitude, longitude and the scale size of the plot (1 is appropriate for regional plots). A full plot domain value can be entered (see the plot_domain resource). - Forecast Time:
The programs that involve forecast data will have a forecast time menu.Forecast Time Menu 1: Initialized 14: 4.5 day 2: 6 hour 15: 5 day 3: 12 hour 16: 5.5 day 4: 18 hour 17: 6 day 5: 24 hour 18: 6.5 day 6: 30 hour 19: 7 day 7: 36 hour 20: 7.5 day 8: 42 hour 21: 8 day 9: 48 hour 22: 8.5 day 10: 60 hour 23: 9 day 11: 3 day 24: 9.5 day 12: 3.5 day 25: 10 day 13: 4 day 0: Back to previous menu -1: Exit program Enter the time:
There are several ways to specify the forecast time in addition to above menu values. You can specify a forecast time by using entering the time and its units:
init
- Initial time
anal
- analysis
12hr
- 12 hour forecast
2day
- 2 day forecast
4.5day
- 4 1/2 day forecast
For more information on the forecast time specification, see the time resource. - Level:
The programs that use upper air data either observational or forecasted, will have a level menu display (this replaces the region menu for simplicity).Vertical Level Menu 1: Sea level 12: 150 mb 2: Surface 13: 100 mb 3: 1000 mb 14: 70 mb 4: 925 mb 15: 50 mb 5: 850 mb 16: 30 mb 6: 700 mb 17: 20 mb 7: 500 mb 18: 10 mb 8: 400 mb 19: Tropopause 9: 300 mb 20: Max wind 10: 250 mb 21: Whole sounding 11: 200 mb 0: Back to previous menu -1: Exit program Enter the level:
The menu lists standard pressure levels but can be used to access other levels. You can specify a level not on the menu by just entering a value and the units:
sfc
- Surface level
sl
- Sea level
mwnd
- Maximum wind level
trop
- Tropopause level
430mb
- 430 mb level (pressure)
850-500mb
- 850-500 mb layer
310k
- 310 K potential temperature level (isentropic)
2000m
- 2000 meter level (height)
50m_ag
- 50 meters above ground
For more information on the level specification, see the level resource. - Variables:
Each program has a predefined set of parameters either defined within the program or through a variable file:Variable Menu 1: All Data 13: Cloud Cover 2: Temperature 14: Pressure Tendency 3: Dewpoint 15: 24 Hr Precip 4: Wind Direction 16: 24 Hr Maximum Temp 5: Wind Speed 17: 24 Hr Minimum Temp 6: Wind Gust 18: Snow Depth 7: Wind Barb 19: Wind Chill Temp 8: Sea Level Pressure 20: Heat Index 9: Altimeter Setting 21: Relative Humidity 10: Present Weather 22: Equiv Potential Temp 11: Visibility 23: Convergence 12: Cloud Ceiling 24: Rel Vorticity 0: Return to previous menu -1: Exit program Enter the variable:
This menu only lists a small subset of what WXP can calculate. Again, you can list the resource values with the "?" but this will only list those values enabled in the menu. If you want all the available values, you can use the "list" command. You can also create your own variables and modify existing ones. A simple example of this is changing the units of a variable. For example, temperature on surface plots is plotted in Fahrenheit. To change it to Celsius, just put the desired units after the variable separated by a colon ":":
Enter the variable: temp:C
- Contour interval:
To display gridded data, the user will be prompted for the contour interval:Contouring data for 500 mb Temperature (C) Maximum value: -6.519228 Minimum value: -39.089241 Enter the contour interval:
The maximum and minimum values of the grid are displayed in order for the user to select a decent interval. A rule of thumb is to pick a contour interval that is 1/16th the range from the maximum to the minimum. If the user wished the program to select an appropriate interval, enter "0".
- Plot type:
The type of plot is normally predefined. Plotting programs will plot the data by default. Grid programs have several possibilities for output plot type.Color fill (C) or Line (L) contours: Vectors (V) or Streamlines (S):
The first prompt will appear for the scalar grid fields asking whether the contours are to be regular line contours or filled contours. The second appears when vector fields are to be plotted. The plot selection is either arrowed vectors at each grid point or streamlines. Any of the plot type values can be entered (see the plot_type resource)
- Device:
The output device specifies whether the plotted information will appear in a window on the screen or spooled to the printer.
Display (D) or Postscript (P):
In general, the output will be displayed in a window so "d" will be selected. If printed output is necessary, select "p" for postscript. The output will either go to a file or spooled to a printer as specified by the wxpps_print or wxphp_out environment variables.
- File parameter:
In some cases, the program will produce output files. This is true of decoders. If the output file exists, whether it be a decoded file, a raw file or a grid file, the program will prompt you as to whether you want to overwrite the file, append to the file or to use the existing file in which the program normally exits./home/wxp/convert/97030514_sao.wxp: exists overwrite (Y,N,Use,Over,App):
The value "y" is the same as "Over" or overwrite the file. The value "n" is the same as "Use" which uses the existing file.
Last updated July 21, 1998