Total and component (Dust, OC, BC, SS, SO4) surface PM2.5 concentrations from the MERRA-2 M2T1NXAER v5.12.4 product.
Usage
get_merra_data(x, dates)
install_merra_data(merra_year = as.character(2016:2024))
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_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
To install data from source, 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.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 a proxy to be used by all httr calls in the merra functions with
httr::set_config(httr::use_proxy( ... ))
; e.g.httr::set_config(httr::use_proxy("http://bmiproxyp.chmcres.cchmc.org", 80, Sys.getenv("CCHMC_USERNAME"), Sys.getenv("CCHMC_PASSWORD")))
this installs merra data created using code from version 0.2.0 of the package; version 0.3.0 of the package did not change merra data code
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
#>