Focal Point Non-Precipitation Weather Jobsheets

Customize or Add CTA or Impact Statements

Purpose:

This jobsheet demonstrates the general workflow for both adding new impact and CTA statements as well as customizing the label and product text for existing impact or CTA statements which can be selected from the HID in Hazard Services. It also covers how to adjust the automatically-generated, hazard-specific impact and CTA statements.

Tasks:

AT-A-GLANCE:

What? Create an incremental override of CallsToActionAndImpacts.py to:

  1.  Change the the "productString" key in the target CTA method to change the product output

  2. Change the labeling of choices on the HID for a CTA by modifying the "displayString" key

  3. Change a hazard-specific CTA that is automatically included based on the GFE grids

  4. Add a completely new CTA

  5. Change the quoted value assigned to the "productString" key in the target impact statement method

  6. Change the labeling of choices on the HID for an impact statement by modifying the "displayString" key

  7. Add a completely new impact statement

Follow the steps below for more detailed guidance.

*** OTHER CONFIGURATIONS WITH IDENTICAL WORKFLOW *** The methodology in this jobsheet can be mirrored for any HID-selectable CTA or impact statement in or the hazard-specific statements in CallsToActionAndImpacts.py .

 

[OPTIONAL] In order to see what user-selectable impact and CTA statements are available for a given hazard, you can:

  1. Create that hazard and see the options that result in the HID
  2. Navigate to the Hazard Meta Data sub-directory under the Hazard Services folder, double click on MetaDataDictionary.py and open the BASE version, and search for your hazard (they are alphabetical)
    1. If there is a SITE override, it may be easier to do option 1
    2. Hazard-specific CTAs, which are derived based on the grids, can be found by hazard (e.g. cta_WS_W_ice) in CallsToActionAndImpacts.py
  3. In the Localization Perspective, navigate to the Utilities sub-directory under the Hazard Services folder.
  4. Double click on CallsToActionAndImpacts.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 CallsToActionAndImpacts.py to open it for editing
    1. If this is the initial creation of this override, the file will only contain:
      class CallsToActionAndImpacts(object):
          pass

      As noted in each task, the new or edited methods will be added after the pass, which is there to prevent any errors should no methods be added to the file

  7. Open a reference copy of the existing CallsToActionAndImpacts.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

Change the productString of an existing CTA

  1. Get your Localization Perspective setup appropriately
  2. In the reference file you opened, scroll or search to find the method which defines your statement
  3. For the "Wind Chill Protection" CTA, find the "ctaWindChillProtection" method (whose first line appears as "def ctaWindChillProtection(self):" in CallsToActionAndImpacts.py)
    1. Searching this file for text you know to be in the CTA phrase OR choice label is another trick for finding the corresponding CTA method
  4. Once found, select the entire CTA method by clicking and dragging from (and including) the "def ctaWindChillProtection(self):" line which begins the function, all the way to (and including) the last line of the "return" statement which for CTAs is the end of the quoted "productString" variable, where a closing ")}" can be seen.
    1. These methods are relatively simple, so you will usually only be copying a few lines (~10 or less, mainly depending on how long the productString is)
  5. Copy the selected contents by right-clicking and selecting "Copy" from the pop-up menu, or by hitting CTRL-C on your keyboard
  6. Switch back to the USER override you were working on
  7. Paste the copied CTA method into your USER override on a blank line after the "class..." and "pass" lines, by right-clicking and selecting "Paste" from the pop-up menu, or by hitting CTRL-V on your keyboard
    1. If you already have overrides in your USER file, just paste the copied method anywhere after the existing overrides
  8. In the USER copy of the CTA method you just pasted in, edit the productString key to reflect the desired text
    1. DO NOT CHANGE the "identifier" value.  This value is used as a back-end link to the CTA data and is never seen on the front-end.
    2. Edit the "productString" to change the product text which is inserted for this CTA in the final product. For the "Wind Chill Protection" CTA, your new method may look like this (changes in bold):
      def ctaWindChillProtection(self):
              return {"identifier": "ctaWindChillProtection",
                      "displayString": "Wear protective clothing",
                      "productString": ("Dress in layers, including a hat and gloves, "
                                        "if you must go outside.")}
    3. For readability, feel free to use multiple lines to type this message (as the baseline versions often do), but if so be sure to close and reopen the quotation marks on each line and enclosed in parentheses.  All text in the parentheses will be joined when the product is created. 
      1. Alternatively, the desired text can be included within 3 single quotes on the front and back end, no parentheses. This may be easier for longer statements, as shown.
        def ctaWindChillProtection(self):
                return {"identifier": "ctaWindChillProtection",
                        "displayString": "Wear protective clothing",
                        "productString":
                        '''Dress in layers, including a hat and gloves,
                        if you must go outside.'''}

         

  9. Save and check that the change is as expected

  10. Task Complete!

 

