Movatterモバイル変換


[0]ホーム

URL:


Type:Package
Title:Global Surface Summary of the Day ('GSOD') Weather Data Client
Version:5.0.0
Description:Provides automated downloading, parsing, cleaning, unit conversion and formatting of Global Surface Summary of the Day ('GSOD') weather data from the from the USA National Centers for Environmental Information ('NCEI'). Units are converted from from United States Customary System ('USCS') units to International System of Units ('SI'). Stations may be individually checked for number of missing days defined by the user, where stations with too many missing observations are omitted. Only stations with valid reported latitude and longitude values are permitted in the final data. Additional useful elements, saturation vapour pressure ('es'), actual vapour pressure ('ea') and relative humidity ('RH') are calculated from the original data using the improved August-Roche-Magnus approximation (Alduchov & Eskridge 1996) and included in the final data set. The resulting metadata include station identification information, country, state, latitude, longitude, elevation, weather observations and associated flags. For information on the 'GSOD' data from 'NCEI', please see the 'GSOD' 'readme.txt' file available from,https://www1.ncdc.noaa.gov/pub/data/gsod/readme.txt.
License:MIT + file LICENSE
URL:https://docs.ropensci.org/GSODR/,https://github.com/ropensci/GSODR
BugReports:https://github.com/ropensci/GSODR/issues
Depends:R (≥ 3.5.0)
Imports:curl, data.table (≥ 1.15.4), lifecycle, R.utils, stats,utils, withr
Suggests:bit64, dplyr, ggplot2, gridExtra, knitr, mapproj, maps,rmarkdown, roxyglobals, spelling, testthat, tidyr
VignetteBuilder:knitr
ByteCompile:TRUE
Config/Needs/build:moodymudskipper/devtag
Config/roxyglobals/filename:globals.R
Config/roxyglobals/unique:FALSE
Config/testthat/edition:3
Config/testthat/parallel:true
Encoding:UTF-8
Language:en-US
NeedsCompilation:no
Repository:CRAN
RoxygenNote:7.3.3
X-schema.org-applicationCategory:Tools
X-schema.org-isPartOf:https://ropensci.org
X-schema.org-keywords:US-NCEI, meteorological-data, global-weather,weather, weather-data, meteorology, station-data,surface-weather, data-access, US-NCDC
Packaged:2025-11-15 12:45:39 UTC; adamsparks
Author:Adam H. SparksORCID iD [aut, cre], Tomislav HenglORCID iD [aut], Andrew NelsonORCID iD [aut], Hugh ParsonageORCID iD [cph, ctb], Taras Kaduk [ctb] (Suggestion for handling bulk station downloads more efficiently), Gwenael Giboire [ctb] (Several bug reports in early versions and testing feedback), Łukasz Pawlik [ctb] (Reported bug in windspeed conversion calculation), Ross DarnellORCID iD [ctb] (Reported bug in 'Windows OS' versions causing 'GSOD' data untarring to fail), Tyler Widdison [ctb] (Reported bug where `nearest_stations()` did not return stations in order of nearest to farthest), Wenbo Lv [ctb] (Provided suggestions for improving documentation), Curtin UniversityROR ID [fnd, cph] (url: http://www.curtin.edu.au/), Grains Research and Development CorporationROR ID [fnd, cph] (Project: GRDC Project CUR2210-005OPX (AAGI-CU))
Maintainer:Adam H. Sparks <adamhsparks@gmail.com>
Date/Publication:2025-11-15 13:00:02 UTC

GSODR: Global Surface Summary of the Day ('GSOD') Weather Data Client

Description

logo

Provides automated downloading, parsing, cleaning, unit conversion and formatting of Global Surface Summary of the Day ('GSOD') weather data from the from the USA National Centers for Environmental Information ('NCEI'). Units are converted from from United States Customary System ('USCS') units to International System of Units ('SI'). Stations may be individually checked for number of missing days defined by the user, where stations with too many missing observations are omitted. Only stations with valid reported latitude and longitude values are permitted in the final data. Additional useful elements, saturation vapour pressure ('es'), actual vapour pressure ('ea') and relative humidity ('RH') are calculated from the original data using the improved August-Roche-Magnus approximation (Alduchov & Eskridge 1996) and included in the final data set. The resulting metadata include station identification information, country, state, latitude, longitude, elevation, weather observations and associated flags. For information on the 'GSOD' data from 'NCEI', please see the 'GSOD' 'readme.txt' file available from,https://www1.ncdc.noaa.gov/pub/data/gsod/readme.txt.

Author(s)

Maintainer: Adam H. Sparksadamhsparks@gmail.com (ORCID)

Authors:

Other contributors:

See Also

Useful links:


Download and Return a data.table Object of GSOD Weather Data

Description

Automates downloading, cleaning, reformatting of data from the Global SurfaceSummary of the Day (GSOD) data provided by theUS National Centers for Environmental Information (NCEI),Three additional useful elements: saturation vapour pressure (es), actualvapour pressure (ea) and relative humidity (RH) are calculated and returnedin the final data frame using the improved August-Roche-Magnus approximation(Alduchov and Eskridge 1996).

Usage

get_GSOD(  years,  station = NULL,  country = NULL,  max_missing = NULL,  agroclimatology = FALSE)

Arguments

years

Year(s) of weather data to download.

station

Optional. Specify a station or multiple stations for which toretrieve, check and clean weather data usingSTATION. TheNCEI reports years for which the data are available. This functionchecks against these years. However, not all cases are properly documentedand in some cases files may not exist for download even though it isindicated that data was recorded for the station for a particular year. If astation is specified that does not have an existing file on the server, thisfunction will silently fail and move on to existing files for download andcleaning.

country

Optional. Specify a country for which to retrieve weatherdata; full name, 2 or 3 letterISO or 2 letterFIPS codescan be used. All stations within the specified country will be returned.

max_missing

Optional. The maximum number of days allowed to bemissing from a station's data before it is excluded from final file output.

agroclimatology

Optional. Logical. Only clean data for stationsbetween latitudes 60 and -60 for agroclimatology work, defaults toFALSE.Set toTRUE to include only stations within the confines of theselatitudes.

Details

All units are converted to International System of Units (SI),e.g,Fahrenheit to Celsius and inches to millimetres.

Data summarise each year by station, which include vapour pressure andrelative humidity elements calculated from existing data inGSOD.

All missing values in resulting files are represented asNA regardless ofwhich field they occur in.

For a complete list of the fields and description of the contents and units,please refer to Appendix 1 in theGSODR vignette,vignette("GSODR", package = "GSODR").

For more information see the description of the data provided byNCEI,https://www.ncei.noaa.gov/data/global-summary-of-the-day/doc/readme.txt.

Value

Adata.table::data.table() object ofGSOD weather data.

References

Alduchov, O.A. and Eskridge, R.E., 1996. Improved Magnus form approximationof saturation vapor pressure. Journal of Applied Meteorology and Climatology,35(4), pp.601-609.doi:10.1175/1520-0450(1996)035<0601:IMFAOS>2.0.CO;2.

Note

GSODR attempts to validate year and station combinationrequests, however, in certain cases the start and end date may encompassyears where no data is available. In these cases no data will be returned.It is suggested that the user check the latest data availability for thestation(s) desired usingget_inventory() as this list is frequentlyupdated by theNCEI and is not shipped withGSODR.

WhileGSODR does not distribute GSOD weather data, users ofthe data should note the conditions that the U.S.NCEI places upontheGSOD data.“The following data and products may have conditions placed on theirinternational commercial use. They can be used within the U.S. or for non-commercial international activities without restriction. The non-U.S. datacannot be redistributed for commercial purposes. Re-distribution of thesedata by others must provide this same notification. A log of IP addressesaccessing these data and products will be maintained and may be madeavailable to data providers.”

Author(s)

Adam H. Sparks,adamhsparks@gmail.com

See Also

reformat_GSOD()

Examples

# Download weather station data for Toowoomba, Queensland for 2010tbar <- get_GSOD(years = 2010, station = "955510-99999")# Download weather data for the year 1929w_1929 <- get_GSOD(years = 1929)# Download weather data for the year 1929 for Irelandie_1929 <- get_GSOD(years = 1929, country = "Ireland")

Download and Return a data.table Object of GSOD Weather Station Data Inventories

Description

[Deprecated]

This function was deprecated because the handling of country inventories haschanged and I did not want to introduce geospatial package dependencies forthis package.

Usage

get_inventory()

Get updates.txt With Information on Updates to the GSOD Data Set

Description

Gets and imports the 'updates.txt' file that has a change log of GSOD data.Changes are shown in order from most recent to oldest changes by the "DATE"field. Column names followGSODR naming conventions.

Usage

get_updates()

Value

Adata.table::data.table() object

Examples

get_updates()

Find Nearest GSOD Stations to a Specified Latitude and Longitude

Description

Given latitude and longitude values entered as decimal degrees (DD), thisfunction returns a list (as an atomic vector) of station IDvalues, which can be used inget_GSOD() to query for specific stations as anargument in thestation parameter of that function.

Usage

nearest_stations(LAT, LON, distance)

Arguments

LAT

Latitude expressed as decimal degrees (DD) (WGS84)

LON

Longitude expressed as decimal degrees (DD) (WGS84)

distance

Distance in kilometres from point for which stations are tobe returned.

Value

Adata.table::data.table() with full station metadata includingthe distance from the user specified coordinates from nearest to farthest.

Note

TheGSOD data, which are downloaded and manipulated byGSODR stipulate that the following notice should be given.“The following data and products may have conditions placed on theirinternational commercial use. They can be used within the U.S. or for non-commercial international activities without restriction. The non-U.S. datacannot be redistributed for commercial purposes. Re-distribution of thesedata by others must provide this same notification.”

Author(s)

Adam H. Sparks,adamhsparks@gmail.com

Examples

# Find stations within a 100km radius of Toowoomba, QLD, AUSn <- nearest_stations(LAT = -27.5598, LON = 151.9507, distance = 100)n

Tidy and Return a data.table Object of GSOD Data From Local Storage

Description

This function automates cleaning and reformatting ofGSOD stationfiles in
“YEAR.tar.gz”, provided that they have been untarred or“STATION.csv” format that have been downloaded from the United StatesNational Center for Environmental Information's (
NCEI)download page. Three additional useful elements: saturation vapour pressure(es), actual vapour pressure (ea) and relative humidity (RH) are calculatedand returned in the final data frame using the improved August-Roche-Magnusapproximation (Alduchov and Eskridge 1996). All units are converted toInternational System of Units (SI),e.g., Fahrenheit to Celsius andinches to millimetres.

