US drought monitor map​
​by Mads Bahrami
As the east coast of US is being hit by tornadoes and unprecedented flash floods, the west coast and some other parts are badly hit by drought. Also, scientists are getting a better picture of how climate change may have played an important role in rise and decline of many civilizations in history (eg, see this). In this short computational essay, I’ve transformed the data of U.S. Drought Monitor into WL and explore them a bit. A quick looks into last 10 yrs of data may suggest what we have now is as bad as summer 2013.

What is US Drought Map

Here is a quick note from USDM webpage: The U.S. Drought Monitor is a map released every Thursday, showing parts of the U.S. that are in drought. The map uses five classifications: abnormally dry (D0), showing areas that may be going into or are coming out of drought, and four levels of drought: moderate (D1), severe (D2), extreme (D3) and exceptional (D4).

Most current US Drought Monitor Map

In this section, I shall scrape the data from the US Drought Monitor and transform them into proper format in WL.
Get SHP files:
In[]:=
url="https://droughtmonitor.unl.edu/data/shapefiles_m/USDM_current_M.zip";
Get the data:
In[]:=
dt=Import[url,"Data"];
Data dimensions:
In[]:=
dt//Dimensions
Out[]=
{1,4}
Keys (labels) in data:
In[]:=
dt[[1,All,1]]
Out[]=
{LayerName,Geometry,Labels,LabeledData}
In[]:=
(Lookup["Shape_Area"]@Lookup["LabeledData"]@dt[[1]])
2
m
Out[]=

6.98616×
11
10
2
m
,
7.85492×
11
10
2
m
,
9.45741×
11
10
2
m
,
1.29081×
12
10
2
m
,
6.17282×
11
10
2
m

Get the corresponding date from LayerName:
In[]:=
date=StringSplit[Lookup["LayerName"]@dt[[1]],"_"]//Last//DateObject
Out[]=
Tue 31 Aug 2021
Generate the Drought Monitor color scheme:
In[]:=
colors=AssociationThreadRange[0,4],
,
,
,
,
;
Create legends for color scheme:
In[]:=
legend=SwatchLegend[Values[colors],{"D0 Abnormally Dry","D1 Moderate Drought","D2 Severe Drought","D3 Exterem Drought","D4 Exceptional Drought"},LabelStyle->{FontSize->9},LegendFunction->"Frame",LegendLayout->"Column"]
Out[]=
D0 Abnormally Dry
D1 Moderate Drought
D2 Severe Drought
D3 Exterem Drought
D4 Exceptional Drought
Calculate geo area of each category of drought indicator:
In[]:=
AssociationThread{"D0 Abnormally Dry","D1 Moderate Drought","D2 Severe Drought","D3 Exterem Drought","D4 Exceptional Drought"},UnitConvert(Lookup["Shape_Area"]@Lookup["LabeledData"]@dt[[1]])
2
m
,
2
mi

Out[]=
D0 Abnormally Dry
269737.
2
mi
,D1 Moderate Drought
303280.
2
mi
,D2 Severe Drought
365153.
2
mi
,D3 Exterem Drought
498384.
2
mi
,D4 Exceptional Drought
238334.
2
mi

Note that the first number correspond to areas that are only in D0 category, the 2nd one to D0 and D1, the 3rd D0, D1 and D2, the fourth one to D0, D1, D2, and D3, and the last one to D0 through D4. Therefore, to get the overall area that are under eg D2 one has to add D2 through D4; or the overall area under D3, one has to add D3 through D4. In other words,
D
i+1
,...,
D
4
are subset of
D
i
. So for cumulative areas, one gets:
In[]:=
AssociationThread{"D0 Abnormally Dry","D1 Moderate Drought","D2 Severe Drought","D3 Exterem Drought","D4 Exceptional Drought"},Reverse@Accumulate@Reverse@UnitConvert(Lookup["Shape_Area"]@Lookup["LabeledData"]@dt[[1]])
2
m
,
2
mi

