Airport Weather Warnings - Hazard Services
Airport Weather Warnings
Purpose:
This jobsheet will walk the Focal Point through setting up the Airport Weather Warning Tool.Tasks:
AT-A-GLANCE:
-
What? The Airport Weather Warning Tool can be configured using incremental override of the AirportMetaData dictionaries within AirportMetaData.py.
-
Required airport geometries. The Airport Weather Warning Tool must be configured with your local airports’ geometries before you can use it. This jobsheet will show you how to find the lat/lon coordinates for your airport vertices in the WarnGenLoc map.
Follow the steps below for more detailed guidance.
-
In the Localization perspective, navigate to Hazard Services –> Recommenders –> AirportMetaData.py and double click on BASE to load.
-
If a USER override for AirportMetaData.py does not already exist, create one by right-clicking BASE –> Create Override File and selecting User. Open the USER override file.
-
The BASE file should contain only an empty dictionary AirportMetaData with instructions and an example on how to fill out the override file. The airport name, PIL code, and airport vertex coordinates are contained within that dictionary. Some examples from OAX appear in the BASE file. Copy the entire example function definition into the USER override file.
# *** Override behavior of AirportMetaData.py *** # -- Override ability: Incremental # -- Levels: All """ This class holds the metadata for predefined airport areas for the Airport Weather Warning (AWW) Here is an idealized example of one dam specific metadata entry: AirportMetaData = { "OMA Eppley Airfield": { "airportCode": "OMA", "geometry": [[-95.918, 41.316], [-95.8898, 41.316], [-95.8769, 41.30657], [-95.874, 41.291], [-95.892, 41.281], [-95.918, 41.316]], }, } NOTE: The 'airportCode' is used to define the AWIPS Product Inventory List (PIL) code in the message header. In the example above, this would be AWWOMA. """ AirportMetaData = {}
-
In the USER file, remove the unwanted airport code and vertex coordinates from AirportMetaData and enter the name, code, and airport vertex coordinates of your desired airports into the dictionary using the same syntax.
-
If you do not know the lat/lon coordinates for your airport vertices, you can find them using the following steps:
-
In the D2D perspective, load the WarnGen Locations map by selecting Maps –> WarnGenLoc from the menu bar at the top of the screen.
-
Open the Hazard Services Hydro Console.
-
Zoom in on one of your airports on the map.
-
In the Hazard Services menu bar, click on the Maps icon and select WarnGenLoc from the dropdown.
-
Left-click to highlight your airport in the map, then right-click to open the HID.
-
In the Type dropdown in the HID, select Flood Watch (FA.A).
-
Click the Propose button at the bottom of the HID.
-
Right-click on your Proposed FA.A hazard in the Hazard Services Console and select View Details for Selected Events. This will open the Event Details Viewer pop-up window.
-
Scroll down in the Event Details Viewer until you reach the polygon geometry, labeled Geometry: POLYGON.
-
Copy the field of vertices, then right-click the Proposed FA.A in the Hazard Services Console and select Delete to remove the hazard from the list.
-
Return to the Localization perspective and paste the coordinates as the values of the Geometry key within the AirportMetaData dictionary in your USER override. You may manually reformat the vertices with brackets [ ] around each pair of coordinates and commas between latitude and longitude to match the correct syntax. However, a quicker way is to open up a terminal and with Python use this sample script to reformat the Event Details Viewer output. This script uses Regex and a function to restructure the data with brackets. Copy paste the print statement output into the override dictionary.
import re def convert_lat_lon(data): matches = re.findall(r"(-?\d+\.\d+)\s(-?\d+\.\d+)", data) nested_array = [[float(lon), float(lat)] for lon, lat in matches] return nested_array #Copy paste your Event Details Viewer lat and lon nested array within a string. Example data: data = '((-81.2 32.14, -81.24 32.15))' data = 'DATA GOES HERE' convert_data = convert_lat_lon(data) print(convert_data)
-
-
Save the override file using Ctrl+S. Merge if it asks you to.
-
Add additional airports to the AirportMetaData dictionary until all desired airports in your CWA have been included.
-
Test the Airport Weather Warning Tool in the D2D perspective. You need to use the Hazard Services Console: Short Fuse configuration for the tool to appear in the Tools dropdown. Make sure all of your desired airports appear in the dropdown and that the geometry is correct on the map for each one.
-
When you are comfortable that the USER override is working as intended, return to the Localization perspective. Promote the USER override to a SITE override by right-clicking USER under AirportMetaData.py in the File Browser and selecting Copy To –> Site.
Congratulations, you've configured the Airport Weather Warning Tool.