Focal Point Non-River Jobsheets

Modifying Dam MetaData with Overrides

Purpose:

This jobsheet covers some of the basics of overriding DamMetaData files

Tasks:

DamMetaData.py is a critical file that governs the appearance, scenarios, and other details for dam breaks, which are manually triggered through the Dam/Levee Break Flood Recommender. Often a CONFIGURED-level file will have been auto-generated  for offices who used WarnGen to manage damBreaks and who have completed the workflow of porting that to Hazard Services. However, either for NEW dams or changes to the auto-imported dams, incremental overrides to this file will be especially useful for managing or contributing dam entries.

As a final note, DamMetaData.py (as well as BurnScarMetaData.py) are actually stored in the Utilities directory, not MetaData.

 

  1. FIRST, Are there any /tmp/DamMetaData.py.* files whose records you need to incorporate?  IF NOT, skip this step...
    1. Recall: These are produced following the ingestShapeFiles script IF any existing OR newly imported shapes are still lacking a proper entry in the DamMetaData.py file. Having the proper entry there is crucial for managing the appearance and details associated with each impact area.
    2. If you just ran ingestShapeFile, there's a good chance your script produced a /tmp/DamMetaData.py* file (the full filename, usually with numbers at the end, would have been given in a message produced by the ingestShapeFile script) and that you should incorporate it into a MetaData override
    3. IF SO, since the Localization Perspective cannot see this file, open the most recent /tmp/DamMetaData.py* file either by navigating to the /tmp directory in a file browser, or by using the gedit (or vim if you prefer) command below in a terminal window
       
      ls -lt /tmp/DamMetaData.py* | head -n1 # Use this to list the most recent file, if you're unsure what it was
      gedit /tmp/DamMetaData.py.00000 # Change file to match output of above command
    4. Keep this file open for reference, as we'll copy in These should have been taken care of as part of the shapefile ingest workflow, but you can still check for any such files in the /tmp folder and see if they contain dams that are not in your localization tree's DamMetaData.py file
  2. In the Localization Perspective, navigate to the Utilities sub-directory under the Hazard Services folder.
  3. Double click on DamMetaData.py to show the available versions
  4. 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
  5. Double click on the User version of DamMetaData.py to open it for editing
  6. IF you have a /tmp/DamMetaData.py* file open from step 1 (IF NOT, skip this step)...
    1. return to the text editor with that file open
    2. Select all contents  either by clicking and dragging with the mouse or hitting Ctrl+A on your keyboard
    3. Copy the selection to your clipboard by hitting Ctrl+C on your keyboard
    4. Switch back to the the CAVE's Localization Perspective and the USER override of the DamMetaData.py file you were working on
    5. Paste the contents of your clipboard into your USER override on a blank line at the end of the file, by right-clicking and selecting "Paste" from the pop-up menu, or by hitting CTRL-V on your keyboard
    6. IF, by copying in the contents of the /tmp file, you now have two separate "DamMetaData={" dictionaries, then remedy this and merge them.  To do so, simply:
      1. Find and delete the opening line containing "DamMetaData={" for the SECOND instance of that dictionary
      2. Find and delete the closing "}" bracket of the FIRST instance of the DamMetaData dictionary (make sure it's the bracket which matche
      3. Make sure that the last entry of what was the FIRST dictionary has a comma after the final item's closing "}" bracket, so that the dictionary can seamlessly continue with the newly added entries from the second
    7. Note: you should not have any duplicate dam entries between the new records and the pre-existing one, because the lack of metadata is what triggered new set of dam's inclusions in the /tmp/DamMetaData.py* file
  7. Review each of the dam entries in your override
    1. Practice making changes to fields, un-commenting and adjusting the value of some of the commented ones, and copy-pasting scenario