Usage

reformat_GSOD(dsn = NULL, file_list = NULL)

Arguments

dsn

User supplied full file path to location of data files on localdisk for tidying.

file_list

User supplied list of file paths to individual files of dataon local disk for tidying. Ignored ifdsn is set. Use if there are otherfiles in thedsn that you do not wish to reformat.

Details

If multiple stations are given, data are summarised for each year by station,which include vapour pressure and relative humidity elements calculated fromexisting data inGSOD. Else, a single station is tidied and a dataframe is returned.

All missing values in resulting files are represented asNA regardlessof which field they occur in.

Only station files in the original “csv” file format are supported bythis function. If you have downloaded the full annual (“YYYY.tar.gz”)file you will need to extract the individual station files from the tar filefirst to use this function.

Note thatreformat_GSOD() will attempt to reformat any “.csv”files found in thedsn that you provide. If there are non-GSODfiles present this will lead to errors.

For a complete list of the fields and description of the contents and units,please refer to Appendix 1 in theGSODR vignette,vignette("GSODR", package = "GSODR").

Value

A data frame as adata.table::data.table() object ofGSOD data.

References

Alduchov, O.A. and Eskridge, R.E., 1996. Improved Magnus form approximationof saturation vapor pressure. Journal of Applied Meteorology and Climatology,35(4), pp.601-609. DOI:<10.1175%2F1520-0450%281996%29035%3C0601%3AIMFAOS%3E2.0.CO%3B2>.

