Giter VIP home page Giter VIP logo

Comments (8)

daniel-althoff avatar daniel-althoff commented on September 27, 2024 1

I installed the latest version and it seems to be working properly!
I'm now closing this. Thank you so much.

from nasapower.

adamhsparks avatar adamhsparks commented on September 27, 2024

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.

from nasapower.

daniel-althoff avatar daniel-althoff commented on September 27, 2024

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

from nasapower.

adamhsparks avatar adamhsparks commented on September 27, 2024

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!

5858247

from nasapower.

adamhsparks avatar adamhsparks commented on September 27, 2024

closed with 5858247

from nasapower.

daniel-althoff avatar daniel-althoff commented on September 27, 2024

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!

from nasapower.

adamhsparks avatar adamhsparks commented on September 27, 2024

from nasapower.

daniel-althoff avatar daniel-althoff commented on September 27, 2024

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

from nasapower.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.