Type: | Package |
Title: | Import Surface Meteorological Data from NOAA Integrated Surface Database (ISD) |
Version: | 0.9.9 |
Maintainer: | David Carslaw <david.carslaw@york.ac.uk> |
Description: | Functions to import data from more than 30,000 surface meteorological sites around the world managed by the National Oceanic and Atmospheric Administration (NOAA) Integrated Surface Database (ISD, see https://www.ncei.noaa.gov/products/land-based-station/integrated-surface-database). |
License: | MIT + file LICENSE |
URL: | https://openair-project.github.io/worldmet/, https://github.com/openair-project/worldmet |
BugReports: | https://github.com/openair-project/worldmet/issues |
Depends: | R (≥ 3.2.0) |
Imports: | doParallel, dplyr, foreach, leaflet, magrittr, openair, parallel, purrr (≥ 1.0.0), readr, tibble, tidyr |
Suggests: | knitr, rmarkdown |
ByteCompile: | true |
Config/Needs/website: | openair-project/openairpkgdown |
Encoding: | UTF-8 |
Language: | en-GB |
LazyData: | true |
LazyLoad: | true |
RoxygenNote: | 7.3.2 |
NeedsCompilation: | no |
Packaged: | 2025-01-14 08:34:53 UTC; davidcarslaw |
Author: | David Carslaw |
Repository: | CRAN |
Date/Publication: | 2025-01-14 09:00:01 UTC |
worldmet: Import Surface Meteorological Data from NOAA Integrated Surface Database (ISD)
Description
Functions to import data from more than 30,000 surface meteorological sites around the world managed by the National Oceanic and Atmospheric Administration (NOAA) Integrated Surface Database (ISD, see https://www.ncei.noaa.gov/products/land-based-station/integrated-surface-database).
Details
This package contains functions to import surface meteorological data from over 30,000 sites around the world. These data are curated by NOAA as part of the Integrated Surface Database (ISD).
If you access these data using the worldmet
package please give full
acknowledgement to NOAA ISD. Users should also take a note of the usage
restrictions.
These data work well with the openair
package that has been developed to
analyse air pollution data.
Author(s)
Maintainer: David Carslaw david.carslaw@york.ac.uk (ORCID)
References
For general information of the ISD see https://www.ncei.noaa.gov/products/land-based-station/integrated-surface-database and the map here https://gis.ncdc.noaa.gov/maps/ncei.
See Also
See https://github.com/openair-project/openair for information on the
related openair
package.
Export a meteorological data frame in ADMS format
Description
Writes a text file in the ADMS format to a location of the user's choosing, with optional interpolation of missing values.
Usage
exportADMS(dat, out = "./ADMS_met.MET", interp = FALSE, maxgap = 2)
Arguments
dat |
A data frame imported by |
out |
A file name for the ADMS file. The file is written to the working directory by default. |
interp |
Should interpolation of missing values be undertaken? If |
maxgap |
The maximum gap in hours that should be interpolated where
there are missing data when |
Value
exportADMS()
returns the input dat
invisibly.
Examples
## Not run:
## import some data then export it
dat <- importNOAA(year = 2012)
exportADMS(dat, out = "~/adms_met.MET")
## End(Not run)
Find a ISD site code and other meta data
Description
Get information on meteorological sites
Usage
getMeta(
site = "heathrow",
lat = NA,
lon = NA,
country = NA,
state = NA,
n = 10,
end.year = "current",
provider = c("OpenStreetMap", "Esri.WorldImagery"),
plot = TRUE,
returnMap = FALSE
)
Arguments
site |
A site name search string e.g. |
lat |
A latitude in decimal degrees to search. Takes the values -90 to 90. |
lon |
A longitude in decimal degrees to search. Takes values -180 to 180. Negative numbers are west of the Greenwich meridian. |
country |
The country code. This is a two letter code. For a full listing see https://www1.ncdc.noaa.gov/pub/data/noaa/isd-history.csv. |
state |
The state code. This is a two letter code. |
n |
The number of nearest sites to search based on |
end.year |
To help filter sites based on how recent the available data
are. |
provider |
By default a map will be created in which readers may toggle
between a vector base map and a satellite/aerial image. |
plot |
If |
returnMap |
Should the leaflet map be returned instead of the meta data?
Default is |
Details
This function is primarily used to find a site code that can be used to
access data using importNOAA()
. Sites searches of approximately 30,000
sites can be carried out based on the site name and based on the nearest
locations based on user-supplied latitude and longitude.
Value
A data frame is returned with all available meta data, mostly
importantly including a code
that can be supplied to importNOAA()
. If
latitude and longitude searches are made an approximate distance, dist
in
km is also returned.
Author(s)
David Carslaw
See Also
getMetaLive()
to download the all meta data to allow re-use and
direct querying.
Examples
## Not run:
## search for sites with name beijing
getMeta(site = "beijing")
## End(Not run)
## Not run:
## search for near a specified lat/lon - near Beijing airport
## returns 'n' nearest by default
getMeta(lat = 40, lon = 116.9)
## End(Not run)
Obtain site meta data from NOAA server
Description
Download all NOAA meta data, allowing for re-use and direct querying.
Usage
getMetaLive(...)
Arguments
... |
Currently unused. |
Value
a tibble
Examples
## Not run:
meta <- getMetaLive()
head(meta)
## End(Not run)
Import Meteorological data from the NOAA Integrated Surface Database (ISD)
Description
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.ncei.noaa.gov/products/land-based-station/integrated-surface-database and the map here https://gis.ncdc.noaa.gov/maps/ncei.
Usage
importNOAA(
code = "037720-99999",
year = 2014,
hourly = TRUE,
n.cores = 1,
quiet = FALSE,
path = NA
)
Arguments
code |
The identifying code as a character string. The code is a
combination of the USAF and the WBAN unique identifiers. The codes are
separated by a “-” e.g. |
year |
The year to import. This can be a vector of years e.g. |
hourly |
Should hourly means be calculated? The default is |
n.cores |
Number of cores to use for parallel processing. Default is 1 and hence no parallelism. |
quiet |
If |
path |
If a file path is provided, the data are saved as an rds file at
the chosen location e.g. |
Details
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.
- latitude
Latitude in decimal degrees (-90 to 90).
- longitude
Longitude in decimal degrees (-180 to 180). Negative numbers are west of the Greenwich Meridian.
- elevation
Elevation of site in metres.
- wd
Wind direction in degrees. 90 is from the east.
- ws
Wind speed in m/s.
- ceil_hgt
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.
- atmos_pres
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. The sum of this column should give the annual precipitation.
- precip_6
6-hour precipitation in mm.
- precip
This value of precipitation spreads the 12-hour total across the previous 12 hours.
- 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 combining 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
.
Value
Returns a data frame of surface observations. The data frame is
consistent for use with the openair
package. Note that 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. The
lubridate package is useful in this
respect.
Author(s)
David Carslaw
See Also
getMeta()
to obtain the codes based on various site search
approaches.
Examples
## Not run:
## use Beijing airport code (see getMeta example)
dat <- importNOAA(code = "545110-99999", year = 2010:2011)
## End(Not run)
Codes for weather types
Description
This data frame consists of the weather description codes used in the ISD. It is not of general use to most users.
Usage
weatherCodes
Format
An object of class tbl_df
(inherits from tbl
, data.frame
) with 100 rows and 2 columns.
Details
- pwc
Weather code, which can be merged with the
pwc
column inimportNOAA()
datasets.- description
Description associated with the weather codes.
Examples
weatherCodes