Change the displayString of an existing CTA

  1. Get your Localization Perspective setup appropriately
  2. In the reference file you opened, scroll or search to find the method which defines your statement
  3. For the "Blizzard Warning Means..." CTA, find the "ctaBlizzardWarningInformation" method (whose first line appears as "def ctaBlizzardWarningInformation(self):" in CallsToActionAndImpacts.py)
  4. Searching this file for text you know to be in the CTA phrase OR choice label is another trick for finding the corresponding CTA method
  5. Once found, select the entire CTA method by clicking and dragging from (and including) the "def ctaBlizzardWarningInformation(self):" line which begins the function, all the way to (and including) the last line of the "return" statement which for CTAs is the end of the quoted "productString" variable, where a closing ")}" can be seen.
    1. These methods are relatively simple, so you will usually only be copying a few lines (~10 or less, mainly depending on how long the productString is)
  6. Copy the selected contents by right-clicking and selecting "Copy" from the pop-up menu, or by hitting CTRL-C on your keyboard
  7. Switch back to the USER override you were working on
  8. Paste the copied CTA method into your USER override on a blank line after the "class..." and "pass" lines, by right-clicking and selecting "Paste" from the pop-up menu, or by hitting CTRL-V on your keyboard
    1. If you already have overrides in your USER file, just paste the copied method anywhere after the existing overrides
  9. In the USER copy of the CTA method you just pasted in, edit the returned dictionary { } keys in one of the following ways:
    1. DO NOT CHANGE the "identifier" value.  This value is used as a back-end link to the CTA data and is never seen on the front-end.
    2. Edit the "displayString" to change the label for this CTA choice as seen in the HID.  For the "A Blizzard Warning Means" CTA, your new method may look like this (changes in bold):
      def ctaBlizzardWarningInformation(self):
          return {"identifier": "ctaBlizzardWarningInformation", #DO NOT CHANGE
                  "displayString": "Blizzard Warning Info", # CHANGE to the label seen on the HID
                  "productString": ("A Blizzard Warning means severe winter weather conditions "
                                    "are expected or occurring.  Falling and blowing snow with "
                                    "strong winds are likely.  This will lead to whiteout conditions, "
                                    "making travel extremely dangerous.  Do not travel.  If you must "
                                    "travel, have a winter survival kit with you.  If you get stranded, "
                                    "stay in your vehicle.")}
      
  10. Save and check that the change is as expected

  11. Task Complete!

 

