ropensci / nasapower

API Client for NASA POWER Global Meteorology, Surface Solar Energy and Climatology in R
https://docs.ropensci.org/nasapower
Other
97 stars 22 forks source link

Error: Unprocessable Entity (HTTP 422) #59

Closed agronomofiorentini closed 3 years ago

agronomofiorentini commented 3 years ago

Describe the bug Hi, Thanks to develop this amazing R package. I am trying to retrive the data as always but now the console gives me as output

"Error: Unprocessable Entity (HTTP 422)"

Do you know what is happening? Maybe is a issue of the server side?

Code to Reproduce

` daily_single_ag_1 <- get_power(community = "AG", lonlat = c(8.465008, 40.62127), pars = c("T10M_MAX", "T10M_MIN"), dates = c("2000-01-01", "2019-12-31"), temporal_average = "CLIMATOLOGY")

`

OS and R versions (please complete the following information):

adamhsparks commented 3 years ago

Hi, I'm unable to duplicate your issue.

[ins] r$> get_power(community = "AG",
          lonlat = c(8.465008, 40.62127),
          pars = c("T10M_MAX", "T10M_MIN"),
          dates = c("2000-01-01", "2019-12-31"),
          temporal_average = "CLIMATOLOGY")

                                                                                                                                                                                                        NASA/POWER CERES/MERRA2 Native Resolution Climatology Climatologies
 30-year Meteorological and Solar Monthly & Annual Climatologies (January 1990 - December 2019)
 Location: Latitude  40.62   Longitude 8.465
 Elevation from MERRA-2: Average for 0.5 x 0.625 degree lat/lon region = 347.73 meters
 Value for missing model data cannot be computed or out of model availability range: NA
 Parameter(s):

 Parameters:
 T10M_MAX     MERRA-2 Temperature at 10 Meters Maximum (C) ;
 T10M_MIN     MERRA-2 Temperature at 10 Meters Minimum (C)

# A tibble: 2 × 16
    LON   LAT PARAMETER   JAN   FEB   MAR   APR   MAY   JUN   JUL   AUG   SEP   OCT   NOV   DEC
  <dbl> <dbl> <chr>     <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1  8.47  40.6 T10M_MAX  19.5   21.9 26.9  30.2  35.1  37.6   39.6  40.1  36.3  31.7 24.8  20.2
2  8.47  40.6 T10M_MIN  -2.25  -2   -1.22  2.23  5.33  9.99  12.2  14.0  10.5   6.2  0.37 -2.19
# … with 1 more variable: ANN <dbl>
Warning message:
`temporal_average has been deprecated for `temporal_api`.
Your query has been modified to use the new terminology for `get_power`.  Please update your scripts to use the new argument.

I suspect this was a server hiccup. Let me know if it continues.

OS and R versions

agronomofiorentini commented 3 years ago

It persists also today.

I think also that is a server hiccup.

I will try the next days and i will let you know.

Thanks for now.

adamhsparks commented 3 years ago

Sorry, I'm unsure what the issue may be. I just checked again from a different location this time and it went through just fine again.

agronomofiorentini commented 3 years ago

I have tried the follow locations

  1. -3.708775, 40.39869
  2. 9.220103, 45.49171
  3. -74.24465, 40.65252

The problem persists.

So I have installed again the nasapower package and now it works fine for the temperature parameters, while for the PRECTOT parameters didn't call any values.

infact the console gives me

temporal_average has been deprecated fortemporal_api. Your query has been modified to use the new terminology forget_power`. Please update your scripts to use the new argument.Errore: PRECTOT is/are not valid in 'pars'. Check that the 'pars', 'community' and 'temporal_api' align.

So i changed the PRECTOT with the PRECTOTCORR but the value that i am getting from the original position is quite strange: -999.

Sorry to keep bothering you

adamhsparks commented 3 years ago

Yes, the precipitation values are corrupted. The POWER webpage did have a notice that this had occurred but that's since disappeared from their page today, however, I note that the values are still not valid for precipitation.

agronomofiorentini commented 3 years ago

It's strange.

I have tried also a new location (13.45042, 43.59642) always in italy and the results is always the same. -999.

What do you think it is better to wait a week and try again or contact the nasapower to report this problem referencing this issue?

adamhsparks commented 3 years ago

From what I understand, the precipitation values are currently corrupted. You will have to wait until they have fixed them or find another resource, e.g. chirps for precipitation data.

agronomofiorentini commented 3 years ago

Thanks a lot.

Marco

fe-neculqueo commented 3 years ago

Hi Adam,

I know that issue had finished but I wish you can tell me another way to get the precipitation values. I tried to use the chirps but I need something close to the nasa power, because the chirps info is not daily refreshed.

best regards,

Fernando

adamhsparks commented 3 years ago

Hi Fernando, At the bottom of the README for this repository, I have this bullet point, maybe the link helps?

The U.S. Earth System Research Laboratory, Physical Science Division of the National Atmospheric & Oceanic Administration (NOAA) maintains a list of gridded climate data sets that provide different data and different resolutions [psl.noaa.gov/data/gridded]https://psl.noaa.gov/data/gridded/).