Focal Point Winter Weather Jobsheets

Change Impact Thresholds and Phrasing

Purpose:

This jobsheet covers the basic steps for changing impact thresholds and their associated impact phrasing, specifically for snow amounts, which can be easily applied to other weather elements as well.

Tasks:

AT-A-GLANCE:

  • What? Change the simple threshold values assigned within the snowImpactThresholds method (or any similar method), in an override of LocalVariables.py
  • Location Dependence. Optionally configure other logic in this method, such as zones for which the thresholds differ, to have more dynamic snow impacts in your products.

Follow the steps below for more detailed guidance.

*** OTHER CONFIGURATIONS WITH IDENTICAL WORKFLOW *** The methodology in this jobsheet can be very closely mirrored for any setting in LocalVariables.py which also assigns or returns basic values (e.g. other ImpactThresholds or Threshold methods, and even the lineLength method).

 

  1. [OPTIONAL] Create a hazard for your area to preview the current effect of your thresholds on the impact statements (you will need real or test data for this step)
    1. Launch Hazard Services in the GFE perspective with the Winter Settings file
    2. Draw a hazard in an area with snow totals you plan to use in testing thresholds, using the freehand polygon or other method
    3. Select a category (e.g. Winter) and hazard (e.g. BZ.W), then click "Preview" to generate a product
    4. Look in the "Impacts" text field for messaging corresponding to the snow amounts and current thresholds.  For example:
      1. sigSnow usually triggers a "Travel could be difficult to impossible" impact
      2. warning snow triggers "Travel could be very difficult"
      3. any measurable snow less than these should trigger "Plan on slippery road conditions"
  2. Switch to the Localization Perspective by clicking on the "Open Perspective" icon at the top-right of your CAVE window, and choosing "Localization"
  3. In the Localization Perspective, navigate to the Utilities sub-directory under the Hazard Services folder.
  4. Double click on LocalVariables.py to show the available versions
  5. Create a user override version if none exists (user override is best practice for testing changes):
    1. If there is only a BASE version: right click on BASE and select Create Override File, then select User
    2. If there is another version (e.g. SITE) you wish to use: right click on that file and select Copy To, then select User (this lets you work on an updated SITE version to replace the original when you're finished)
  6. Double click on the USER version of LocalVariables.py to open it for editing
  7. Open a reference copy of the existing LocalVariables.py file, which will be used for comparing to and copying existing code for overrides.
    1. It's typically best to open the BASE version because most methods have not already been overridden in a higher-level override
  8. In the reference file you opened, scroll or search to find the "snowImpactThresholds" method (whose first line appears as "def snowImpactThresholds(self, zones):" in LocalVariables.py)
  9. Once found, select the entire snowImpactThresholds method by clicking and dragging from (and including) the "def snowImpactThresholds(self, zones):" line which begins the function, all the way to (and including) the last line of the function which has the "return impactPhraseDict" statement.
  10. Copy the selected contents by right-clicking and selecting "Copy" from the pop-up menu, or by hitting CTRL-C on your keyboard
  11. Switch back to the USER override you were working on
  12. Paste the snowImpactThresholds method into your USER override on a blank line after the "class..." and "pass" lines (or after any pre-existing override methods in the file), by right-clicking and selecting "Paste" from the pop-up menu, or by hitting CTRL-V on your keyboard
  13. In the USER copy of the snowImpactThresholds method you just pasted in, locate the lines setting the wording for different thresholds, which appear as follows:
    impactPhraseDict = OrderedDict([
                (12, "Travel could be very difficult to impossible."),
                (6, "Travel could be very difficult."),
                (0, "Plan on slippery road conditions."),
            ])
    
            return impactPhraseDict
    
  14. Edit the values assigned to these thresholds to a value suitable for your CWA, by changing the numbers in the dictionary, as shown below (changes in bold):
    impactPhraseDict = OrderedDict([
                (10, "Travel could be very difficult to impossible."),
                (4, "Travel could be very difficult."),
                (0, "Plan on slippery road conditions."),
            ])
    
            return impactPhraseDict
  15. You can also add new wording thresholds suitable for your CWA:
    impactPhraseDict = OrderedDict([
                    (18, "Travel is not recommended as heavy snowfall and very low visibility will create extremely dangerous driving conditions."),
                    (12,"Significant snowfall and periods of heavy snowfall rates will combine with low visibility to create very dangerous driving conditions."),
                    (6, "Periods of moderate and heavy snow will combine with low visibility to create dangerous driving conditions."),
                    (0, "Even light snowfall amounts can accumulate on roads and cause dangerous driving conditions due to snow-covered roads."),
                ])
    
                return impactPhraseDict
    

     

  16. Make sure you've maintained proper indentation... the "def snowImpactThresholds" line should be indented one level more than the "class LocalVariables" line. If you need to fix your indentation, you can select the whole method, then press TAB to indent everything further, or SHIFT-TAB to remove one level of indentation for the entire selection
  17. When finished, save the file by hitting Ctrl+S, or selecting Save from the File menu
    1. If a "File Version Conflict" is encountered, click OK to accept merge
    2. In the two-panel "Merge" tab that opens, make no changes, once again save the file by hitting Ctrl+s, then close the "Merge" tab
    3. When a "File Changed" message appears,  click Yes.
    4. This behavior will only be encountered each time a new override file that did not exist before is created and saved
  18. [NO ACTION REQUIRED] Reflection: How is this used?
    1. Methods defining impact thresholds are usually called by a "getGridBasedImpacts" method in the WSW_PhraseMethods.py file, which compares forecast weather (e.g. snow) to these thresholds to determine the severity of impacts phrasing.
  19. [OPTIONAL, RECOMMENDED] Verify your thresholds are reflected by generating a product (you will need suitable real or test data in your grids for this to work)
    1. Return to GFE and create a BZ.W hazard over an area with snow amounts that should trigger your new thresholds
    2. Click Preview to generate a product
    3. Review the "Impacts" text for auto-generated impacts suitable to your thresholds. For example:
      1. sigSnow usually triggers a "Travel could be difficult to impossible" impact
      2. warning snow triggers "Travel could be very difficult"
      3. any measurable snow less than these should trigger "Plan on slippery road conditions​​​​​"
  20. [BONUS STEP] Zone-dependent thresholds can be set up by following the template provided in in the Header Comment of the baseline snowImpactThresholds method.
    1. Add code like the following after the default warning and sigSnow assignments (changes in bold), making substitutions for ugc codes and threshold values that suit your site:
      impactPhraseDict = OrderedDict([
                  (12, "Travel could be very difficult to impossible."),
                  (6, "Travel could be very difficult."),
                  (0, "Plan on slippery road conditions."),
              ])
      # Mountain Zones
      mountainZones = ["WYZ001", "WYZ002", "WYZ003"] # ugc codes, quoted and comma-separated
      for zone in mountainZones:
          if zone in zones:
             impactPhraseDict = OrderedDict([
                  (18, "Travel could be very difficult to impossible."),
                  (10, "Travel could be very difficult."),
                  (0, "Plan on slippery road conditions."),
              ])
            break
      return impactPhraseDict
      
    2. HOW IT WORKS:
      1. An initial warning and sigSnow are defined, which will be returned if no zone-specific matches supersede them
      2. The 'ugcs' metadata of the specific hazard passed to this function is used to grab the affected zones
      3. A set of zones with a unique (and shared) threshold are defined, in this case called "mountainZones"  (the name and grouping can serve any need)
      4. If any one of the special zones is included in the hazard zones, a different warning and sigSnow threshold are assigned and the loop immediately exists with "break"
      5. The values of warning and sigSnow are returned for this hazard, whether they remain as the initial values or have been specially assigned based on a special zone
    3. Expand!  More than one zone group may be specified and included in this function. For example, an additional zone group and zone comparison like the one below can be included before the return statement for a second test:
      #... AFTER "break" statement for mountainZones for-loop:
      urbanZones = ["WYZ100", "WYZ101", "WYZ102"] # ADD/CUSTOMIZE
      for zone in urbanZones:
          if zone in zones:
              warning = 2
              sigSnow = 6
              break
      return impactPhraseDict
      1. KEEP IN MIND: Whichever test occurs last has the opportunity to overwrite the values of warning and sigSnow, so write your tests with sequence in mind.
  21. Task Complete!