Comments (20)
You have three options, i) wait for me to have time to complete the rewriting of the nasapower package to work with the new POWER API, ii) access the data directly through the POWER website and download it in your browser or iii) write your own API calls to access the data in R.
I'm doing this in my own personal time and am working on it as fast as I possibly can. This is not a funded or work project in any way. I spent several hours yesterday already working on it and made good progress. I hope to have a beta version shortly.
from nasapower.
I have just try it, and it is working perfectly. So far, i did not find any bugs. Will let you know if something appears. Thanks for your effort adam! This is a great package.
from nasapower.
Hi,
Now that it has migrated to the new API, how can I amend my R code to make it work?
from nasapower.
It hasn't been migrated to the new API yet. I've not had time to finish this work and release v4.0.0 yet, sorry.
from nasapower.
Hi, Ok, thanks for the fast answer.
I thought this was why I got an Error 422 when requesting data with get_power function. Do you know where this could come from?
from nasapower.
I got an Error 442 too. What I should do?
from nasapower.
I have been receiving the same mistake. I hope it is something easy to fix adam!! This is great work.
Thanks!!
from nasapower.
Not as easy as a fix as I'd like. I'm rewriting a fair portion of the package's code, but I've made more good progress this AM. I've managed to send a query and parse it using the new code. I'll hope to have something you can try soon.
from nasapower.
I've a working beta version! This is a work in progress, so there are new functions that DO NOT YET WORK! But you should be able to start converting old scripts to use the new POWER API V2 functionality now for point data.
If you need access or want to try and would like to give feedback, e.g. report bugs, then here are the instructions.
Install the development version from GitHub that I've been working on.
if (!require("remotes")) {
install.packages("remotes")
}
remotes::install_github("ropensci/nasapower",
ref = "devel"
)
Then fetch POINT data for the daily API endpoint.
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
Note that I have made changes to the functions to correspond to changes in the API. The get_power()
now requests temporal_api
rather than temporal_average
and the precipitation (for those of you using rainfall) is now "PRECTOTCORR" rather than "PRECTOT". I've not made any other user-facing changes yet aside from adding new arguments to get_power()
for wind. These new parameters for wind have not yet been tested but are documented in the get_power()
help file.
Please try it out and let me know what you may find. Currently, as far as I know, the POWER team has only enabled POINT data so you should get an error if you request something out of scope, but for example, this works (for me).
Happy downloading!
from nasapower.
Great work Adam! One issue I encountered is the server would only allow 5 queries, which would break the loop for many requests. The solution I currently used is to put Sys.sleep(10) in the loop, which continues but slow down the process.
from nasapower.
Thanks, I've not yet tested this but will do some checking of the POWER documentation and adjust the nasapower documentation and functionality accordingly.
from nasapower.
I've reached the point where I've merged the new feature branch into devel
now and updated the installation instructions.
I think all the major functionality is now in place with tests and the vignette also completed. The last bit left is to check any rate-limiting. I know the POWER team has some documentation about not hitting the server too hard, I've written the client to make only one query per point as they've requested, but have no other built-in rate limits as yet.
from nasapower.
It works for me too, that is an awsome job. Thank you for taking some of your personal time to fix that. So far no problem for me but for sure I'll let know if something pops up.
from nasapower.
v4.0.0 has been submitted to CRAN. Just awaiting them to action the approval.
from nasapower.
Hi Adam,
- I've tried to retrieve daily precipitation (i.e., PRECTOTCORR) data for Ugandan districts for several years (i.e., 2000 to 2020) both through the API and the web data access viewer but I always get -999 as a value for all the observations. Any idea why this is happening?
- I also wonder if it's possible to retrieve averaged data for polygons using a shapefile. If there is grid/raster data available for a continent/country for ag data (e.g., precipitation, temperature, radiation), I can do the averaged extraction myself but I'm not sure if this is something that can be done.
Thank you.
Best,
Jorge
from nasapower.
Hi Jorge,
This issue is closed. Please open a new one for new issues like these.
- Please see the POWER website for their statement regarding the precipitation being corrupted.
- No. This is only an API client. I don’t do any manipulation other than reformatting and replacing
NA
values withNA
.
from nasapower.
I am having the same problem with the -999 for precipitation. But is working very good everything!
from nasapower.
Yes, the -999 for precipitation is a known-bug. I've fixed it in the devel branch. The next release will not report -999 for invalid values and hopefully by then the precipitation is fixed in the POWER data.
from nasapower.
I'm getting the 422 error, but my code is in Python, then the code shows 429, is there any Python update ready already? Thank´s
from nasapower.
If you’re getting a 422 error with nasapower, this R package, then you need to update your installed version to use the new version of the POWER API. Otherwise, I’m not able to provide you with assistance for any other programming languages.
from nasapower.
Related Issues (20)
- Error: Unprocessable Entity (HTTP 422) HOT 5
- Fetch data from a region HOT 5
- Limited output of climatology data before error occurred HOT 5
- client should pass API messages to end-user HOT 1
- Error: Unprocessable Entity (HTTP 422) HOT 10
- Fetching global climatology data HOT 3
- Problems with installation HOT 2
- Can I access HQPRECIPITATION ? HOT 4
- Release nasapower 4.0.2
- Write rate limiting into package HOT 1
- Warning with vroom >= 1.5.0 HOT 5
- Caching requests HOT 4
- site_elevation and wind_elevation needs fixing HOT 8
- IMERG Precipitation requires changing Time Standard to UTC HOT 2
- get_power fails when request data for more than a year HOT 3
- Dependencies need to be explicictly installed and loaded HOT 3
- Replace skip_on_cran() with skip_if_offline()? HOT 2
- Release nasapower 4.0.10
- Release nasapower 4.0.11
- Error in calculating wind direction at daily level HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nasapower.