Focal Point Winter Weather Jobsheets

Configure Unsampled Edit Areas

Purpose:

This jobsheet demonstrates the process for configuring edit areas where weather grids should not be sampled for a given hazard type.

Tasks:

AT-A-GLANCE:

  • What? Include a comma-separated list of edit areas in the "unsampledAreaNames" variable, in an override of LocalEffects.py
  • Hazard Options. Make the unsampledAreaNames vary by hazard types with conditional logic if desired

Follow the steps below for more detailed guidance.

  1. [OPTIONAL] Create a hazard in your areas to test the initial sampling behavior (IMPORTANT: You need real or fake grid data to see any weather sampling)
    1. Launch Hazard Services in in GFE
    2. Draw a hazard which partially overlaps the edit areas you plan to exclude from sampling in this jobsheet, using the freehand polygon or another technique
    3. Select a category (e.g. Winter) and hazard (e.g. BZ.W), then click "Preview" to generate a product
    4. Look at the "What:" text field to see the accumulation or other synopsis phrase, which will originally sample all overlapped edit areas
  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 LocalEffects.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
      1. If this is the initial creation of this override, the override file will contain:
        class LocalEffect(object):
            pass
        
        class LocalEffectArea(object):
            pass
        
        class LocalEffects(object):
            pass
    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 LocalEffects.py to open it for editing
  7. Open a reference copy of the existing LocalEffects.py file, which will be used for comparison 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 "unsampledAreaNames" method (whose first line appears as "def unsampledAreaNames(self, hazardType):" in LocalEffects.py)
  9. Once found, select the entire unsampledAreaNames by clicking and dragging from (and including) the "def unsampledAreaNames(self, hazardTypes):" line which begins the function, all the way to (and including) the last line of the function which has the "return unsampledAreaNames" 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 unsampledAreaNames method into your USER override on a blank line after the "class LocalEffects"  (beware that there is also a class called "LocalEffect" so do not get these confused. LocalEffects should be the last of three class statements) 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. Locate the unsampledAreaNames variable, shown below, which will have an empty list assigned to it to start with:
    unsampledAreaNames = []
  14. Decide on one or more edit areas you'll use as unsampled areas. 
    1. To choose valid edit areas, refer to the "GFE" > "Edit Areas" directory in the utility tree
    2. Pick one or more file-names (without the .xml suffix) for edit areas (Example: BOU_Above_10000.xml defines an edit area with the name "BOU_Above_10000")
  15. Populate the edit areas to not sample ​​​​​​​in one of the following ways...
    1. To set one or more edit areas never to sample by default, just edit the list contents with quoted, comma-separated edit area names like this (changes shown in bold):
      unsampledAreaNames = ["BOU_Above_10000","Mountains"] # List edit areas never to sample by default
      When the method returns this list, it prevents any sampling of weather elements in these edit areas, no matter the hazard.
    2. OR, to make a phensig-dependent assignments of unsampled edit areas, use logic like the following example for BZ.W (changes shown in bold):
      unsampledAreaNames = [] # Leave empty or populate with default areas not to sample
      if hazardType in ["BZ.W"]:
          unsampledAreaNames=["BOU_Above_10000","Mountains"] # List edit areas never to sample for the BZ.W hazard type
      This logic makes a conditional assignment of the unsampledAreaNames, by checking the hazardType argument (passed into the method) against a list or one or more hazard types to trigger this assignment.  If the hazardType condition doesn't match, the default value of unsampledAreaNames (either empty [ ] or populated) gets returned.  Use as many hazardType conditions as you like to control the assignment here.
  16. 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
  17. [OPTIONAL, HIGHLY RECOMMENDED] Test your new unsampled edit areas ​​​​​​​by generating a hazard which partially overlaps the excluded areas
    1. No need to fully issue - just generate a hazard (use the correct hazard type if you made a phensig-specific rule) and check the "What" text field to verify that your sampling looks correct for excluding the unsampled edit areas
  18. Finished!