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

Can not to load data for 2021 #29

Open
vgeka opened this issue Feb 17, 2021 · 2 comments
Open

Can not to load data for 2021 #29

vgeka opened this issue Feb 17, 2021 · 2 comments

Comments

@vgeka
Copy link

vgeka commented Feb 17, 2021

Why I can not to load data for 2021? The package load only 4 first rows for my time zone (UTC+2) from 2020 dataset. But data for 2021 is present on NOAA datastorage (such as https://www1.ncdc.noaa.gov/pub/data/noaa/2021/330003-99999-2021.gz)

@erikbrown83
Copy link

Hi - I think this is linked to my previous issue (#28). The get_met_data function I think refers to the history_tbl dataframe for available years. This table only runs up until 2020 which is preventing download of data for 2021.

@makeyourownmaker
Copy link

makeyourownmaker commented Aug 8, 2023

You can try monkey patching the stationaRy get_years_available_for_station function:

stationaRy <- getNamespace("stationaRy")
unlockBinding("get_years_available_for_station", stationaRy)


get_years_available_for_station <- function(station_id) {
  first_year <- 2008  # modify for your application
  last_year <- as.numeric(format(Sys.time(), "%Y"))

  first_year:last_year
}


stationaRy$get_years_available_for_station <- get_years_available_for_station
lockBinding("get_years_available_for_station", stationaRy)

There are other ways to do monkey patching in R.

Alternatively, the worldmet, ropensci/riem, ropensci/nasapower or rnoaa packages may be worth considering.
I have not tried any of them.

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