1

I am getting the Error: Unprocessable Entity (HTTP 422) with the get_power function (global meteorology and surface solar energy climatology data) of the NASAPOWER library in R

library(nasapower)
ag_d <- get_power(
  community = "AG",
  lonlat = c(151.81, -27.48),
  pars = c("RH2M", "T2M", "PRECTOT"),
  dates = "1985-01-01",
  temporal_average = "DAILY"
)

Any suggestions!

Ahmed Attia
  • 153
  • 1
  • 8

1 Answers1

4

NASA Power API version 2 was released. The maintainer of nasapower R's package has been updating the codes. Take a look at the github repo. You can find, for example, that PRECTOT was changed to PRECTOTCORR. You can also find the progress here.

They recommend using the in-development version:

if (!require("remotes")) {
  install.packages("remotes")
}

remotes::install_github("ropensci/nasapower")

library("nasapower")

daily_ag <- get_power(community = "ag",
                      lonlat = c(151.81, -27.48),
                      pars = c("RH2M", "T2M", "PRECTOTCORR"),
                      dates = "1985-01-01",
                      temporal_api = "daily"
                      )
daily_ag

Best

  • Saw [this today](https://twitter.com/adamhsparks/status/1429725975311392769?s=20). – Roman Luštrik Aug 23 '21 at 13:28
  • Just in case someone needs the full list of valid `pars` values, you may [look it up here](https://gist.github.com/abelcallejo/d68e70f43ffa1c8c9f6b5e93010704b8). – Abel Callejo Oct 29 '21 at 05:32