Monthly Archives: May 2017

Surface wind speeds and directions from MERA

Previous posts have discussed software tools for extracting and visualising data from GRIB archives. With some help, I’ve used Panoply to read and visualise surface wind speeds from the sample Met Eireann Reanalysis (MERA) data files.

Separate GRIB archives of the u- and v- components of the horizontal surface (10 m) wind velocity are provided. Panoply can import multiple datasets and it can also be used to combine the u- and v- components in order to visualise surface wind speeds and directions. This page from NASA’s Goddard’s Earth Science Data and Information Services Center describes how to do this.

Here’s an example of the output from 03:00, 1st June 2015, with prediction intervals of 1, 2 and 3 hours respectively:


10 m surface wind speeds (m/s) and vectors from MERA from 03:00 the 1st June 2015, with prediction intervals of 1, 2 and 3 hours.

I’m still unsure of the timestamp convention. For each of these images, Panoply reported the “GRIB reference time” as 2015-06-01 15:00+0000. The corresponding “GRIB Forecast or Observation Time” entries are 2015-06-01 01:00+0000, 2015-06-01 02:00+0000 and 2015-06-01 03:00+0000. This is a bit confusing because the Forecast times appear to be before the reference time but I think it may just be a glitch in either the GRIB file or in how it is handled by Panoply. My interpretation is that these charts correspond to the model run for 2015-06-01 15:00 for prediction intervals of 1h, 2h and 3h, i.e. for 16:00, 17:00 and 18:00 on the same day as the model run. Met Eireann’s paper from the European Meteorological Society Conference states that 3 hours of predictions are supplied for each model run, apart from the 00:00Z run.

Next step: to ‘slice and dice’ these data in order to get time series of wind speeds for a particular location. Panoply seems to be able to do this, but wgrib might be a bit more practical when it comes to larger datasets.

Extracting reanalysis data from GRIB files

GRIB is a compact binary data format, widely used for gridded climate and weather forecast data. There are two widely-used variants, GRIB1 and GRIB2. The Met Eireann MERA dataset uses the GRIB1 format.

Meteorologists are very familiar with GRIB, but what is the best (i.e. easiest) way for an occasional user to extract data from GRIB files? For example, I would like to examine MERA 10 m surface wind speeds at a particular location.

A huge number of software tools for handling GRIB data is available. Most tools are native to Unix. Many are supplied as source code for the user to compile on their chosen platform. Some have been ported to Windows by others, but most of these Windows versions betray their unix origins via requirements for cygwin or additional libraries in order to run. I run Windows 99% of the time and I’d prefer not to have to compile source code, and I don’t want to read huge user manuals, so what is the best option?

Here are a few I ran through before settling on the final one in the list:

  • wgrib and wgrib2. Precompiled windows binaries available from http://wesley.wwb.noaa.gov/wgrib.html. I couldn’t get wgrib to run from the command line in Windows 7, and received the error STATUS_ACCESS_VIOLATION when I tried to list the inventory of a sample GRIB file.
  • CDO, a collection of functions to manipulate climate data. Again, a simple command ‘cdo info’ resulted in an error (“numberOfPoints and gridSize differ”). There are a lot of commmand-line options for cdo so this can quite possibly be overcome, but it doesn’t look straightforward.
  • Panoply, from NASA Goddard Institute for Space Studies. Panoply appears to be more of a viewing tool than a data extraction tool and supports multiple formats including GRIB. It requires the java runtime engine. This also produced an error when I tried to use it to open a GRIB-1 file.
  • OpenGRADS on Windows, using the cygwin library. I didn’t have much success with this, but my installation is a few years old, and there is a new “Win32 superpack” available now, which promises to run completely in stand-alone mode.
  • There are also Matlab toolboxes (e.g. nctoolbox), which typically rely on libraries compiled as .MEX objects. As I don’t really need to access GRIB data directly from Matlab, I discounted these.
  • Finally I settled back on using wgrib, this time running on a virtual machine (lubuntu) via Oracle VirtualBox. This worked straightaway and wgrib is very widely used so there is plenty of online documentation available.

Update 19/05/2017

After some problems with sharing files from Windows to my virtual lubuntu box, Lucia Hermida Gonzalez suggested trying Panoply on Windows again, and pointed out a critical setting — disabling “strict mode” for GRIB-1 datasets. When this is done (accessed via the Panoply menu option Preferences>Files>Launch/Open), Panoply can open and visualise the data in Met Eireann’s sample MERA GRIB files. I will show some very basic visualisations of the MERA surface wind fields in a subsequent post.

New Met Eireann high resolution reanalysis dataset

Met Eireann recently announced that it plans to make a high-resolution reanalysis dataset available online. The MERA dataset is based on high-resolution (2.5 km horizontal) runs of the HIRLAM numerical weather prediction model. It covers the time period 1981-2015. The area covered includes Ireland, the United Kingdom, and some of Northern France. The coverage unfortunately seems to stop short of Rennes by a few kilometers!

MERA coverage

MERA dataset spatial coverage, image from Gleeson, E.; Whelan, E. & Hanley, J. Met Éireann high resolution reanalysis for Ireland. Advances in Science & Research Open Access Proceedings, 2017, 14, 49-61

This looks like it will be very useful for wind resource studies, and possibly for wind forecasting studies too, as the dataset is based on 3h forecasts from HIRLAM, with a 33h forecast produced once per day at 00:00Z.

Met Eireann has provided some samples of the data online. The MERA project is described in greater detail by Gleeson et al. in their European Meteorological Society open access paper.

A subsequent post here will deal with how to read the MERA output variables from Met Eireann’s GRIB files.

Solar irradiance data from CAMS

We are interested in solar irradiance data for simulating PV microgrids. Pierre Haessig at Supélec introduced me to the CAMS solar irradiance dataset generated by the European Centre for Medium Range Weather Forecasting.

Description from the CAMS website:

[CAMS provides] time series of Global, Direct, and Diffuse Irradiations on horizontal surface, and Direct Irradiation on normal plane (DNI) for the actual weather conditions as well as for clear-sky conditions. The geographical coverage is the field-of-view of the Meteosat satellite, roughly speaking Europe, Africa, Atlantic Ocean, Middle East (-66° to 66° in both latitudes and longitudes). The time coverage of data is from 2004-02-01 up to 2 days ago. Data are available with a time step ranging from 1 min to 1 month.

Even better, the data are available free-of-charge, subject to a licence agreement. The underlying spatial resolution is 5km.

Preliminary comparisons of 15-minute CAMS global horizontal irradiance with data measured from a solar photovoltaic site under the Sustainable Energy Authority of Ireland’s microgrid trial programme (2011-2012) look very promising. Comparisons for the Dundalk test site (54.0 degrees N, 6.4 degrees W) show good agreement in July, and some underprediction in January. The CAMS data even seems to capture some of intra-day temporal variability you can see on the 1st July, typical of Ireland’s quite cloudy climate. Dundalk January Irradiance Comparison
Global horizontal irradiance, Dundalk, January 2012, from CAMS and SEAI microgrid PV study (click to zoom).

Solar irradiance comparison, Dundalk, July
Global horizontal irradiance, Dundalk, July 2011, from CAMS and SEAI microgrid PV study (click to zoom).

CAMS supply a Matlab script (also a python version) for importing the data into Matlab. This didn’t work out of the box for me. It calls several helper functions to reformat dates, and I had to write these myself. These are available on my github repository. The repository also contains a script to import SEAI microgrid data, and the script that generated the plots above.