How to Create Interactive Climate Model Maps in Python
This article is originally published at https://plotlyblog.tumblr.com/
“El Niño is likely this winter,” the forecaster said. “El Niño typically brings above normal winter cloudiness and rainfall across the southern U.S. and milder conditions to Canada…”
You may have heard something like this spoken on your TV, radio, or written on the internet recently. Have you ever wondered how a meteorologist or climatologist comes to such conclusions?
In this post, we’ll show you how to create interactive climate maps using the Copernicus Data Store, where you can visualize, examine, and explore the same data that your local forecaster sees.
Copernicus is a game-changing project that “makes information about the past, present, and future climate freely available, and functions as a one-stop shop for users to explore climate data.” Access to data is open, free and unrestricted.
We have entered a golden age of freely available weather and climate data on the web - spanning time horizons from the next few hours or days and even into the coming weeks or months. NOAA’s NCEP NOMADS is a treasure trove of such information and now ECMWF’s [European Centre for Medium Range Weather Forecasts] Copernicus Climate Data Store has burst onto the scene.
Before we start mapping, let’s get set up with Copernicus. We’ll use their API to get the climate data for our visualizations.
Getting started is easy:
1. Make an account here.
2. Navigate to the ’data store’ portion of the site.
3. In this post, ‘seasonal forecast’ datasets will be considered (access here).
For further weather and climate map inspiration, check out our post ’How to Create 2D and 3D Interactive Weather Maps in Python and R’.
1. Download your first dataset
In the climate forecasting space, anomalies (difference from average) are often the most frequently examined data. While looking at raw outputs can be useful in some circumstances, understanding how much warmer, cooler, drier, or wetter than normal an area may be is the end goal. For the purposes of this post, we’ll be looking at forecast anomalies.
In order to download the data in NetCDF format (the file type you’ll need to work with the climate data in Plotly, you will have to install the Climate Data Store Application Program Interface (CDS API). For Python users, this step should be pretty straightforward:
1. Install the CDS API key and store it in your home directory.
2. Install the CDS API client “pip install cdsapi.”
Now let’s download some data 👌
We’ll start off with a sea surface temperature dataset from the ECMWF model, often considered the gold standard when it comes to weather and climate prediction. Follow this link to the data and navigate to the “Download Data” tab in the page.
Under the “Download Data” tab, you’ll find a form where you can specify the data you’d like to download through the API. Selections in this form will create an API request for the desired data. To view this request, fill out the form and click the red “Show API request” button at the bottom-left beneath the form.
Fill out your form like this:
Then, click the “Show API request” to reveal your request. (“Hide API request” tucks it away again.)
Next, copy the API request and paste it into a Jupyter notebook. Remember when we mentioned that it needs to be in NetCDF format? This is where we’ll take change the requested file format from GRIB to NetCDF:
Click HERE for an example Jupyter Notebook to download and process the climate data.
2. Your first plot: Sea Surface Temperature Anomaly
Now you should have your dataset in your home directory! Next, we leverage the power of Python with Plotly to view and inspect climate data in a new, interactive format that enables you to zoom to low levels for greater detail.
Gone are the days of worrying about whether data for your country will show, in this case we’ll produce a world map with data that covers the Earth 👌 🗺
The first plot shows sea surface temperature anomalies, or a difference from the average sea surface temperature at a given location (or grid box).
Sea surface temperature anomalies are particularly important in the tropical oceans, as anomalies help to modify the Walker Circulation, whose behavior play a major role in precipitation (and temperature) patterns across the global tropics (and to a lesser extent the middle latitudes).
Early in 2019, we have an El Niño signature in the tropical Pacific Ocean. The warmest sea surface temperatures (and anomalies) are located across the west-central equatorial Pacific, which has been an area of consistent atmospheric lift, increased cloud cover, and precipitation.
You can download the Jupyter Notebook here and use it to make all the plots below.
3. Air Temperature Anomaly
This plot looks at the forecast temperature anomaly, in Celsius, for the month of March 2019. The model data again comes from the ECMWF, although the Copernicus data store hosts four additional models from institutions across Europe: UK Met Office (UKMO), Météo France, Deutscher Wetterdienst (DWD), and Centro Euro-Mediterraneo sui Cambiamenti Climatici (CMCC).
Red colors show warmer-than-average temperatures while blue indicates below-average temperatures.
4. Precipitation Anomaly
This plot examines precipitation rate anomaly in mm/second for the month of March 2019.
Precipitation is often considered one of the most challenging parameters to forecast. Generally speaking, precipitation outlooks have lower confidence than temperature outlooks.
This is because precipitation (rain, snow) can be irregular in coverage and intensity. There may be sharp differences in amounts over short distances, depending on the lay of the land (e.g. more in the mountain ranges, less in the valleys). Compared to temperature, it is generally much less uniform and therefore a more frequent forecast challenge.
In the chart below, negative values (blues) indicate below-normal monthly precipitation while positive values (yellows, oranges) indicate above-normal monthly precipitation.
So, with this wealth of climate data at your fingertips, get graphing with Plotly and start exploring your world in a new way!
Please visit source website for post related comments.