Change the content of a hazard-specific CTA

  1. Get your Localization Perspective setup appropriately
  2. In the reference file you opened, scroll or search to find the method which defines your CTA
    1. For the IS.W-specific CTA, find the "cta_IS_default" method (whose first line appears as "def cta_IS_default(self):" in CallsToActionAndImpacts.py)
    2. Searching this file for text you know to be in the CTA phrase is another trick for finding the corresponding CTA method
  3. Once found, select the entire CTA method by clicking and dragging from (and including) the "def cta_IS_default(self):" line which begins the function, all the way to the end of the "return" statement
  4. Copy the selected contents by right-clicking and selecting "Copy" from the pop-up menu, or by hitting CTRL-C on your keyboard
  5. Switch back to the USER override you were working on
  6. Paste the copied CTA method into your USER override on a blank line after the "class..." and "pass" lines, by right-clicking and selecting "Paste" from the pop-up menu, or by hitting CTRL-V on your keyboard
    1. If you already have overrides in your USER file, just paste the copied method anywhere after the existing overrides
  7. In the USER copy of the CTA method you just pasted in, edit the quoted text with your desired change.
    1. For the default IS.W cta, your new CTA method may look like this (changes in bold):
      def cta_IS_default(self):
              return ("Travel is strongly discouraged. If you must travel, keep plenty of blankets, "
                      "food, and water in your vehicle in case of an emergency. "
                      "Prepare for possible power outages.")
      
    2. For readability, feel free to use multiple lines to type this message, but if so be sure to close and reopen the quotation marks on each line.  All text in the parentheses will be joined when the product is created.
      1. Alternatively, the desired text can be included within 3 single quotes on the front and back end, no parentheses. This may be easier for longer statements, as shown.
        def cta_IS_default(self):
                return '''Travel is strongly discouraged. If you must travel, keep plenty of blankets, food, and water,
                 in your vehicle in case of an emergency. Prepare for possible power outages.'''

         

  8. Save and check that the change is as expected
  9. Task Complete!

 

Add a new CTA

  1. Get your Localization Perspective setup appropriately
  2. When adding a brand new CTA, it may be easier to copy an existing CTA into your override to ensure the proper format
    1. Choose one from the BASE file and copy/paste it into the USER override
    2. In this example, we are adding a CTA for the particular local hazard of wind-blown dust that can impact travel during a high wind event
  3. In the USER copy of the CTA method you just pasted in, edit all of the dictionary { } keys , ensuring the "identifier" value and the method name match and are unique
    1. This "identifier" value is used as a back-end link to the CTA data 
  4. Edit the "displayString" to have pertinent text for forecasters in the HID
    def ctaDustFromWindVisibilityTravel(self):
            return {"identifier": "ctaDustFromWindVisibilityTravel",
                    "displayString": "Wind-blown dust could make travel dangerous",
                    "productString": 
                    '''Blowing dust and perhaps a wall of dust could severely limit visibilities.
                    Be ready for a sudden drop in visibility. If you encounter blowing dust on the roadway or 
                    see it approaching, pull off the road as far as possible and put your vehicle in park. 
                    Turn the lights all the way off and keep foot off the brake pedal. Remember, 'Pull Aside, Stay Alive'.'''}
    
  5. Edit the "productString" to contain the product text which will be included for this CTA in the final product
    def ctaDustFromWindVisibilityTravel(self):
            return {"identifier": "ctaDustFromWindVisibilityTravel",
                    "displayString": "Wind-blown dust could make travel dangerous",
                    "productString": 
                    '''Blowing dust and perhaps a wall of dust could severely limit visibilities.
                    Be ready for a sudden drop in visibility. If you encounter blowing dust on the roadway or 
                    see it approaching, pull off the road as far as possible and put your vehicle in park. 
                    Turn the lights all the way off and keep foot off the brake pedal. Remember, 'Pull Aside, Stay Alive'.'''}
    1. For readability, feel free to use multiple lines to type this message (as the baseline versions often do), but if so be sure to use 3 single quotes at the beginning and end of the text, before the closing bracket }
  6. Save and check that the change is as expected
    1. For a new CTA, it will also need to be added to the appropriate hazard(s) for selection by the forecaster, which is done via an override of MetaDataDictionary.
  7. Task Complete!

 

