The airnow_createMetaDataframes() function uses the airnow_downloadSites() function to download site metadata from AirNow and restructures that data into a format that is compatible with the PWFSLSmoke package ws_monitor data model.

The meta dataframe in the ws_monitor data model has metadata associated with monitoring site locations for a specific parameter and must contain at least the following columns:

  • monitorID -- per deployment unique ID

  • longitude -- decimal degrees E

  • latitude -- decimal degrees N

  • elevation -- height above sea level in meters

  • timezone -- olson timezone

  • countryCode -- ISO 3166-1 alpha-2

  • stateCode -- ISO 3166-2 alpha-2

The meta dataframe will have rownames matching monitorID.

This function takes a dataframe obtained from AirNowTech's monitoring_site_locations.dat file, splits it up into separate dataframes, one for each parameter, and performs the following cleanup:

  • convert incorrect values to NA e.g. longitude=0 & latitude=0

  • add timezone information

Parameters included in AirNow data include at least the following list:

  1. BARPR

  2. BC

  3. CO

  4. NO

  5. NO2

  6. NO2Y

  7. NO2X

  8. NOX

  9. NOOY

  10. OC

  11. OZONE

  12. PM10

  13. PM2.5

  14. PRECIP

  15. RHUM

  16. SO2

  17. SRAD

  18. TEMP

  19. UV-AETH

  20. WD

  21. WS

Setting parameters=NULL will generate a separate dataframe for each of the above parameters.

airnow_createMetaDataframes(
  parameters = NULL,
  pwfslDataIngestSource = "AIRNOW",
  addGoogleMeta = TRUE
)

Arguments

parameters

vector of names of desired pollutants or NULL for all pollutants

pwfslDataIngestSource

identifier for the source of monitoring data, e.g. 'AIRNOW'

addGoogleMeta

logicial specifying wheter to use Google elevation and reverse geocoding services

Value

List of 'meta' dataframes with site metadata for unique parameters (e.g: "PM2.5", "NOX").

See also

Examples

if (FALSE) { # Fail gracefully if any resources are not available try({ metaList <- airnow_createMetaDataframes(parameters = "PM2.5") }, silent = FALSE) }