Out[]=
D0 Abnormally Dry
1.67489×
6
10
2
mi
,D1 Moderate Drought
1.40515×
6
10
2
mi
,D2 Severe Drought
1.10187×
6
10
2
mi
,D3 Exterem Drought
736718.
2
mi
,D4 Exceptional Drought
238334.
2
mi

Add proper color for each geo-regions based on color scheme:
In[]:=
regions=Transpose[{GeoStyling[#,Opacity[.8]]&/@Values[colors],Lookup["Geometry"]@dt[[1]]}];
Generate geo-viz:
In[]:=
GeoGraphics{EdgeForm[Gray],regions,Inset[legend,GeoPosition[{28,-71.5}]]},GeoRange
Continental US states
ADMINISTRATIVE DIVISIONS
,GeoProjection"Mercator",PlotLabel"US Drought Monitor, "<>DateString[date],ImageSizeLarge
Out[]=

SHP over yrs

Given what we achieved in the previous section, we now process the available data since 2000.
In[]:=
yrs=First/@Import["https://droughtmonitor.unl.edu/data/shapefiles_m//"<>ToString[#]<>"_USDM_M.zip",{"*.zip","Data"}]&/@Range[2010,2021];
Dimensions (10 yrs, each one 52 weeks, and for each week, 4 labeled data):
In[]:=
yrs//Dimensions
Out[]=
{12}
Flatten data (609 data points per each week)
In[]:=
Flatten[yrs,1]//Dimensions
Out[]=
{609,4}
Take a week sample:
In[]:=
sample=RandomChoice[Flatten[yrs,1]];
Note that not all categories are included for each week. For example, in above sample, we have only D0, D1 and D2.
In[]:=
Lookup["DM"][Lookup["LabeledData"][sample]]
Out[]=
{0,1,2,3,4}
In[]:=
newcolors=colors[#]&/@Lookup["DM"][Lookup["LabeledData"][sample]]
Out[]=

,
,
,
,

In[]:=
regions=Transpose[{GeoStyling[#,Opacity[.8]]&/@newcolors,Lookup["Geometry"]@sample}];
In[]:=
date=StringSplit[Lookup["LayerName"]@sample,"_"]//Last//DateObject
Out[]=
Tue 28 Jun 2016
In[]:=
GeoGraphics{EdgeForm[Gray],regions,Inset[legend,GeoPosition[{28,-71.5}]]},GeoRange
Continental US states
ADMINISTRATIVE DIVISIONS
,GeoProjection"Mercator",PlotLabel"US Drought Monitor, "<>DateString[date],ImageSizeLarge
Out[]=
Merge all previous steps into a function:
geoViz[sample_]:=Module{newcolors,regions,date},​​newcolors=colors[#]&/@Lookup["DM"][Lookup["LabeledData"][sample]];regions=Transpose[{GeoStyling[#,Opacity[.8]]&/@newcolors,Lookup["Geometry"]@sample}];date=StringSplit[Lookup["LayerName"]@sample,"_"]//Last//DateObject;​​GeoGraphics{EdgeForm[Gray],regions,Inset[legend,GeoPosition[{28,-71.5}]]},GeoRange
Continental US states
ADMINISTRATIVE DIVISIONS
,GeoProjection"Mercator",PlotLabel"US Drought Monitor, "<>DateString[date],ImageSizeLarge​​
Generate all geo viz:
Export it as GIF

Exploring areas of each category

Define a function to generate area of each drought category:
Generate ares for all data:
A peak into areas:
Turn it into a dataset:
A peak into dataset:
Turn the data of each drought category into a time series visualize it together with 1-mo MovingAverage:
Let us now calculate the % of US area that is in each drought category.
Get US area:
Generate viz of each %:
Overall, it seems that what US is experiencing now is as worth as summer 2013.

Acknowledgment

Special thanks to my friend, Assad Mrad, for sharing USDM data with me.