worldmet - R package for accessing NOAA Integrated Surface Database (ISD) meteorological observations
worldmet provides an easy way to access data from the NOAA Integrated
Surface Database (ISD). The ISD contains detailed surface
meteorological data from around the world for over 35,000
locations. See also the
map.
The package outputs (typically hourly meteorological data) work very well with the openair package.
Installation of worldmet from GitHub is easy using the devtools
package.
require(devtools)
install_github('davidcarslaw/worldmet')To search for meteorological sites the user can search by the name or partial name of the site in upper or lower case. The getMeta function will return all site names that match the search string. The most important information returned is the code, which can then be supplied to the importNOAA function that downloads the data.
For example, to search for site "heathrow":
## user getMeta function to search for sites
## note code to be used in importNOAA
getMeta(site = "heathrow")
USAF WBAN STATION CTRY ST CALL LAT LON ELEV(M) BEGIN END
1687 037720 99999 HEATHROW UK EGLL 51.478 -0.461 25.3 1948-12-01 2015-06-12
code
1687 037720-99999Often we have a latitude / longitude of interest. A search can be made based on supplied decimal coordinates and the top n nearest sites are returned.
## search for near a specified lat/lon - near Beijing airport
## returns 'n' nearest by default
getMeta(lat = 40, lon = 116.9)
USAF WBAN STATION CTRY ST CALL LAT LON
11705 545110 99999 BEIJING - CAPITAL INTERNATIONAL AIRPORT CH ZBAA 40.080 116.585
11711 545270 99999 TIANJIN CH 39.100 117.167
11712 545273 99999 BINHAI CH ZBTJ 39.124 117.346
11715 545340 99999 TANGSHAN CH 39.650 118.100
11687 544050 99999 HUAILAI CH 40.417 115.500
11666 543080 99999 FENGNING CH 41.200 116.633
11689 544230 99999 CHENGDE CH 40.967 117.917
11691 544360 99999 QINGLONG CH 40.400 118.950
11716 545390 99999 LETING CH 39.433 118.900
11724 546020 99999 BAODING CH 38.733 115.483
ELEV(M) BEGIN END code longR latR dist
11705 35.4 1945-10-31 2015-06-12 545110-99999 2.034792 0.6995280 28.25299
11711 5.0 1956-08-20 2015-06-11 545270-99999 2.044950 0.6824237 102.66020
11712 3.0 1981-11-25 2015-06-12 545273-99999 2.048074 0.6828426 104.64104
11715 29.0 1956-08-20 2015-06-11 545340-99999 2.061234 0.6920230 109.61783
11687 538.0 1956-08-20 2015-06-12 544050-99999 2.015855 0.7054097 127.60780
11666 661.0 1957-06-01 2015-06-12 543080-99999 2.035630 0.7190757 135.32440
11689 423.0 1956-08-20 2015-06-12 544230-99999 2.058040 0.7150090 137.69215
11691 228.0 1957-06-02 2015-06-12 544360-99999 2.076069 0.7051130 179.69364
11716 12.0 1957-06-01 2015-06-11 545390-99999 2.075196 0.6882357 182.30889
11724 17.0 1956-08-20 2015-06-12 546020-99999 2.015559 0.6760184 186.23783To obtain the data the user must supply a code (see above) and year or years of interest. For example, to download data for Heathrow Airport in 2010 (code 037720-99999):
dat <- importNOAA(code = "037720-99999", year = 2010)
head(dat)
|=====================================================================|100% ~0 s remaining Source: local data frame [6 x 23]
date usaf wban code station lat lon elev wd
(time) (chr) (int) (chr) (chr) (dbl) (dbl) (dbl) (dbl)
1 2010-01-01 00:00:00 037720 99999 037720-99999 HEATHROW 51.483 -0.45 25 17.3515933
2 2010-01-01 01:00:00 037720 99999 037720-99999 HEATHROW 51.483 -0.45 25 6.1317598
3 2010-01-01 02:00:00 037720 99999 037720-99999 HEATHROW 51.483 -0.45 25 15.5928825
4 2010-01-01 03:00:00 037720 99999 037720-99999 HEATHROW 51.483 -0.45 25 17.0497878
5 2010-01-01 04:00:00 037720 99999 037720-99999 HEATHROW 51.483 -0.45 25 0.6056525
6 2010-01-01 05:00:00 037720 99999 037720-99999 HEATHROW 51.483 -0.45 25 356.4417142
Variables not shown: ws (dbl), ceil_hgt (dbl), visibility (dbl), air_temp (dbl), dew_point
(dbl), atmos_pres (dbl), RH (dbl), cl_1 (dbl), cl_1_height (dbl), cl_2 (dbl), cl_2_height
(dbl), cl_3 (dbl), cl_3_height (dbl), cl (dbl)