Learn R Programming

worldmet (version 0.8.8)

importNOAA: Import meteorological data

Description

Main function for importing meteorological data

Usage

importNOAA(
  code = "037720-99999",
  year = 2014,
  hourly = TRUE,
  precip = FALSE,
  PWC = FALSE,
  parallel = TRUE,
  quiet = FALSE,
  path = NA
)

Arguments

code

The identifing code as a character string. The code is a combination of the USAF and the WBAN unique identifiers. The codes are sperated by a “-” e.g. code = "037720-99999".

year

The year to import. This can be a vector of years e.g. year = 2000:2005.

hourly

Should hourly means be calculated? The default is TRUE. If FALSE then the raw data are returned.

precip

Should precipitation measurements be returned? If TRUE the 12-hourly and 6-hourly totals are returned (if available). In addition, an hourly sequence is also returned, as described below.

PWC

Description of the present weather conditions (if available).

parallel

Should the importing use mutiple processors? By default the number of cores - 1 are used.

quiet

If FALSE, print missing sites / years to the screen.

path

If a file path is provided, the data are saved as an rds file at the chosen location e.g. path = "C:/Users/David". Files are saved by year and site.

Value

Returns a data frame of surface observations. The data frame is consistent for use with the openair package. NOTE! the data are returned in GMT (UTC) time zone format. Users may wish to express the data in other time zones e.g. to merge with air pollution data.

Details

This is the main function to import data from the NOAA Integrated Surface Database (ISD). The ISD contains detailed surface meteorological data from around the world for over 30,000 locations. For general information of the ISD see https://www.ncdc.noaa.gov/isd and the map here https://gis.ncdc.noaa.gov/map/viewer/#app=cdo&cfg=cdo&theme=hourly&layers=1.

Note the following units for the main variables:

date

Date/time in POSIXct format. Note the time zone is GMT (UTC) and may need to be adjusted to merge with other local data. See details below.

lat

Latitude in decimal degrees (-90 to 90).

lon

Longitude in decimal degrees (-180 to 180). Negative numbers are west of the Greenwich Meridian.

elev

Elevention of site in metres.

wd

Wind direction in degrees. 90 is from the east.

ws

Wind speed in m/s.

sky_ceiling

The height above ground level (AGL) of the lowest cloud or obscuring phenomena layer aloft with 5/8 or more summation total sky cover, which may be predominantly opaque, or the vertical visibility into a surface-based obstruction.

visibility

The visibility in metres.

air_temp

Air temperature in degrees Celcius.

dew_point

The dew point temperature in degrees Celcius.

sea_level_press

The sea level pressure in millibars.

RH

The relative humidity (%).

cl_1, ..., cl_3

Cloud cover for different layers in Oktas (1-8).

cl

Maximum of cl_1 to cl_3 cloud cover in Oktas (1-8).

cl_1_height, ..., cl_3_height

Height of the cloud base for each later in metres.

precip_12

12-hour precipitation in mm.

precip_6

6-hour precipitation in mm.

precip

Based on the 12 hourly and 6 hourly totals, precip

spreads the 6-hourly totals across the previous 6-hours to provide an indication of hourly precipitation.

pwc

The description of the present weather description (if available).

The data are returned in GMT (UTC). It may be necessary to adjust the time zone when comining with other data. For example, if air quality data were available for Beijing with time zone set to "Etc/GMT-8" (note the negative offset even though Beijing is ahead of GMT. See the openair package and manual for more details), then the time zone of the met data can be changed to be the same. One way of doing this would be attr(met$date, "tzone") <- "Etc/GMT-8" for a meteorological data frame called met. The two data sets could then be merged based on date.

See Also

getMeta to obtain the codes based on various site search approaches.

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
## use Beijing airport code (see getMeta example)
dat <- importNOAA(code = "545110-99999", year = 2010:2011)
# }

Run the code above in your browser using DataLab