Note

WhileGSODR does not distributeGSOD weather data,users of the data should note the conditions that the U.S.NCEIplaces upon theGSOD data.“The following data and products may have conditions placed on theirinternational commercial use. They can be used within the U.S. or for non-commercial international activities without restriction. The non-U.S. datacannot be redistributed for commercial purposes. Re-distribution of thesedata by others must provide this same notification. A log of IP addressesaccessing these data and products will be maintained and may be madeavailable to data providers.”

Author(s)

Adam H. Sparks,adamhsparks@gmail.com

See Also

For automated downloading and tidying see theget_GSOD() function, whichprovides expanded functionality for automatically downloading and expandingannualGSOD files and cleaning station files.

get_GSOD()

Examples

# Download data to 'tempdir()'download.file(  url =    "https://www.ncei.noaa.gov/data/global-summary-of-the-day/access/2010/95551099999.csv",  destfile = file.path(tempdir(), "95551099999.csv"),  mode = "wb")# Reformat station data files in R's tempdir() directorytbar <- reformat_GSOD(dsn = tempdir())tbar

Download Latest isd-history.csv File and Update an Internal Database

Description

[Deprecated]This function was deprecated because I realised that it broke reproducibilityand the handling of country inventories has changed and I did not want tointroduce geospatial package dependencies for this package.

Usage

update_station_list()

[8]ページ先頭

©2009-2025 Movatter.jp