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

'palmer' param throwing this error though 'prcp' works for gridmet #7

Closed
jhammondusgs opened this issue Jun 11, 2019 · 8 comments
Closed

Comments

@jhammondusgs
Copy link

AOI = getAOI(state = 'CO') %>% AOI::bbox_st()

Generate Random Points

n = 10
pts = data.frame(lat = runif(n, AOI$ymin, AOI$ymax),
lon = runif(n, AOI$xmin, AOI$xmax))

test <- getGridMET(AOI = pts[1,], param = c('prcp'), startDate = "1980-01-01", endDate = "2018-12-31")

test <- getGridMET(AOI = pts[1,], param = c('palmer'), startDate = "1980-01-01", endDate = "2018-12-31")

" Error in { : task 1 failed - "NetCDF: Access failure" "

@jhammondusgs
Copy link
Author

Same also appears to be true for "palmer" parameter with Terraclimate data

@mikejohnson51
Copy link
Owner

mikejohnson51 commented Jun 12, 2019

Hi John,

This seems to be caused by a few issues I still need to write error catches around, but I can explain:

  1. The issue with the palmer index from gridMET is on the University of Idaho's end. When we look at their prcp catoloug, it shows that they have 14,770 days archived:

image

But for the Palmder Index, there are only 1,455 days archived:

image

These kind of issues will be a little harder to write an error catch for, and I will reach out to them about this.

The issues with the Palmer Index/TerraClim is that they only archive data up to 2017. If you change the endDate to "2017-12-31", it should run fine.

A catch for this was added in the most recent update.

Thanks!

Mike

@jhammondusgs
Copy link
Author

jhammondusgs commented Jun 12, 2019 via email

@mikejohnson51
Copy link
Owner

Great! I am glad it's proving useful, please let me know if anything else comes up.

Mike

@pjgoodling
Copy link

Hi Mike,

Thanks for your hard work!

I know this one is closed, but I seem to have a similar issue to the one above.

Getting precipitation data for Maryland works just fine:

g = getAOI(state = "md") %>% getGridMET(param = 'pcp', startDate = "2017-06-29")

But trying to get palmer indices from GridMet doesn't seem to work:

g = getAOI(state = "md") %>%  getGridMET(param = 'palmer', startDate = "2017-06-29")
Error in { : task 1 failed - "NetCDF: Access failure"

Is it still an issue on University of Idaho's end?

Thanks,

Phillip

@mikejohnson51
Copy link
Owner

Hi Phillip,

For the Palmer Index, this is still a Idaho Server issue. The palmer index has about 1/10th the data stored as the other variables (like prcp). I am not even certain where in the timeline that data fits either. I had forgotten about this issue but will follow up. For now I am re-opening

@mikejohnson51
Copy link
Owner

Hi @jhammondusgs and @pjgoodling,

Sorry for the loooonnnnngggggg wait on this! With the rewrite of this package the following works for both your examples:

library(AOI); library(sf); library(climateR);library(terra)
#> Linking to GEOS 3.11.1, GDAL 3.6.0, PROJ 9.1.1; sf_use_s2() is TRUE
#> Using GDAL version 3.6.0 which was retracted because it cannot write large GPKG files
#> terra 1.7.8

# 10 random points
pts = aoi_get(state = 'CO') %>% 
  st_sample(10) %>% 
  st_as_sf()

test <- getGridMET(AOI = pts[1,],
                   varname  = c('pr'), 
                   startDate = "1980-01-01", endDate = "2018-12-31")

plot(test$pr, type = "l")

# Working with PDSI
test <- getGridMET(AOI = pts[1,], 
                   varname  = c('pdsi'), 
                   startDate = "1980-01-01", endDate = "2018-12-31")

plot(test$pdsi.y)

g = aoi_get(state = "md") %>%  
  getGridMET(varname = 'pdsi', startDate = "2017-06-29")

plot(g$category)

plot(g$daily_mean_palmer_drought_severity_index)

Created on 2023-02-15 by the reprex package (v2.0.1)

I hope this rewrite proves useful and that the extra datasets and greater stability prove useful if you are still pursuing these types of data questions!

Mike

@pjgoodling
Copy link

pjgoodling commented Feb 16, 2023 via email

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

No branches or pull requests

3 participants