Total and component (Dust, OC, BC, SS, SO4) surface PM2.5 concentrations from the MERRA-2 M2T1NXAER v5.12.4 product. Because installing MERRA-2 data takes a long time, "pre-compiled" data binaries for each year are available as pre-releases specific to MERRA data on GitHub.
Usage
get_merra_data(x, dates, merra_release = "merra-2025-01-02")
install_merra_data(
merra_year = as.character(2017:2024),
merra_release = "merra-2025-01-02"
)
create_daily_merra_data(merra_date)
Arguments
- x
a vector of s2 cell identifers (
s2_cell
object)- dates
a list of date vectors for the MERRA data, must be the same length as
x
- merra_release
a character string of a release tag from which "pre-compiled" MERRA data binary is used instead of installing latest data from source; see details
- merra_year
a character string that is the year for the merra data
- merra_date
a date object that is the date for the merra data
Value
for get_merra_data()
, a list of tibbles the same
length as x
, each containing merra data columns (merra_dust
, merra_oc
, merra_bc
,
merra_ss
, merra_so4
, merra_pm25
) with one row per date in dates
for install_merra_data()
, a character string path to the merra data
for create_daily_merra_data()
, a tibble with columns for s2,
date, and concentrations of PM2.5 total, dust, oc, bc, ss, so4
Details
Installed data are filtered to a bounding box around the contiguous US, averaged to daily values, and converted to micrograms per cubic meter ($ug/m^3$).
Total surface PM2.5 mass is calculated according to the formula in https://gmao.gsfc.nasa.gov/reanalysis/MERRA-2/FAQ/#Q4
Set options("appc_install_data_from_source"), or the environment variable
APPC_INSTALL_DATA_FROM_SOURCE
to any non-empty value to install MERRA-2 directly from their sources instead of using the released GitHub data binary.An Earthdata account linked with permissions for GES DISC is required. The
EARTHDATA_USERNAME
andEARTHDATA_PASSWORD
must be set. If a.env
file is present, environment variables will be loaded using the dotenv package.Set a proxy to be used by all httr calls in the merra functions with
httr::set_config(httr::use_proxy( ... ))
Examples
d <- list(
"8841b39a7c46e25f" = as.Date(c("2023-05-18", "2023-11-06")),
"8841a45555555555" = as.Date(c("2023-06-22", "2023-08-15"))
)
get_merra_data(x = s2::as_s2_cell(names(d)), dates = d)
#> $`8841b39a7c46e25f`
#> # A tibble: 2 × 6
#> merra_dust merra_oc merra_bc merra_ss merra_so4 merra_pm25
#> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 1.77 6.84 0.532 0.994 2.43 13.5
#> 2 0.842 2.65 0.392 0.244 2.21 7.17
#>
#> $`8841a45555555555`
#> # A tibble: 2 × 6
#> merra_dust merra_oc merra_bc merra_ss merra_so4 merra_pm25
#> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 1.34 2.52 0.327 0.356 3.71 9.64
#> 2 1.18 2.80 0.441 0.722 5.78 13.1
#>