Databases
WXP uses several database files to locate data, draw maps, describe text fonts, etc. These are mostly ASCII files that may be changed, updated or even created by the user. These files are all located in the directory pointed to by the file_path resource.
The types of databases are denoted by the file name extension for each file:
Extension | Type | Resource |
---|---|---|
.cnv | Name convention files | name_conv |
.prd | Product files | prod_file |
.cty | city database files | city_file |
.map | map files | map_file |
.mpl | map listing files | map_file |
.mdb | map database files | |
.raw | raw file database files | |
.clr | color table files | color_table |
.cfl | color fill files | color_fill |
.enh | satellite enhancement files | color_fill |
.var | variable files | var_file |
.reg | region file | plot_domain |
.smb | symbol files | |
.lup | lookup files | |
.fnl | font list files | font_list |
.fnt | font files |
Name Convention Files (.cnv)
Name convention files are used by most WXP programs to determine the file names each program will either read or create. The default name convention file is "name.cnv" but this can be changed with the name_conv resource. Each line in the file specifies a name convention.; Each convention has a tag along with a file name specification.
tag filename [headerfilename] [format] [params]
# # Surface SAO/METAR data # sfc_dat %D/%y%m%d%h_sao.wmo sfc_xml %C/%y%m%d%h_sao.xml - xml sfc_cdf %C/%y%m%d%h_sao.cdf - cdf sfc_cvt %C/%y%m%d%h_sao.wxp - wxp min=60 # # RCM radar data # rcm_dat %D/%y%m%d%h%30n_rcm.wmo - wmo rcm_cvt %C/%y%m%d%h%30n_rcm.wxp - rcm min=60 # # Upper air data # upa_dat %D/%y%m%d%12h_upa.wmo - wmo upa_cvt %C/%y%m%d%12h_upa.wxp - wxp # # NOAAPORT Satellite data # sat_vis_ec %S/%y%m%d%h%15n_gecvi.sat - giniz min=45,size=12000000 sat_ir_ec %S/%y%m%d%h%15n_geci11.sat - giniz min=45,size=850000 # # GRIB data # grib_nam2 %M/%y%m%d%6h_nam2.grb %M/%y%m%d%6h_nam2.hdr grib min=420 grib_nam5 %M/%y%m%d%6h_nam5.grb %M/%y%m%d%6h_nam5.hdr grib min=420 grib_nam %M/%y%m%d%6h_nam.grb %M/%y%m%d%6h_nam.hdr grib min=420 # # NIDS data # nids %{nids_path}/%i/%y%m%d%h%n_%t.nid - nids min=12
Product Files (.prd)
Product files are used by the ingest program "wmoingest" to select products to save and specify what files the selected products are saved in. The default bulletin file is "ingest.prd" but this can be changed using the prod_file resource. Each line in the file specifies a pattern to match a specific WMO product header or a set of products. After the pattern is the action to be performed on the product including overwrite ">", append ">>", pipe "|" to a program, etc. The final parameters on the line are the filenames or program to run. The filename can contain the same type of wildcard characters allowed in the filename convention. If a second filename is listed, this will be a header file which contains a line of each product with the byte offset into the main file (first filename listed).
############################################################# # PAN Messages (optional) # specific destination of PAN @PAN id=46 sock:localhost:5000 ############################################################# # Pattern Action Filename Header Filename # S[AP] >>-15 %D/data/%y%m%d%h_sao.wmo S[IMNS] >>-05 %D/data/%y%m%d%h_syn.wmo SD..4[0123456]_KWBC >>+07 %D/data/%y%m%d%h_rad.wmo SD..99 B>>+05 %D/data/%y%m%d%h%30n_rcm.wmo SD..4 UB>>+05 %D/data/%y%m%d%h%30n_rcm.wmo HAXA00 PB>> %D/data/%y%m%d%h%30n_rcm.grb SD..[234578] PB> %D/nids/%46E/%py%pm%pd%ph%pn_%13e.nid SXUS2[0123] >> %D/data/%y%m%d%h_cman.wmo U[^AB] >>-65 %D/data/%y%m%d%12h_upa.wmo ASUS01 P>> %D/data/%y%m%d%3h_frt.wmo FSUS02 | %{scripts_path}/reform_frf - %Y%m%d%h%n WWUS40 P>> %D/data/%y%m%d%6h_wws.wmo WWUS30_KWNS P>> %D/data/%y%m%d%6h_wws.wmo FO P>> %D/data/%py%pm%pd%ph_mod.wmo %D/data/%py%pm%pd%ph_mod.hdr # # NAM # /M84G211 P>> %D/model/%py%pm%pd%ph_nam.grb %D/model/%py%pm%pd%ph_nam.hdr /M84G207 P>> %D/model/%py%pm%pd%ph_namk.grb %D/model/%py%pm%pd%ph_namk.hdr /M84G301226112 P>> %D/model/%py%pm%pd%ph_nam5.grb %D/model/%py%pm%pd%ph_nam5.hdr /M84G203185511 P>> %D/model/%py%pm%pd%ph_namk5.grb %D/model/%py%pm%pd%ph_namk5.hdr
Other parameters can be specified such as the delivery of PAN (Product Arrival Notifications), whether to save the data as binary and time offsets to use on file naming.
City Databases (.cty)
City database files are used to locate reporting stations. The data included are the name of the station, the location by country and state/province, the ID of the station (3 to 5 letters), the priority of the station, the latitude and longitude, elevation, and WMO numeric ID. A sample of this type of file is:
Abeche -- CD FTTC 9 13.85 20.85 545 64756 Aberdeen/Dyce -- UK EGPD 3 57.20 -2.22 65 03091 Aberdeen_Region SD US KABR 3 45.45 -98.43 396 72659 Aberporth -- UK EGUC 9 52.13 -4.57 133 03502 Abha -- SD OEAB 5 18.23 42.65 2084 41112
These files are available for surface, upper air, radar, MOS and SHEF reporting stations. Some of these files are region specific such as for Europe and South America. The city database may be specified with the city_file resource.
Database | Type of Stations | Location |
---|---|---|
sao.cty | Surface SAO/METAR | Global |
upa.cty | Upper air | Global |
syn.cty | Surface Synoptic | Global |
rad.cty | NEXRAD Radar | United States |
mos.cty | Model Output | North America |
Map Databases (.map)
Map outline databases contain a list of latitude longitude points that delimit continental, political and other geographical outlines. These files are either in an ASCII or binary format. The binary format, even though not editable, draws 4-8 times faster than the ASCII files. A sample from the ASCII version of wxp.map file is:
24 49.00 45.55 -116.92 -124.75 1 48.15 -123.70 48.35 -124.75 47.90 -124.62 47.00 -124.18 46.28 -124.00 46.17 -123.15 46.08 -122.90 45.65 -122.77 45.55 -122.25 45.70 -121.80 45.65 -121.17 46.00 -119.00 46.00 -116.92 46.40 -117.00 49.00 -117.65 49.00 -120.00 49.00 -122.75 48.60 -122.42 48.00 -122.20 47.30 -122.30 47.35 -122.55 47.80 -122.50 48.12 -122.77 48.15 -123.70 14 46.28 42.00 -116.50 -124.55 2 46.00 -116.92 45.60 -116.50 44.48 -117.20 44.30 -117.20 44.15 -116.90 43.80 -117.00 42.00 -117.00 42.00 -120.00 42.00 -122.00 42.00 -124.20 42.83 -124.55 44.00 -124.15 45.00 -124.00 46.28 -124.00 19 49.00 42.00 -111.05 -117.00 3 49.00 -117.00 49.00 -116.05 48.00 -116.05 47.70 -115.75 47.45 -115.75
The database is also broken into line segments that are drawn separately. By default, all programs use the wxp.map file. If the plot domain center point is outside of a range 25 to 80 North and 65 to 160 West, the cont.map and country.map maps will be used. The map database files may be specified with the map_file resource.
For large map databases, it is recommended to use a binary version of the file. The DLG (Digital Line Graph) maps from the USGS are in this format.
Database | Coverage | Resolution | Outlines |
---|---|---|---|
wxp.map | Global | medium | Continental, country, state |
cont.map | Global | low | Continental |
wxp/*.map | Global | medium | Continental, country, state broken down by type |
dlg08/*.map | United States | high | Reworked DLG80 dataset with continental, state, roads, rivers broken down by type |
noamer/*.map | North America | high | Digital Chart of the world dataset with continental, state, roads, rivers broken down by type |
zones.map | United States | high | Forecast zones |
Map Lists (.mpl)
These are files that contain a list of files to be used to plot base maps for plots. Complex map specifications cannot be listed on the command line. A map list file allows for very complex maps to be drawn, toggles maps on and off based on domain size and allows for map underlays and overlays. These are specified through the map_file resource. A file ending in .mpl is assumed to be a map list file. Here is a sample file:
-us_map_dark.gif >10:maps/wxp.map <10:maps/wxp-coast-us.map <10:maps/wxp-island-us.map <10:maps/wxp-cntry-us.map <10:maps/wxp-lake-us.map <10:maps/wxp-canada-prov.map <10:dlg08/cnty.map[red] <10:dlg08/nation.map[lred] <10:dlg08/state.map[lred] <10:dlg08/coast.map[lred] <2:dlg08/rd_state.map[dgray] <3:dlg08/rd_us.map[#808080] <10:dlg08/rd_int.map[brown] <3:rf:counties.raw-Name[co=cyan:te=.75]
The "<10" prefix is a toggle to show when the map is to be drawn. The size is vertical size of the domain in hundreds of kms. Plotting parameters can also be specified such as map color "[lred]". Raw files and images can also be specified. For example, when the domain gets small, county labels will be added. Underlay images can be specified by listing the image filename preceded with a "-". The image must be navigable. Background colors can be specified with a "bg:colorname".
Some map lists provided with WXP are:
Database | Contents |
---|---|
cnty.mpl | Conditional maps where wxp.map draws at large scales and DLG maps draw at small scale. |
Map Database Files (.mdb)
Each segment in a map file has no description associated with it. To know what each segment is, there is a map database file. These are simple files that include a segment index (matches the index in the map file), a byte offset to the segment and a segment description. An example is:
IND LOC NAME
0 0 MO-AO
1 150 MO-Med
2 292 AL-Med
3 610 Tun-Med
4 888 LI-Med
5 1254 EG-Med
...
856 218976 CT-AO
857 219182 CT-MA
858 219308 CT-RI
859 219402 MA-AO
860 220368 MA-Isl1
861 220494 MA-Isl2
862 220604 MA-NH
863 220778 MA-VT
864 220832 ME-AO
For example, segment #856 is the line that separates Connecticut and the Atlantic Ocean. Segments 860 and 861 are two islands that belong to Massachusetts.
Raw Databases (.raw)
There are several databases in WXP Raw file format that can be used to plot information using the raw data plotting program rawplot. These files contain ASCII tabular data that can be modified with respect to NWS changes.
Database | Contents |
---|---|
cities.raw | City location, zones, FIPS, WFOs, population |
counties.raw | County location, zone, FIPS, WFOs, size |
zones.raw | Forecast zones location, FIPS, WFOs |
Color Tables (.clr)
Color table files are to be used to specify which colors are going to be used within in the program. The graphics program allocates (locks in) all the colors listed in the file. Each graphics program has color resources to specify and change colors of various components of the plot. Color table files are ASCII files that list a color name along with its RGB (red, green, blue) color values:
Black 0.0 0.0 0.0 White 1.0 1.0 1.0 Red 0.7 0.0 0.0 Green 0.0 0.7 0.0 Blue 0.0 0.0 0.7 Yellow 1.0 1.0 0.3 Cyan 0.0 0.7 0.7 Magenta 0.7 0.0 0.7 DGray 0.3 0.3 0.3 LGray 0.7 0.7 0.7 LRed 1.0 0.3 0.3 LGreen 0.3 1.0 0.3 LBlue 0.3 0.3 1.0 Brown 0.7 0.7 0.0 LCyan 0.3 1.0 1.0 LMagenta 1.0 0.3 1.0
An optional "End" keyword can be placed on a line. This will trigger the contouring function to use all the colors up to that line in the color fill contours.
Several color table files are provided with WXP:
Color Table | Description |
---|---|
wxp.clr | Default color table (16 colors) |
sat.clr | Satellite color table with 50 gray shades |
rainbow4.clr | A rainbow scheme with 92 colors |
radar.clr | Radar image color table |
gray25.clr | 25 gray shades |
gray200.clr | 200 gray shades |
Color Fill Files (.cfl)
Color fill files are used to specify which colors are to be used in color fill contours. Often these are used if the list of colors and attributes becomes too large to fit on the command line. Color fill files are also used to specify:
- contour values which can be used for contours with an irregular interval
- attributes define how the contours will look
Each line in the file has the following syntax:
[value:]color[:attributes...]
This file can be used with color fill and line contours. For color fills, the attributes will change the fill patterns. For line contours, the attributes can change the line styles. If the color_cont resource is set to "off", then the colors of the line contours are those specified in the file. Here is a sample file:
@name Prec[in] .01:DDMagenta .05:DMagenta .1:MMagenta .175:BMagenta .25:Blue .375:LBlue .5:Green .75:LGreen 1:Brown 1.5:Yellow 2:Red 3:Lred 4:LGray
This sets up colors for precipitation data. The @name parameter is used to name the fill sequence. If a color bar is plotted, this name will be plotted next to the bar.
brown brown:st=dot brown:st=dot brown:st=dot brown:st=dot
This sets up a rotating set of colors for line contours where every 5th line is solid brown and the others are dotted lines.
Satellite Enhancement Files (.enh)
Satellite enhancement files are used to modify or enhance the satellite images in the satplot program. These files are virtually identical to the color fill files except that pixel values can be IR Celsius temperatures or raw pixel values (0-255), and color ranges can be specified.
Here is a sample enhancement file:
@name MB Enh[C] @value 57:black 29:gray1 gray2-gray19 6:gray20 gray21-gray31 -31:gray32 -32:Cyan1 ... -79:Yellow2 -81:Yellow3 -84:Yellow4 -86:Yellow5 -88:Yellow6 -90:black
The example shows the differences to the color fill file. Color ranges are specified as two colors separated by a dash "gray2-gray19". This will set up a range of colors equally spaced between the prior value (29) and the following value (6). The other is the @value setup. The default for enhancement is to use the pixel value (0-255) for the values. But IR satellite images are valued based on temperature. So the user could use temperatures in C. So specifying @value treats the numbers on each line as temperature values in C and not pixel values.
Variable Files (.var)
Variable files define how variables are to be used and plotted in the graphics programs. Each graphics program has its own variable file which is named for the program, unless otherwise specified. For example, the sfcplot program has a sfcplot.var file. Each line in the variable file defines a specific variable such as:
temp Temperature 1 +temp [F,%.1f]
The first parameter is the variable name that is used with the variable resource to specify which variable to plot. The second parameter is a descriptive label that can be used in a menu listing (not used in WXP 6). The third parameter is a flag value (unused in WXP 6). The final parameter is the variable definition which lists the variable to plot including time and level along with any attributes (%.1f plots data to tenths) including its units (degrees F).
The variable file can contain derived variables such as temperature advection:
tadv Temperature_Advection 0 adv-tadv(wind,temp[K]) [10^-4_K/s]
The function is "adv" which computes advection. The "-tadv" is for labeling the output. It would show "Advection" otherwise. The function takes three parameters: U wind, V wind and temperature. The U and V wind are specified by the "wind" parameter which is defined as a vector elsewhere in the var file. The "[10^-4_K/s]" is the output units including scale factor.
Composite plots which contain overlays can be specified:
depict Weather_Depiction 0 fr [,cf,lab=0,cof=depict.cfl],\ map,\ :sfc:depict{\ cldcv [,cloud,co=white],\ cldcl [100ft,lc],\ wx [,wx,cl,co=yellow]}
This shows two plots. The first is "fr" which plots flight rules as a color fill contour using the depict.cfl color fill specification. The overlay is "depict". This is actually a group of three separate plots: cloud cover, cloud ceiling and present weather. But the label on the plot will only show "Surface Weather depiction". Without the grouping, the labeling will show 4 plots. Grouping just simplifies this. Finally, the "map" specification tells the program when to plot the map. The default plots a map underlay unless a color fill contour is specified and then it becomes an overlay. If this is not desired, add the "map" line to tell the program when to plot the map.
Multipanel plots can also be specified:
thk 1000-500_mb_thickness le=snd :p1000-500:thick (:500mb:hght[m],:1000mb:hght[m]) [m] cpres Composite_Surface 1 Sfc_Prec/SLPres/1000-500mb_Thick{\ map [under],\ prec6 [in,cf,cof=prec.cfl,bar],\ map ,\ slp [mb,ln,co=lcyan,ci=4],\ thk [m ,ln,cof=thick.cfl,co=off,lab=0,cb=5400,ci=60]} c4_pres Composite_4_panel 0 panel [.5x.5+0+0],\ 36hr::cpres,\ panel [.5x.5+.5+0],\ 48hr::cpres,\ panel [.5x.5+0+.5],\ 12hr::cpres,\ panel [.5x.5+.5+.5],\ 24hr::cpres
The base plot is "cpres". This creates an overlay of precipitation, sea level pressure and thickness. The thickness "thk" is specified as 1000-500mb thickness, defined in another line in the variable file. The composite 4 panel plot uses the "panel" specification to determine where on the screen the plot will be placed (.5x.5 is the size and +0+0 is the location).
Region Files (.reg)
Region file can be created to alias plot domain specifications. ;This default region file is wxp.reg. New regions can be added to this file. Here is an example line from the file:
us Contiguous_US 1 39,-97,2.3 ... ne New_England 1 42,-76,.9 at Atlantic 1 37,-82,.9 se Southeastern 1 31,-88,1.1 ... nhem North_Hemisphere 0 90,-90,25,25,8 shem South_Hemisphere 0 -90,-90,25,25,8 us02 US_2km 0 ps,38.5,-97,2800,2000,0.02,0.02 ... goefd GOESE_Full_Disk 0 sat:e:0:-75::1:,0.7,-74.9,1024,1024,0.1266,0.147 gowfd GOESW_Full_Disk 0 sat:e:0:-135::1:,.55,-134.6,1024,1024,0.1265,0.1475 mtsfd MTSat_Full_Disk 0 sat:e:0:140::1:,0,140,1024,1024,0.124,0.124
The alias is listed first, followed by a long name (all spaces must be underscores), followed by a menu toggle (unused in WXP 6) and finally the plot domain specification.
Font Files (.fnt)
Font files are vector based software fonts used by WXP. The default font is modern.fnt.
Font Files | Type | Style |
---|---|---|
modern.fnt | Modern | Normal |
modern_bold.fnt | Modern | Bold |
modern_ital.fnt | Modern | Italics |
roman.fnt | Roman | Normal |
roman_bold.fnt | Roman | Bold |
roman_ital.fnt | Roman | Italics |
gothic.fnt | Gothic | |
greek.fnt | Greek letters |
Font List File (.fnl)
Since font names can be quite long, a font list file is provided to create font aliases. This works much the same as listing the files with the font_list resource but that aliases for each font are also listed. Here is a sample font list file:
mod modern.fnt shelv #-adobe-helvetica-bold-r-normal-*-8-*-*-*-*-*-*-* helv #-adobe-helvetica-bold-r-normal-*-{24}-*-*-*-*-*-*-* mhelv #-adobe-helvetica-bold-r-normal-*-12-*-*-*-*-*-*-* lhelv #-adobe-helvetica-bold-r-normal-*-18-*-*-*-*-*-*-* courier #-adobe-courier-bold-r-normal-*-{24}-*-*-*-*-*-*-* cour18 #-adobe-courier-bold-r-normal-*-*-180-*-*-m-*-iso8859-* school #-adobe-new century schoolbook-bold-r-normal-*-12-*-*-*-*-*-*-* utopia #-adobe-utopia-bold-r-normal-*-{24}-*-*-*-*-*-*-* nimbus #-urw-nimbus sans l-bold-r-*-*-{24}-*-*-*-*-*-*-*
The alias is listed first and the actual font name is listed next. If the font is preceded with a "#", it is a system font and not a WXP vector font. The first font listed is a WXP font. The rest are X11 fonts. System fonts are generally fixed and won't scale as the window is enlarged. But using the "{24}" specification for the size will allow these fonts to scale. The font has to be a scalable font or text will often not plot. The value is the default value so scaling is relative to that number. System fonts are not printable. To specify a font, use the color resource: "-cot=white:fo=nimbus" or the plot parameter "-pa=font:helv". The default font list file is "wxp.fnl" which will be used if it exists. Otherwise, WXP will use the "modern.fnt" file or the fonts listed in the font_list resource.
Symbol Files (.smb)
Symbols files are used to plot various symbols that cannot be plotted with the text fonts. This is especially handy for weather symbols. The symbol file contains a set of symbols defined by a simple character string such as "RW-". Following the string is a set of X,Y points which describe the symbol. An example is:
T .7,.8 .4,.5 .7,.2 .5,.2 L .7,.2 .7,.4 L $ RW- .4,.7 .5,.7 .5,.6 .4,.6 .4,.7 L .3,.5 .6,.5 .45,.2 .3,.5 L $ RW+ .4,.7 .5,.7 .5,.6 .4,.6 .4,.7 L .3,.5 .6,.5 .45,.2 .3,.5 L .35,.4 .55,.4 L $ RW .4,.7 .5,.7 .5,.6 .4,.6 .4,.7 L .3,.5 .6,.5 .45,.2 .3,.5 L .35,.4 .55,.4 L $ R+ .2,.6 .3,.6 .3,.5 .2,.5 .2,.6 L .6,.6 .7,.6 .7,.5 .6,.5 .6,.6 L .4,.8 .5,.8 .5,.7 .4,.7 .4,.8 L .4,.4 .5,.4 .5,.3 .4,.3 .4,.4 L $
WXP comes with several predefined symbol files:
Symbol File | Description |
---|---|
wx.smb | Standard weather symbols (SAO format) |
pwx.smb | Synoptic present weather symbols |
ptend.smb | Pressure tendency symbols |
cl.smb | Low cloud symbols |
cm.smb | Middle cloud symbols |
ch.smb | High cloud symbols |
sev.smb | Severe weather symbols |
Lookup Files (.lup)
There are several lookup files associated with WXP. These files provide general types of information not contained in any of the above file types. Each file has a different format which is explained is the appropriate sections:
Lookup File | Description |
---|---|
model.lup | This file defines the model types used in WXP. A model run is often comprised of several types of grids. This file associates a model type as specified with the model resource with a set of file types as specified as name convention tags. If more than one tag or file type is specified, these grids will be pieced together. |
mod_name.lup | This file associates a particular model number form the GRIB code with a character string that is inserted into the plot label. |
units.lup | This file lists conversion factors between various units. |
variable.lup | This file associates particular variable numbers as listed in the GRIB products with a character string that will be used in the plot label. |
Updated January 2021