AMBER Display ArcView Extension

Updated April 18, 2002

The AMBER Display ArcView Extension is used to display output from the ambergis program. The extension provides scripts to automatically update views with new data and efficiently display ABR, BRA, FFG and Alert Status data for the 6 Alert Time Periods and multiple Basin Types. The advantage of using ArcView as a display engine is that additional data that may help in the flash flood warning decision process can be easily added and the ArcView interface can also be easily customized to meet the needs of individual sites.

The AMBER Display extension provides an easy way to view data for the high resolution sub watersheds and also provides a high level view of the overall radar area of coverage or Area of Responsibility. Due to the small scale nature of the AMBER basins, the display can become difficult to interpret with all basins displayed. Therefore, an Area of Responsibility view generally uses counties, zones or large scale watersheds (such as MAP areas, HUCs, etc.) as the primary theme. This theme is colored coded by the highest Alert Status of any individual small scale basin falling within the polygons of the theme. This provides a quick and easy way to visually determine where potential problem areas are. A "Zoom to County" tool can then be used to zoom into the small scale basins from the larger scale Area of Responsibility view.

The extension requires the AMBER data display project to be set up in a specific way. A template project is included that should be used to initially set up the AMBER display project. This template project contains three views which are the minimum requirements for the extension. The first view is the high level Area of Responsibility view. The second view would contain the small scale AMBER basins. The third view called AMBER State contains just a text summary indicating the data time, Auto Update status, and the Radar Adjustment factor. In addition to the basin and Area of Responsibility shapefiles, the extension requires three text files output from the ambergis program:

To use the extension for real time display, these files must be accessible to the system ArcView is running on. For the Unix version of ArcView, this is generally easy to set up. However, on Windows systems, some type of NFS program, SAMBA or ftp server is required on the PC. If these text files are on the PC, ArcView or Windows seems to lock the files ArcView has open and prevents the files from being updated. Therefore, it is generally best to leave the above text files on a Unix/Linux system and NFS mount the files onto the PC.

Using the extension

The extension adds a menu, several buttons and a tool to the View interface:

AMBER Menu

The "Change Period" portion of the AMBER menu is used to change the accumulation period of the AMBER themes. These menu choices will apply to all real time AMBER data themes in the project.

The "Change Theme" portion of the AMBER menu is used to change which parameter is displayed. These menu choices will apply only to the active theme. The "Change Theme" options only change the legend of the active theme to display the desired data. This allows only one theme to present all the data for that basin type. This improves performance since the AMBER data is joined only once to the theme instead of having multiple themes for each of BRA, ABR, Alert Status and FFG data and a join for each.

AMBER Buttons:

- Forces a check for new data. The display will not be updated unless a new data time is detected in table validtim.txt.

- Toggles auto-update mode.

- Opens the Area of Responsibility View and zooms out to preset scale.

- Queries for basins with a combination of BRA and ABR values. This is useful to find basins with both high BRA and ABR.

AMBER Tools:

- Tool to select an area on the Area of Responsibility view and then automatically zoom in on the small scale basins view. Click or drag a box in the view to zoom. The view that will be zoomed in on is defined in the start up script.

Set up instructions

The AMBER data display is accomplished by a joining the AMBER realtime files to the attribute tables of the basin shapefiles. The legend for the shapefile themes are set to display a specific field from the AMBER data files. To allow for multiple Basin Types in the project, the alert.txt file is exported to separate Dbase (.dbf) files for each AMBER Basin Type used in the project. If there are a large number of basins and/or Basin Type files, the exporting to Dbase and joining to the different themes can take a few minutes. Therefore, you may have to balance the amount of data displayed (multiple Basin Types, ABR, BRA, FFG and Alert Status) versus performance.

The extension ZIP file contains the following:

The legend files are provided to set up the themes quickly. The legends for the AMBER data themes can easily be customized and saved to legend files through the normal ArcView interface.

Once the project is set up with the basic AMBER display and it is working, it is highly recommended that a back up of the project be made before adding other data. Once the operational version is set up with any additional data and site customizations, you should write protect the project (in addition to making a back up copy) since users may change the project by adding or deleting themes.


Procedures for Creating a New ArcView AMBER real-time Display Project

