4  Access meteorological data

Author

David Carslaw

Abstract
Meteorological data is key to understanding air quality measurements. This section describes a fast and convenient way of accessing meteorological data for sites worldwide.

4.1 The worldmet package

Most of the import functions described in Chapter 3 return basic modelled hourly meteorological data (wind speed, wind direction and surface temperature). These data are derived from the WRF model that Ricardo runs to provide the data.

Alternatively it may be advantageous to use surface measurements. worldmet provides an easy way in which to access surface meteorological data from >30,000 sites across the world. The package accesses the NOAA webservers to download hourly data. See https://github.com/davidcarslaw/worldmet and https://www.ncdc.noaa.gov/isd for further information.

Access to surface meteorological data is very useful in general but is especially useful when using openair and functions such as polarPlot. To install the package, type:

install.packages("worldmet")

There are two main functions in the package: getMeta and importNOAA. The former helps the user find meteorological sites by name, country and proximity to a location based on the latitude and longitude. getMeta will also return a code that can be supplied to importNOAA, which then imports the data.

Probably the most common use of getMeta is to search around a location of interest based on its latitude and longitude. First we will load the worldmet (and other packages we use later):

As an example, we will search for the 10 nearest sites to Dublin (latitude = 53.3, longitude = -6.3)1:

getMeta(lat = 53.3, lon = -6.3, returnMap = TRUE)
Figure 4.1: Map of returned area of interest. The user can interactively select a site of interest and find its code to import data.

Note that it is just as easy to access all the site information at once because it is quick to use the map to select the site and its code i.e.

We can use the map that is produced to select a site of interest and import the data. For example, to import data for Dublin Airport and look at some of the data:

dublin_met <- importNOAA(code = "039690-99999", year = 2019)

# first few lines of data
dublin_met
# A tibble: 8,760 × 24
   code         station date                latitude longitude  elev    ws    wd
   <fct>        <fct>   <dttm>                 <dbl>     <dbl> <dbl> <dbl> <dbl>
 1 039690-99999 DUBLIN… 2019-01-01 00:00:00     53.4     -6.27  73.8  5.07  250 
 2 039690-99999 DUBLIN… 2019-01-01 01:00:00     53.4     -6.27  73.8  4.73  247.
 3 039690-99999 DUBLIN… 2019-01-01 02:00:00     53.4     -6.27  73.8  4.07  250 
 4 039690-99999 DUBLIN… 2019-01-01 03:00:00     53.4     -6.27  73.8  4.4   250 
 5 039690-99999 DUBLIN… 2019-01-01 04:00:00     53.4     -6.27  73.8  5.47  257.
 6 039690-99999 DUBLIN… 2019-01-01 05:00:00     53.4     -6.27  73.8  4.9   260 
 7 039690-99999 DUBLIN… 2019-01-01 06:00:00     53.4     -6.27  73.8  4.9   260 
 8 039690-99999 DUBLIN… 2019-01-01 07:00:00     53.4     -6.27  73.8  4.4   254.
 9 039690-99999 DUBLIN… 2019-01-01 08:00:00     53.4     -6.27  73.8  5.27  270 
10 039690-99999 DUBLIN… 2019-01-01 09:00:00     53.4     -6.27  73.8  4.73  263.
# ℹ 8,750 more rows
# ℹ 16 more variables: air_temp <dbl>, atmos_pres <dbl>, visibility <dbl>,
#   dew_point <dbl>, RH <dbl>, ceil_hgt <dbl>, cl_1 <dbl>, cl_2 <dbl>,
#   cl_3 <dbl>, cl <dbl>, cl_1_height <dbl>, cl_2_height <dbl>,
#   cl_3_height <dbl>, precip_12 <dbl>, precip_6 <dbl>, precip <dbl>

Plot a wind rose.

windRose(dublin_met)
Figure 4.2: Example wind rose for Dublin Airport data.

  1. Note that returnMap was only used to display the map in this document and would not normally be needed.↩︎