-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Limited output of climatology data before error occurred #57
Comments
If it works with 30 coordinates but not 31, this seems that it's an API issue, not a client issue. I'm sorry, I'm not sure what I can do for you? The client seems to work as I intended it to. This is something to ask of the POWER team, I think. They have information on how to mirror the database, which sounds like it's better for your needs than using this client. |
Thanks very much for your prompt reply! I will contact the POWER team. |
FYI, below is the reply from the POWER team: The POWER API has a limit of 30 request per minute on the climatology endpoint. I would recommend slowing your API requests. In the future, we will be increasing the requests per minute but currently to enable access for all users we have that limit set. Thank you, The NASA POWER Team |
Thanks. I can easily add this to the docs. |
Coming back to this, I did better than just document it. I have a version in development now that respects the API's limits. I've implemented a test that uses your example, which passes, indicating that the rate-limiting I've put in place works properly. So thank you for raising this. I'll include it in the v4.0.1 release. |
Describe the bug
When I try and apply the nasapower::get_power function to get climatology data with more than 31 latitude/latitude coordinates I receive an error when it is used with the map2 function. Is there a limit to the number of rows of climatology data I can download, or is there an error in my code? On the NASA website I was not able to see if there is a download limit. I have thousands of locations to do this for so any help would be much appreciated!
Code to Reproduce
library("nasapower")
get_power_location <- function(lon,lat) {
nasapower::get_power(
community = "ag",
lonlat = c(lon, lat),
site_elevation = NULL,
wind_elevation = NULL,
wind_surface = NULL,
pars = c("RH2M", "T2M"),
temporal_api = "climatology"
)
}
lon <- c(1:32)
lat <- c(1:32)
A <- purrr::map2( lon,lat,get_power_location)
Error: Something went wrong with the query, no data were returned. Please see https://power.larc.nasa.gov for potential server issues.
Expected behaviour
I expected to receive climatology data for the 31 latitude/longitude coordinates, but received an error instead. When I apply the same code for 30 latitude/longitude coordinates no error arises. This gave me the impression the API has a limit to the number of rows one can download.
OS and R versions:
The text was updated successfully, but these errors were encountered: