When the recent earthquake
hit California, one of my friends commented that “California is so dry right now, I’m surprised it didn’t just break off and fall into the ocean!”
It got me wondering, just how bad and widespread is California’s drought? I did a few web searches and found lots of dramatic before-and-after pictures of its lakes, which are down to about 35% of capacity statewide. Some of the pictures made me think of southern Peru, and how huge bays and bodies of water there had turned into deserts (millions of years ago), leaving behind fossils of whales, which I got to see a few years ago. Here’s a picture I took of my buddy Joe taking a picture of one of those whale fossils.
Of course, we’re all glad California didn’t fall into the ocean, and I’m sure it’ll make a comeback from this drought… but it got me wondering what data is available, and how I might visually analyze it.
I found that the water.weather.gov site provides shapefiles containing precipitation data. I downloaded the current data for the last 60 days, showing the rainfall in each area of the US as a percent of the average rainfall for that time period. I used Proc Mapimport to get the data into SAS, and found that it was point data (rather than polygons), so I couldn’t use Proc Gmapdirectly on the data. But I was able to use annotate to color code the points and place them on a blank Gmap. The points are so dense that they have no space between them and produce what looks like a contour map.
And here’s the map! It definitely shows that most of California has had dramatically less rainfall during the past 60 days than the historical average. Here’s a link to the code, if you want to try creating your own maps.
This post originally appeared on The SAS Training Post blog.