The files alert.txt, highest.txt and validtim.txt from the ambergis program are needed to set this project up. These files should be in the directory where they will be updated in real time.
  1. Open the amber_template.apr project.
  2. From the File menu, select "Save Project As..." and save the project (kxxx_amber.apr suggested where kxxx is the radar ID). Save frequently while setting up the project.
  3. Select the project properties menu and set the Work Directory for the project. Dbf files for the real time AMBER data will be written to this directory.
  4. Load the ambergis text data files:
    1. From the project window, select the Tables icon and press the "Add" button. Change the file type to "*.txt" and add alert.txt, highest.txt and validtim.txt.
    2. Close the highest.txt and validtim.txt tables.
  5. Export alert.txt to .dbf files:
    1. Select the alert.txt table to make it active.
    2. Click on the Query Builder button (hammer icon).
    3. Build a query that selects all rows with basin type (field Bt) equal to 1. The query should look like: ( [Bt] = 1 )
    4. Click on the button "New Set"
    5. From the file menu, select "Export" and export the table to a new dBase file called "alert1.dbf" in the Work directory from Step 2.
    6. Repeat step the previous 5 steps for each different basin type you wish to display (change the number 1 in the query and the export steps to the appropriate basin type number).
    7. Close the query window.
    8. From the Edit menu, select "Select None" to clear the selection on alert.txt.
    9. Close the alert.txt table window.
    10. From the project window, select the Tables icon and press the "Add" button. Change the file type to "*.dbf" and add all the alert*.dbf files just created to the project. Once added, the tables can be closed to clean up the display.
  6. Create the "Area of Responsibility - Valid:" view:
    1. Open the "Area of Responsibility - Valid:" view.
    2. Add the shapefile that represents the Warning Ids used in the AMBER algorithm. This shapefile is generally counties, zones or large scale watersheds such as MAP areas, HUCs, etc. However, this shapefile must have a field in the attribute table that corresponds to the Warning ID used in the AMBER run time data base.
    3. Make this theme active and select "Theme Properties" from the Theme menu. Change the theme name to "Alert Status:".
    4. From the Theme menu or the by using the Table button, open the attribute table for the Warning IDs shapefile.
    5. Open the highest.txt table and select the field that represents the Warning ID (click on the field name).
    6. In the Warning ID theme attribute table, select the field that represents the Warning ID.
    7. From the Table menu select Join (or use the Join button). The highest.txt table will be automatically closed and its data will now appear in the Warning ID attribute table.
    8. Close the Warning ID theme attribute table.
    9. Make the "Area of Responsibility - Valid:" view active.
    10. Open the legend editor by double clicking on the theme legend.
    11. Click on the "Load" button.
    12. Open the alert.avl file that was included in the original ZIP file.
    13. For the Field, select the "As_a" field and press the Ok button.
    14. In the Legend Editor window, press the Apply button and then close the legend editor.
  7. Create the "Primary Basins - Valid:" view (this view will be the primary view for displaying AMBER output and for flash flood analysis):
    1. Open the Primary Basins - Valid:" view.
    2. Add the shapefile of basins to this view.
      1. Make the basins theme the active theme (click on its legend).
      2. From the Theme menu, select "Theme Properties". Change the theme name to "ABR:" (colon required).
    3. Join the alert dbf file to the basin theme:
      1. Open the alert#.dbf table that corresponds to the basin type of the basin shapefile (if basin type = 1, open the alert1.dbf table).
      2. Select the "Basinid" field.
      3. Open the attribute table for the basins theme and select the field that corresponds to the "Basinid" field in the alert table.
      4. From the Table menu select Join (or use the Join button). The alert table will close and its data joined to the theme's table.
      5. Open the legend editor by double clicking on the theme legend.
      6. Click on the "Load" button.
      7. Open the abr.avl file that was included in the original ZIP file.
      8. For the Field, select the "Abr_a" field.
      9. Press the Ok button in the Load Legend window
      10. In the Legend Editor window, press the Apply button and then close the legend editor.
  8. Create new basin Views for additional basin types:
    1. From the project window, click on View and then New.
    2. From the View menu, select Properties.
      1. Name the view with a descriptive title that ends with the string "- Valid:". If any view's name contains this string, it will be updated with the AMBER data time.
    3. Repeat the procedure in Step 7 to join the tables and set up the legends.
  9. Load the AMBER Display Extension:
    1. From the File menu, select Extensions
    2. Click in the box next to "Amber Display" to turn on the check mark.
    3. Press the Ok button. Once this project is saved, it will always load this extension.
  10. Create the Startup script:
    1. From the project window, select the Scripts icon and click on the "kxxx.Startup" entry.
    2. Press the "Load System Script" button. This is also available on the Script menu. Select script "AMBER.Startup". This will insert the contents of the AMBER.Startup script into your startup script.
    3. From the Script menu, Select Properties.
      1. Change the "kxxx" in the script name to be the radar ID.
    4. Edit the configuration section near the top of the Startup script. Look at the comments in the script and check the settings for:
      1. _radarID
      2. _autoUpdate
      3. _basinTypes - This is a list variable; set the list to include each of the basin types used in your project.
      4. _rdalat and _rdalon - these set up the center point of the "Area of Responsibility - Valid:" view. The coordinates must be in the units of the View.
      5. _cwaView - The actual name of the area of responsibility view. The name here must match the name of the view so if you change here, you must also change the View Properties. The "- Valid:" portion of the name is required.
      6. _cwaScale - the default scale of the CWA view for the Show CWA button. Zoom in or out on the view to the desired area of coverage and use the number in the Scale window on the right side of the tool bar. (The View Properties, Map Units must be defined).
      7. _hotview - The actual name of the view that will be zoomed in on when using the Zoom to County tool. The name here must match the name of the view so if you change here, you must also change the View Properties. The "- Valid:" portion of the name is required.
      8. _hotviewScale - the default scale of _hotview view when using the Zoom to County tool. Zoom in on the view to the desired level of detail and use the number in the Scale window on the right side of the tool bar. (In the View Properties, Map Units must be defined).
    5. Compile the script by pressing the compile button (check mark button).
    6. Close the script window.
    7. Make the project window active and select Properties from the Project menu.
      1. Set the Start up script to be the name of the script just edited.
  11. From the Project window, select Tables.
    1. The AMBER Display project must have the following tables in the project:
      1. alert.txt
      2. highest.txt
      3. validtim.txt
      4. alertn.dbf - where n is Basin Type. There must be a separate dbf table for each Basin Type used in the project.
    2. Delete other tables not needed. Any table called "Attributes of ..." should be deleted from the project. These are the attribute tables of the shapefiles and were needed only to perform the table joins.
  12. Save the project.
  13. Exit ArcView.
  14. Restart ArcView and open the project. The alert.txt file should be exported to the alertn.dbf files (n = basin types configured) and all themes joined to these files. Depending on the number of basin types and number of basins, this could take a few minutes.
    1. The views should all have the AMBER data valid time appended to their names.
    2. From the Period menu, change time periods. All theme legends should update with the period and the data displays should change correspondingly.
  15. Move the AMBER State view to be along the bottom of the ArcView window. Resize and arrange the other views to so that the contents of the AMBER State view can still be seen. ArcView remembers the last used window settings when opening its windows. Therefore, set the size and position of all views to how you want them to appear when the view is initially opened.
  16. Once the basics are working, save the project and make a backup copy.
  17. Add any other data and views that are needed.
  18. Save and restart the project.
  19. Once the project is totally configured, make a backup copy of the project file. You may also want to write protect the project file used operationally so users cannot save when exiting ArcView.

Displaying the AMBER Basin Graph from ArcView

By using the Hotlink function of ArcView, the project can be set up so that clicking on a basin will launch the basin graph program. Unfortunately, the basin graph program is an HPUX executable so this currently can only be done on the HPUX version of ArcView. (If anyone knows how to run a remote shell from a PC to UNIX, please let me know).

The hotlink property of a theme should is set through the theme properties. The basin graph program can be hotlinked to any theme that has an alert dbf table joined to it.

  1. Make the desired theme active.
  2. From the Theme menu, select Properties.
  3. On the left side of the Theme Properties window, scroll down and click the Hotlink icon.
  4. For the Field, select "Basin_id".
  5. For the Predefined Action, select "Link to User Script".
  6. For the Script, select "AMBER.BasinGraph".
  7. Click the Ok button.
For the basin graph programs to run properly, AMBER environment variables must be set and the amber/bin directory must be in your PATH variable. A script amberStart_AV.sh is provided that should be used to start the AMBER project on UNIX. This script expects the project to be named $AMBER_DATADIR/av/kxxx_amber.apr where kxxx is your radar ID. The script requires the radar ID as the only command line argument. Edit the script if you have installed amber in a location other than /data/local/amber.