Change the productString of an existing Impact statement

  1. Get your Localization Perspective setup appropriately
  2. In the reference file you opened, scroll or search to find the method which defines your statement
  3. For the "Trees/Power/Travel" high wind impact statement, find the "impactWindsCouldTreesLinesOutagesTravel" method (whose first line appears as "def impactWindsCouldTreesLinesOutagesTravel(self):" in CallsToActionAndImpacts.py)
    1. Searching this file for text you know to be in the impact statement OR choice label is another trick for finding the corresponding method
  4. Once found, select the entire impact statement method by clicking and dragging from (and including) the "def impactWindsCouldTreesLinesOutagesTravel(self):" line which begins the function, all the way to (and including) the last line of the "return" statement which for impacts statements is the end of the quoted "productString" variable, where a closing ")}" can be seen.
    1. These methods are relatively simple, so you will usually only be copying a few lines (~10 or less, mainly depending on how long the productString is)
  5. Copy the selected contents by right-clicking and selecting "Copy" from the pop-up menu, or by hitting CTRL-C on your keyboard
  6. Switch back to the USER override you were working on
  7. Paste the copied impact statement method into your USER override on a blank line after the "class..." and "pass" lines, by right-clicking and selecting "Paste" from the pop-up menu, or by hitting CTRL-V on your keyboard
    1. If you already have overrides in your USER file, just paste the copied method anywhere after the existing overrides
  8. In the USER copy of the impact statement method you just pasted in, edit the productString key to reflect the desired text
    1. DO NOT CHANGE the "identifier" value.  This value is used as a back-end link to the CTA data and is never seen on the front-end
    2. Edit the "productString" to change the product text which is inserted for this impact statement in the final product. For the "Trees/Power/Travel" impact statement, your new method may look like this (changes in bold):
      def impactWindsCouldTreesLinesOutagesTravel(self):
              return {"identifier": "impactWindsCouldTreesLinesOutagesTravel",
                      "displayString": "Winds could blow trees/power lines; widespread outages",
                      "productString": ("Damaging winds could blow down trees and power lines. "
                                       "Power outages are possible. Travel could be "
                                       "difficult, especially for high profile vehicles.")}
    3. For readability, feel free to use multiple lines to type this message (as the baseline versions often do), but if so be sure to close and reopen the quotation marks on each line and enclosed in parentheses.  All text in the parentheses will be joined when the product is created. 
      1. Alternatively, the desired text can be included within 3 single quotes on the front and back end, no parentheses. This may be easier for longer statements, as shown.
        def impactWindsCouldTreesLinesOutagesTravel(self):
                return {"identifier": "impactWindsCouldTreesLinesOutagesTravel",
                        "displayString": "Winds could blow trees/power lines; widespread outages",
                        "productString":
                        '''Damaging winds could blow down trees and power lines.
                        Power outages are possible. Travel could be difficult,
                        especially for high profile vehicles.'''}

         

  9. Save and check that the change is as expected

  10. Task Complete!

 

