Updates to "Configuring WarnGen to Include Interstate Mile Marker Locations in Warnings"

Updates to "Configuring WarnGen to Include Interstate Mile Marker Locations in Warnings"

(Doug Speheger, National Weather Service, Norman, OK)

In subsequent experimenting after publishing the Technical Attachment "Configuring WarnGen to Include Interstate Mile Marker Locations in Warnings" (NWS Southern Region Technical Attachment SR SSD-2004-06 8/2004), I have found ways to do things with Warngen templates where I had not previously had success. This describes a couple of these items.

Sections below include:

A. Having a minimum range of interstate mile markers before producing output
B. Inclusion of states in the text for interstates, if needed
C. Specific instructions on adding mile markers to the D2D display
Example of my warngen template

A. Having a minimum range of interstate mile markers before producing output.

One issue with my original methodology that I did not like (but had not known how to fix) was that the template would produce output including a range of mile markers if as few as two mile markers were in the warning polygon. This would lead to potentially undesired results such as "THIS INCLUDES INTERSTATE 40 BETWEEN MILE MARKERS 15 AND 16" in cases where the warning polygon accidentally clipped a small section of an interstate. The following describes how this is now circumvented...

Original template entry
<AREA |file=i35mm |area=wwa_counties
         |output_field=1 |sort_by=[0]
         |item_format=[2101][2701] |trail=.
         |lead=THIS INCLUDES INTERSTATE 35 BETWEEN MILE MARKERS~>

New template entry (replace the original template entry with both of the following entries) Explanation
<AREA |file=i35mm |area=wwa_counties
      |output_field=1 |sort_by=[0]
      |item_format=[2101][2701] |trail=.
      |var=mm35range>
1. This section is similar to the original template entry, except (a) it does not include the lead phrase, and (b) the output is assigned to a variable (in this case "mm35range") instead of the warning output text.
<AREA |file=i35mm |area=wwa_counties |min_count=5
      |output_field=1 |format=blank
      |lead=THIS INCLUDES INTERSTATE 35 BETWEEN MILE MARKERS $$mm35range!>

2. Here is where we set a minimum range before the output is actually written to the warning text. Again, this is similar, except we are checking for a minimum number of entries in the i35mm gelt by using the |min_count=5 test. In addition, the |format=blank will not have this test produce any output itself. But if the |min_count=5 test passes (if there are at least 5 mile markers within the warning polygon), then we can use the variable we set up in the other section to produce the output that we assigned to the mm35range variable in the first step. The number in |min_count=5 can be changed to whatever number you want for a minimum range.

