mikejohnson51 / climateR

An R 📦 for getting point and gridded climate data by AOI
https://mikejohnson51.github.io/climateR/
MIT License
165 stars 40 forks source link

getDaymet() version 4 or version selection option #49

Closed Rapsodia86 closed 1 year ago

Rapsodia86 commented 2 years ago

Hello, I do have a quick question: Is there a plan to either update url to Daymet Version 4 or maybe add an option to select a dataset's version?

Thanks!

mikejohnson51 commented 2 years ago

Hi @Rapsodia86,

I have a new release of climateR coming very soon which will use Daymet 4 :)

I will keep this open for now and alert you when its ready (ideally end of the week)

Thanks for the interest!

Mike

Rapsodia86 commented 2 years ago

Great! Thank you very much!

mikejohnson51 commented 2 years ago

Hi @Rapsodia86,

As mentioned in the other issue, I am slowly moving climateR to a new more robust backend. The idea will be that all performance and convinence in climateR will remain but it will more flexibly call a more complete documentation of all datasets:

For now, to get DaymetV4 try:

library(opendap.catalog)
library(terra)

# Query opendap .catalog
cat = dplyr::filter(params,  id == "daymetv4")  

# subset all day met components to a AOI and time
dap = dap(catolog = cat,
         AOI = AOI::aoi_get(state = "CO", county = "Larimer"), 
         startDate = "2010-01-01")

# View
terra::plot(rast(dap))

image

# Instead filter to just tmin (could also do in the initial filter)

dap2 = dap(catolog = cat,
             AOI = AOI::aoi_get(state = "CO", county = "Larimer"), 
             startDate = "2010-01-01",
             varname = "tmin")

terra::plot(dap2$tmin_NA)

image

Rapsodia86 commented 2 years ago

Thank you very much for the update! I also very much appreciate adding support for (or even switching to) terra package! So, double thanks!:) Btw. if you need someone extra for testing during development, sign me in!