Closed daniel-althoff closed 2 years ago
Hi there. Elevation only works with single point requests. Please refer to the docs for more and see the error message that the API returns.
Hi there. Elevation only works with single point requests. Please refer to the docs for more and see the error message that the API returns.
This is a single point request
lonlat = c(151.1, -27.5)
I tried this fixes myself (changing length(latlon !=2 )
instead of length(latlon) != 2
) but it returned another error:
get_power_custom(
community = "ag",
lonlat = c(151.5, -27.5),
pars = c('RH2M', 'PSC') ,
dates = c(data_ini, data_fin),
temporal_api = "daily",
site_elevation = 410,
)
>Error: HTTP (422) - The request was well-formed but was unable to be followed due to semantic errors (WebDAV; RFC 4918)
> Please provide a site elevation with the 'PSC' parameter abbreviation.
Could you provide me with an example where the site_elevation is used to retrieve corrected atmospheric pressure?
Thank you
Right! Really sorry, I looked on my phone and didn't inspect closely. You've found a bug. I've patched it in the devel branch and will get a new release on CRAN as soon as I can!
https://github.com/ropensci/nasapower/commit/5858247a9f21e529268e511a70415b862707a8dc
closed with 5858247
Hi Adam!
I recommend you to test the corrected code before pushing the new release. I tried a custom fix for that, but the function still did not return PSC (PS corrected) for a point request. So maybe there is something else going on.
Thanks again!
Hmm. I did test it and it seems to work but I guess I don’t know what it should look like otherwise?
Can you please provide me with a correct example to match against?
On 25 Feb 2022, at 22:09, Daniel Althoff @.***> wrote:
closed with 5858247
Hi Adam!
I recommend you to test the corrected code before pushing the new release. I tried a custom fix for that, but the function still did not return PSC (PS corrected). So maybe there is something else going on.
Thanks again!
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you modified the open/close state.
I think you can only check if it is working properly by passing the "PSC" to "pars" argument. Example:
library(nasapower)
get_power_custom(
community = "ag",
lonlat = c(151.5, -27.5),
pars = c("RH2M", "PSC"),
dates = "1985-01-01",
temporal_api = "daily",
site_elevation = 400
)
Even after the fix, I get the following now:
Erro: HTTP (422) - The request was well-formed but was unable to be followed due to semantic errors (WebDAV; RFC 4918)
Please provide a site elevation with the 'PSC' parameter abbreviation.
I have tried digging into internal functions but could not figure it out. Could be something related to the query?
Instead of sending siteElev
, maybe it should be site-elevation
?
I think a while back it used to be siteElev, but now is site-elevation.
API example: /api/temporal/daily/point?parameters=T2M&community=SB&longitude=0&latitude=0&start=20170101&end=20170201&format=JSON&site-elevation=50
I installed the latest version and it seems to be working properly! I'm now closing this. Thank you so much.
Describe the bug The script has a problem that requires fixing for site_elevation and wind_elevation. On lines 243 and 250 (https://github.com/ropensci/nasapower/blob/main/R/get_power.R) it says
length(latlon !=2 )
instead oflength(latlon) != 2
Code to Reproduce
Expected behaviour Return atmospheric pressure corrected by elevation
OS and R versions (please complete the following information): R version 4.1.1 (2021-08-10) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 19043)
I tried a workaround to get the atmospheric pressure corrected by elevation, but it doesn't seem to work., even when including the variable "PSC" in pars.