Notes:

  • The |min_count=5 tests the number of entries from the gelt file that was created, not the actual range of miles in the warning polygon. These counts will be the same in cases where there is an entry in the gelt for every mile marker. But in cases where you are using only a selected number of mile markers (for example, only those at interchanges), this will not be a good test. For example, if your gelt only has coordinates for mile markers 1, 7 and 20, and the warning polygon includes this entire range, the |min_count test will see that there are only three entries in the gelt in the polygon, and will not produce output.
  • This apparently has to be done in two steps. If we use the |min_count=5 as a test in the original template entry, it will test the count after the item_format gives the text of the range. Thus, since the range is already produced, the count used by |min_count will only see two entries (one entry for the beginning of the range, and the other entry for the end of the range).

    B. Inclusion of states in the text (but only if a warning includes more than one state)

    I wanted to develop a way to include the state that the interstate is in for cases where it could cause confusion. But I did not want to have it output the states if the warning section is nowhere near a state boundary. For example, I wanted to include "INTERSTATE 44 IN OKLAHOMA..." or "INTERSTATE 44 IN TEXAS..." to differentiate the two states if needed to avoid confusion. I did this by adding the state only if the warning covered more than one state.

    Original template entry
    <AREA |file=i44mm |area=wwa_counties
             |output_field=1 |sort_by=[0]
             |item_format=[2101][2701] |trail=.
             |lead=THIS INCLUDES INTERSTATE 44 BETWEEN MILE MARKERS~>
    

    New template entry (replace the original template entry with all of the following) Explanation
    <AREA |file=wwa_counties |item_format=[2,state] |min_count=2 |format=blank
          |lead=IN OKLAHOMA |var=inokla >
    
    <AREA |file=wwa_counties |item_format=[2,state] |min_count=2 |format=blank
          |lead=IN TEXAS |var=intex >
    
    
    1. These sections check if the warning will be for one state or two. The |item_format=[2,state] will produce a list of states that are affected by the warning polygon. The |min_count=2 will match only if there are two or more states. I don't actually use the output from this test (so I use the |format=blank ), but use this test to assign the variables "inokla" and "intex" if there are two or more states in the warning polygon. If the |min_count=2 test does not match (there is only one state in this warning), the "inokla" and "intex" variable remain blank.
    <AREA |file=i44mm |area=wwa_counties
          |output_field=1 |sort_by=[0]
          |item_format=[2101][2701] |trail=.
          |var=mm44range>
    
    <AREA |file=i44txmm |area=wwa_counties
          |output_field=1 |sort_by=[0]
          |item_format=[2101][2701] |trail=.
          |var=mm44tx_range>
    
    
    2. The mile marker range section as described in section A above.
    <AREA |file=i44mm |area=wwa_counties |min_count=5
          |output_field=1 |format=blank
          |lead=THIS INCLUDES INTERSTATE 44 $$inokla! BETWEEN MILE MARKERS $$mm44range!>
    
    <AREA |file=i44txmm |area=wwa_counties |min_count=5
          |output_field=1 |format=blank
          |lead=THIS INCLUDES INTERSTATE 44 $$intex! BETWEEN MILE MARKERS $$mm44tx_range!>
    
    
    3. The only addition here to section 'A' is the addition of the "inokla" and "intex" variables defined from step 1. If "inokla" and "intex" are defined from step 1, the output will say "THIS INCLUDES INTERSTATE 44 IN OKLAHOMA BETWEEN MILE MARKERS..." and the same for Texas. If the warning is for only one state and the "inokla" and "intex" variables were not defined in step 1, the output will say "THIS INCLUDES INTERSTATE 44 BETWEEN MILE MARKERS..." without the state mentioned.
    Notes:

  • This process will test for if the warning includes any part of more than one state, not whether the interstate is affected in more than one state. This is still probably a good thing since some travelers may not be familiar enough with county and city names to know the difference if they are on an interstate near a state boundary.
  • If you wanted to include the state names in the output near the state border even if only one state is affected, you might be able to test for a specific county or a specific section of the state in step 1 as opposed to the test of a multiple-state warning that I described.

    C. Adding mile markers to the D2D display

    The original technical attachment refers to AWIPS Technical Note (ATN) "Installing and Displaying Urban Map Backgrounds on AWIPS" from Eastern Region by Josh Watson . Since publication of my Technical Attachment, I have found that this ATN has been updated once or twice, and was difficult to find on the internet. So, I am including the following instructions for adding mile markers to D2D, adapted from the Watson ATN (primarily the 2002 version).

    1. Create an .lpi file

    This file will be placed in the /awips/fxa/nationalData directory and have a similar format to other .lpi files in that directory. A sample would be:

    36.1699 -95.2488 2 1
    36.1767 -95.2334 2 2
    36.1818 -95.2173 2 3
    36.1839 -95.2000 2 4
    36.1849 -95.1826 10 5
    
    The name should have an .lpi extension. The name I used was interMkrs.lpi . You will use this name in Step 7 below.

    The first two numbers are the latitude and longitude. The third number is the "goodness" number to aid the progressive disclosure on the D2D display, and the fourth is the label that is displayed on D2D (in this case, the mile marker number).

    It may take some trial-and-error to figure out what goodness values to use to prevent cluttering the display. The method I use is to assign a goodness value of "25" at intervals of 20 (mile markers 20, 40, 60, 80, etc.), "15" for others at intervals of 10 (mile markers 10, 30, 50, 70, etc.), "10" for others at intervals of 5 (mile markers 5, 15, 25, 35, 45, etc.), and "2" for all others.

    2. Choose a product button number.

    You will need to pick an unused product button number between 1000 and 1999 for the mile marker background. For this example, the product button number is 1259. Once you choose a number, you will need to check the following files to make sure that particular number is not being used for another product. Use

    cat | grep your_product_button_number_choice

    In /data/fxa/nationalData/:
    productButtonInfo.txt
    dataInfo.manual
    depictInfo.manual
    backgroundMenus.txt
    
    In /awips/fxa/data/localization/XYZ/: (if the files exist)
    XYZ-localProductButtons.txt
    XYZ-localDataKeys.txt
    XYZ-localDepictKeys.txt
    XYZ-otherBackgroundMenus.txt
    
    In /data/fxa/customFiles/: (if the files exist)
    localProductButtons.txt
    localDataKeys.txt
    localDepictKeys.txt
    otherBackgroundMenus.txt
    
    For the steps below, the files are assumed to exist in the /data/fxa/customFiles directory.

    3. Change to the /data/fxa/customFiles directory on the workstation.

    4. Make backup copies of the following four files, if they exist. If they do not exist, they will need to be created:

    localProductButtons.txt
    localDepictKeys.txt
    localDataKeys.txt
    otherBackgroundMenus.txt
    
    5. Edit localProductButtons.txt and add the following line to the bottom of the file:

    1259 | <3000, 1259 |Interstate Mile Mkrs |Interstate Mile Mkrs| 1
    
    This sets the product button for the mile marker display and enables it to display on the WFO, state and regional scales. However, depending on the goodness numbers you used in the .lpi file, you may need to zoom in from the default regional scale before they appear.

    6. Edit localDepictKeys.txt and add the following line to the bottom of the file:

    1259 |5 |1259 | | |1 |Interstate Mile Mkrs |Interstate Mile |1 |1 |1 |
    
    This sets the depict key for the mile marker display, using the same number as the product button (in this case 1259).

    7. Edit localDataKeys.txt and add the following line to the bottom of the file:

    1259 | | | | | | |NAME |filename |.lpi|Mile Markers
    
    This defines the .lpi file that goes with the depict key defined in localDepictKeys.txt. NAME should be the name displayed when the map is turned on in D2D. filename should be whatever you named the file in Step #1 (in my case, interMkrs). This is the step (Step 12 in Watson) that was referred to in my original technical attachment.

    8. Edit otherBackgroundMenus.txt and add the following line to the bottom of the file:

    productButton: 1259 # Mile Markers
    
    This adds the mile markers selection to the "Maps" drop-down menu.

    9. Run mainScript with the -tables and -maps options.

    /awips/fxa/data/localization/scripts/mainScript.csh f -tables -maps
    

    10. Start D2D, change the main display window to the WFO or state scale and load the mile marker map from the maps pull-down menu.

    11. If the mile marker map appears, repeat Step 9 on each lx workstation.


    The complete mile marker range section from my template

    Incorporating all of the above, the interstate mile marker range section of my templates now is the following:
    
    { ^ interstate mile markers |
    
    <AREA |file=i35mm |area=wwa_counties
          |output_field=1 |sort_by=[0]
          |item_format=[2101][2701] |trail=.
          |var=mm35range>
    
    <AREA |file=i35mm |area=wwa_counties |min_count=5
          |output_field=1 |format=blank
          |lead=THIS INCLUDES INTERSTATE 35 BETWEEN MILE MARKERS $$mm35range!>
    
    <AREA |file=i40mm |area=wwa_counties
          |output_field=1 |sort_by=[0]
          |item_format=[2101][2701] |trail=.
          |var=mm40range>
    
    <AREA |file=i40mm |area=wwa_counties |min_count=5
          |output_field=1 |format=blank
          |lead=THIS INCLUDES INTERSTATE 40 BETWEEN MILE MARKERS $$mm40range!>
    
    <AREA |file=wwa_counties |item_format=[2,state] |min_count=2 |format=blank
          |lead=IN OKLAHOMA |var=inokla>
    
    <AREA |file=wwa_counties |item_format=[2,state] |min_count=2 |format=blank
          |lead=IN TEXAS |var=intex>
    
    <AREA |file=i44mm |area=wwa_counties
          |output_field=1 |sort_by=[0]
          |item_format=[2101][2701] |trail=.
          |var=mm44range>
    
    <AREA |file=i44mm |area=wwa_counties |min_count=5
          |output_field=1 |format=blank
          |lead=THIS INCLUDES INTERSTATE 44 $$inokla! BETWEEN MILE MARKERS $$mm44range!>
    
    <AREA |file=i44txmm |area=wwa_counties
          |output_field=1 |sort_by=[0]
          |item_format=[2101][2701] |trail=.
          |var=mm44tx_range>
    
    <AREA |file=i44txmm |area=wwa_counties |min_count=5
          |output_field=1 |format=blank
          |lead=THIS INCLUDES INTERSTATE 44 $$intex! BETWEEN MILE MARKERS $$mm44tx_range!>
    
    }