Change the displayString of an existing Impact statement

  1. Get your Localization Perspective setup appropriately
  2. In the reference file you opened, scroll or search to find the method which defines your statement
  3. For the "Heavy Rain Triggers" impact statement, find the "impactHeavyRainTriggerFlashFlooding" method (whose first line appears as "def impactHeavyRainfallTriggerFlashFlooding(self):" in CallsToActionAndImpacts.py)
  4. Searching this file for text you know to be in the impact phrase OR choice label is another trick for finding the corresponding impact statement method
  5. Once found, select the entire impact statement method by clicking and dragging from (and including) the "def impactHeavyRainfallTriggerFlashFlooding(self):" line which begins the function, all the way to (and including) the last line of the "return" statement which for impact statements is the end of the quoted "productString" variable, where a closing ")}" can be seen.
    1. These methods are relatively simple, so you will usually only be copying a few lines (~10 or less, mainly depending on how long the productString is)
  6. Copy the selected contents by right-clicking and selecting "Copy" from the pop-up menu, or by hitting CTRL-C on your keyboard
  7. Switch back to the USER override you were working on
  8. Paste the copied impact statement method into your USER override on a blank line after the "class..." and "pass" lines, by right-clicking and selecting "Paste" from the pop-up menu, or by hitting CTRL-V on your keyboard
    1. If you already have overrides in your USER file, just paste the copied method anywhere after the existing overrides
  9. In the USER copy of the method you just pasted in, edit the returned dictionary { } keys in one of the following ways:
    1. DO NOT CHANGE the "identifier" value.  This value is used as a back-end link to the impact statement data and is never seen on the front-end.
    2. Edit the "displayString" to change the label for this impact statement choice as seen in the HID.  For the "Heavy Rain Triggers" impact statement, your new method may look like this (changes in bold):
      def impactHeavyRainfallTriggerFlashFlooding(self):
              return {"identifier": "impactHeavyRainfallTriggerFlashFlooding",
                      "displayString": "Low-lying flash flooding",
                      "productString": ("Heavy rainfall could trigger flash flooding of low-lying areas, "
                                        "urbanized street flooding, and debris flows in and near recent "
                                        "wildfire burn scars.")}
      
  10. Save and check that the change is as expected
  11. Task Complete!

 

Add a new Impact statement

  1. Get your Localization Perspective setup appropriately
  2. When adding a brand new impact statement, it may be easier to copy an existing impact statement into your override to ensure the proper format
    1. Choose one from the BASE file and copy/paste it into the USER override
    2. In this example, we are adding an impact statement for the particular local hazard of wind-blown dust that can occur during a high wind event
  3. In the USER copy of the impact statement method you just pasted in, edit all of the dictionary { } keys , ensuring the "identifier" value and the method name match and are unique
    1. This "identifier" value is used as a back-end link to the impact statement data 
  4. Edit the "displayString" to have pertinent text for forecasters in the HID
    def impactWindMakesDust(self):
            return {"identifier": "impactWindMakesDust",
                    "displayString": "Dust hazard with high wind",
                    "productString": 
                    '''Blowing dust and perhaps a wall of dust is possible due to the high winds. They can reduce 
                    visibilities and make travel hazardous if not dangerous at times.''',
                    }
    
  5. Edit the "productString" to contain the product text which will be included for this impact statement in the final product
    def impactWindMakesDust(self):
            return {"identifier": "impactWindMakesDust",
                    "displayString": "Dust hazard with high wind",
                    "productString": 
                    '''Blowing dust and perhaps a wall of dust is possible due to the high winds. They can reduce 
                    visibilities and make travel hazardous if not dangerous at times.''',
                    }
    1. For readability, feel free to use multiple lines to type this message (as the baseline versions often do), but if so be sure to use 3 single quotes at the beginning and end of the text, before the closing bracket }
  6. Save and check that the change is as expected
    1. For a new impact statement, it will also need to be added to the appropriate hazard(s) for selection by the forecaster, which is done via an override of MetaDataDictionary.
  7. Task Complete!

 

Save steps

  1. 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
  2. [OPTIONAL, RECOMMENDED] Verify your change has been made by viewing the HID and re-generating a product for some hazard
    1. Switch back to GFE (or whichever localization you were previously using) to once again view Hazard Services
    2. Dismiss any open Product Editor windows and close and re-launch the HID
      1. If you are using an existing hazard (e.g. a pending hazard created before the change was made), you may need to change the Hazard Type in the HID and then change it back in order to see your changes 
    3. Select the same hazard type as before (e.g. BZ.W) and select the statement option you've just modified (it's also helpful to deselect all other CTA or impact checkboxes for this test)
      1. If you changed the label, verify that this appears correct on the HID
    4. Click "Preview" to generate a product for review
    5. ​​​​​Scroll down and observe the UPDATED text 
      1. Your updated impact or CTA phrase should appear in the text box