knitr::opts_chunk$set(echo = TRUE)

Create parameters list for internal checks before sending queries to POWER server

These data are used for internal checks to be sure that data requested from the POWER dataset are valid. The POWER list of parameters that can be queried is available as a JSON file. Thanks to raymondben for pointing me to this file.

POWER JSON file

Using jsonlite read the JSON file into R creating a list.

parameters <-
  jsonlite::fromJSON(
    "https://power.larc.nasa.gov/RADAPP/GEODATA/powerWeb/POWER_Parameters_v110.json"
  )

Replace UTF-8 characters in the dataset since R doesn't like this in packages.

parameters$SG_DEC_AVG$climatology_definition <-
  gsub("°",
       " degrees",
       parameters$SG_DEC_AVG$climatology_definition)

parameters$SG_HR_SET_ANG$climatology_definition <-
  gsub("°",
       " degrees",
       parameters$SG_HR_SET_ANG$climatology_definition)

parameters$SG_NOON$climatology_definition <-
  gsub("°",
       " degrees",
       parameters$SG_NOON$climatology_definition)

View list of parameters and units

The following list has the format:

## $PARAMETER_NAME
## [1] "standard_name"

Where PARAMETER_NAME is used in the internal parameters list. The "standard_name" is a longer, more descriptive name for the parameter that may be more instructive to users.

purrr::map(parameters, "standard_name")

Save list for use in nasapower package

Using usethis save the list as an R data object for use in the nasapower package.

usethis::use_data(parameters, overwrite = TRUE)

Session Info

sessioninfo::session_info()


adamhsparks/nasapower documentation built on Dec. 29, 2019, 4:40 a.m.