The process_improve() function reads pipe-delimited IMPROVE
(Interagency Monitoring of Protected Visual Environments) measurement
files downloaded by download_improve() and joins them with a site
metadata table to attach geographic coordinates and auxiliary site
attributes. Returns a
SpatVector, sf, or data.table object.
Arguments
- path
character(1). Directory containing downloaded IMPROVE
.txtfiles.- product
character(1). Product type:
"raw"(default),"rhr2", or"rhr3".- date
character(1 or 2). Date (
"YYYY-MM-DD") or start/end date pair to filter measurements. Defaults to no filtering whenNULL.- sites_file
character(1) or
NULL. Path to a site metadata file. WhenNULL(default), the function first looks for a file namedimprove_sites.txtinsidepath, then falls back to an embedded IMPROVE aerosol site table included inamadeus.- return_format
character(1). Return object type:
"terra","sf", or"data.table".- extent
numeric(4) or
NULL. Optional crop extentc(xmin, xmax, ymin, ymax)in WGS84 / EPSG:4326. Applied only whenreturn_formatis"terra"or"sf".- ...
Placeholders.
Details
Three product types are supported via product:
"raw"IMPAER speciated aerosol mass concentrations. Key columns:
SiteCode,FactDate,ParamCode,FactValue,Units."rhr2"IMPRHR2 Regional Haze Rule II light extinction (
bext, \(Mm^{-1}\))."rhr3"IMPRHR3 Regional Haze Rule III deciview index (
dv).
Measurement values are not filtered by Status; callers
may apply their own validity flags (e.g., keep only Status == "V0").
Note
IMPROVE data are measured on an every-third-day sampling schedule. Gaps between measurement dates are expected.
Examples
improve <- process_improve(
path = system.file("testdata/improve", package = "amadeus"),
product = "raw",
date = c("2022-01-01", "2022-01-31"),
return_format = "data.table"
)