Learn R Programming

PAMscapes (version 0.11.3)

matchGFS: Match GFS Environmental Data

Description

Downloads and matches wind and precipitation data from the Global Forecast System (GFS) weather model. Data is downloaded from the National Center for Atmospheric Research data server https://rda.ucar.edu/datasets/ds084.1/. The particular GFS dataset downloaded is the closest "forecast" dataset to the particular time (e.g. .f000 or .f003)

Usage

matchGFS(x, progress = TRUE, keepMatch = TRUE)

Value

a dataframe with wind (m/s) and precipitation rate (kg/m^2/s) columns added:

windU

Eastward wind velocity

windV

Northward wind velocity

windMag

Total wind magnitude

precRate

Precipitation rate

matchLat

Cosest latitude coordinate matched in GFS

matchLong

Closest longitude coordinate matched in GFS

matchTime

Closest time coordinate matched in GFS

Where the last three columns are only included if keepMatch=TRUE

Arguments

x

a dataframe with columns UTC, Latitude and Longitude to add environmental data to

progress

logical flag to display download progress

keepMatch

logical flag to keep the "matchLat", "matchLong", and "matchTime" columns with the output. These are only used to verify which coordinates within the NetCDF were matched to your data.

Author

Taiki Sakai taiki.sakai@noaa.gov

Examples

Run this code
# API response may be slow for this example
# \donttest{
gps <- data.frame(Latitude=c(33.2, 33.5,33.6),
                  Longitude=c(-118.1, -118.4, -119),
                  UTC=as.POSIXct(
                    c('2022-04-28 05:00:00',
                      '2022-04-28 10:00:00',
                      '2022-04-28 20:00:00'), tz='UTC'))
gps <- matchGFS(gps)
# }

Run the code above in your browser using DataLab