46

Hurricane Florence: rainfall totals in the Carolinas

 5 years ago
source link: https://www.tuicool.com/articles/hit/Qv6NZz2
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

"We been through every kind of rain there is. Little bitty stingin' rain, and big ol' fat rain, rain that flew in sideways, and sometimes rain even seemed to come straight up from underneath." Was that a quote from the Forrest Gump movie, or something said regarding Hurricane Florence? Could be either one!

Hurricane Florence recently came through our area. Luckily it lost a bit of strength before it came ashore, and didn't hit us as a category 4 storm. But what it lacked in strength, it made up for in rainfall. The hurricane moved very slowly, spending 4 or 5 days over our state as its rotation picked up moisture from the ocean and dropped it on the land.

Here's a photo from my friend Paul, showing an example of the flooding:

JJZRnem.jpg!web

Fortune reported that the storm could drop 10 trillion gallons of water on NC (that's enough to fill 15 million Olympic-sized swimming pools, or enough for everyone on Earth to take 69 10-minute showers). So, which cities got the most rain, and how much did they get? Seems like the perfect challenge forThe Graph Guy!

I did a bit of Web searching, and found the very cool cocorahs.org website, where volunteer weather observers report the daily rainfall in their area, and submit it to a database. They have an interface that lets you select a state and date, it it provides you with a table. Here's a snapshot of some of the NC rain gauge readings for NC:

i2UNFz7.png!web

You could also view a map of the rainfall data on their website. Here's an example:

zeYZBne.png!web

It was interesting seeing the data plotted on the map, but the hurricane rainfall amounts didn't really jump out at me and say "We just had a flood of biblical proportions!" The county outlines and names seemed to jump out more than the data values (colored dots). Therefore I decided to see what I could do in the form of a make-over...

Daily Maps

I didn't see an easy way to download their data from the table, therefore I paged through the dozens of table pages, and copy-n-pasted them one page at a time into a text file , and wrote a bit of SAS code to import the text. Since there were multiple gauges in many of the cities, I calculated an average value for each city. I then used Proc Geocode to estimate the latitude/longitude center of the cities, and plotted the data on a map using blue bubbles (with the area of the bubble proportional to the amount of rain that day). And to add a bit of context and timing, I added the path of the hurricane (in red).

Here are the maps for each of the 5 days the hurricane was moving across the Carolinas. You can click the images to see the interactive maps, with HTML mouse-over text showing details for each of the blue bubbles:

VRZFryi.png!web

n6FZRrM.png!web

ZvM3Yzn.png!web

aiMjm2z.png!web

6BNZRrz.png!web

Animated Map

Having the five separate maps is great if you're wanting to scrutinize each map, and mouse-over the cities to see the detailed data ... but it sure would be nice to have an easy way to see all the maps without having to do any work (like scrolling and clicking). Therefore I added one more like of SAS code to turn the maps into a GIF animation!

Bb2U3aN.gif

Total Rainfall Map

Most storms only last a few hours, therefore seeing a daily rainfall value is usually adequate. But in this case the storm lasted several days, therefore it would be nice to also see the grand total rainfall for each city. Therefore I created one final map showing the total rainfall in each city. Click the map below, and mouse-over the blue bubbles - what's the city with the maximum rainfall you can find? (feel free to leave your guess and discussion in the comments section!)

v267fmF.png!web

How'd He Do That?

If you're a SAS programmer, and curious what tricks I used to create these maps, here's a short summary. Notice that I'm emphasizing the new (or fairly new) Procs, options, and datasets.

  • I used the new mapsgfk.us_counties map dataset (which ships with SAS/Graph) as my base map.
  • I subset the map to just North and South Carolina, and used Proc Gproject to project it (so the subset looks 'straight' - notice how the cocorahs map above, with the red 'X' across it, looks crooked). I used the new latlong option so I wouldn't have to rename the variables to Y and X, and I used the new degrees option so I wouldn't have to convert the degrees to radians.
  • I used Proc SQL to calculate the average daily rainfall for each city.
  • I used the new Proc Geocode to estimate the latitude/longitude centroid for each city, using sashelp.zipcode as the lookup table (this dataset is updated with fresh data in each new SAS release).
  • When I projected the map, I saved the projection parameters (using the new parmout=option), and I projected the city latitude/longitudes using the same parameters, so they would line up correctly with the map.
  • I annotated the city rain values on the map using annotate's bubble function, and used the html variable in the dataset to encode the tags for the HTML mouse-over text.
  • I downloaded a weather font, and used the new Proc Fontreg to register the font so that SAS could use it. I then annotated the hurricane symbol on the map using  style='Weather Icons/unicode', angle=-45, text='f073'x .
  • I used the following new 1-line syntax to convert the individual maps into a GIF animation:  options dev=sasprtc printerpath=gif animduration=1.2 animloop=0
    animoverlay=no animate=start;

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK