Skip to content
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

IMERG Precipitation requires changing Time Standard to UTC #70

Closed
daniel-althoff opened this issue Mar 27, 2022 · 2 comments
Closed

IMERG Precipitation requires changing Time Standard to UTC #70

daniel-althoff opened this issue Mar 27, 2022 · 2 comments
Assignees
Milestone

Comments

@daniel-althoff
Copy link

Hey,

I have tried obtaining IMERG precipitation from the API, but it returns the following error:

Code to Reproduce

library(nasapower)
nasapower::get_power(community = "ag", 
                                     lonlat = c(-66.5, -33.5), 
                                     pars = 'PRECIPITATIONCAL', 
                                     dates = '2020-01-01',
                                     temporal_api = 'daily')

Erro: HTTP (422) - The request was well-formed but was unable to be followed due to semantic errors (WebDAV; RFC 4918)
  The IMERG Precipitation is not available at the Local Solar Time (LST) Standard: Remove the PRECIPITATIONCAL parameter or change Time Standard to UTC.
  • OS: Windows11
  • R Version 4.0.5

At the Tutorails-parameters page https://power.larc.nasa.gov/docs/tutorials/parameters/ it states the following:
"If the parameter's time is not Local Solar Time (LST) it is suffixed to the end of the parameter name (e.g. ALLSKY_SFC_SW_DWN_00_GMT"

I have tried 'PRECIPITATIONCAL_00_GMT', but it returns the following;

Erro: PRECIPITATIONCAL_00_GMT is/are not valid in 'pars'.
Check that the 'pars', 'community' and 'temporal_api' align.

I also found the following:
"to change the time standard please include time-standard=UTC or time-standard=LST in the API request URL"

It did work when I tried this page:
https://power.larc.nasa.gov/api/temporal/daily/point?parameters=PRECIPITATIONCAL&community=SB&longitude=0&latitude=0&start=20170101&end=20170201&time-standard=UTC&format=JSON

Could this option be included to the package?

Thank you!

@adamhsparks adamhsparks self-assigned this Mar 28, 2022
@adamhsparks adamhsparks added this to the v4.0.7 milestone Mar 28, 2022
@adamhsparks
Copy link
Member

adamhsparks commented Mar 28, 2022

Hi. Seems like a bug, I'd specified UTC by default but had the wrong format for the API parameter. I didn't realise it would affect the data values returned too, so I'd not investigated further and implemented the ability to change this.

Now UTC and LST (default and recreates the previous releases' behaviour) are options.

Can you try installing the version from the main branch of this repository, check it and report back to me if you get the values you expected, please? It seems to be working for me, no errors.

remotes::install_github("ropensci/nasapower")

@daniel-althoff
Copy link
Author

I tried and it seems to be working properly. Once again, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants