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

Import NOAA #33

Open
TrackerSmith opened this issue May 9, 2024 · 3 comments
Open

Import NOAA #33

TrackerSmith opened this issue May 9, 2024 · 3 comments

Comments

@TrackerSmith
Copy link

Hello-I'm having difficulty importing 2024 NOAA data using WORLDMET.
Data for 2023 works well, but the script won't return 2024 data. I've tried different site codes and the issue appears to affect all sites.
Any advice would be very welcome, please. Thank you.

londonmet<-importNOAA(code="037683-99999",year=2024)
Error in purrr::pmap():
ℹ In index: 1.
Caused by error in rename():
! Can't rename columns that don't exist.
✖ Column NAME doesn't exist.
Run rlang::last_trace() to see where the error occurred.
rlang::last_trace()
<error/purrr_error_indexed>
Error in purrr::pmap():
ℹ In index: 1.
Caused by error in rename():
! Can't rename columns that don't exist.
✖ Column NAME doesn't exist.


Backtrace:

  1. ├─worldmet::importNOAA(code = "037683-99999", year = 2024)
  2. │ ├─... %>% purrr::list_rbind()
  3. │ └─purrr::pmap(site_process, getDat, hourly = hourly, .progress = "Importing NOAA Data")
  4. │ └─purrr:::pmap_("list", .l, .f, ..., .progress = .progress)
  5. │ ├─purrr:::with_indexed_errors(...)
  6. │ │ └─base::withCallingHandlers(...)
  7. │ ├─purrr:::call_with_cleanup(...)
  8. │ └─worldmet (local) .f(code = .l[[1L]][[i]], year = .l[[2L]][[i]], ...)
  9. │ ├─dplyr::rename(...)
  10. │ └─dplyr:::rename.data.frame(...)
  11. └─purrr::list_rbind(.)
  12. └─purrr:::check_list_of_data_frames(x)
  13. └─vctrs::vec_check_list(x, call = error_call)
    
  14.   └─vctrs::obj_check_list(x, ..., arg = arg, call = call)
    
@davidcarslaw
Copy link
Owner

Thanks for the report. This is a known issue that comes from 2024 data changing format. A new way of accessing the data is also being rolled out by NOAA. I will but a temporary fix for this in the next few days before moving to the new data access approach.

Thanks
David

@TrackerSmith
Copy link
Author

TrackerSmith commented May 16, 2024 via email

@jack-davison
Copy link
Contributor

@TrackerSmith could you check again please? It appears that NOAA has resolved the issue.

londonmet <- worldmet::importNOAA(code = "037683-99999", year = 2024)
londonmet
#> # A tibble: 3,214 × 22
#>    code         station date                latitude longitude  elev    ws    wd
#>    <fct>        <fct>   <dttm>                 <dbl>     <dbl> <dbl> <dbl> <dbl>
#>  1 037683-99999 CITY, … 2024-01-01 00:00:00     51.5    0.0553  5.79  7.45  245.
#>  2 037683-99999 CITY, … 2024-01-01 01:00:00     51.5    0.0553  5.79  7.45  250 
#>  3 037683-99999 CITY, … 2024-01-01 02:00:00     51.5    0.0553  5.79  7.2   250 
#>  4 037683-99999 CITY, … 2024-01-01 03:00:00     51.5    0.0553  5.79  6.2   250 
#>  5 037683-99999 CITY, … 2024-01-01 04:00:00     51.5    0.0553  5.79  5.9   250 
#>  6 037683-99999 CITY, … 2024-01-01 05:00:00     51.5    0.0553  5.79  5.95  245.
#>  7 037683-99999 CITY, … 2024-01-01 06:00:00     51.5    0.0553  5.79  6.2   245.
#>  8 037683-99999 CITY, … 2024-01-01 07:00:00     51.5    0.0553  5.79  5.7   245 
#>  9 037683-99999 CITY, … 2024-01-01 08:00:00     51.5    0.0553  5.79  6.2   250 
#> 10 037683-99999 CITY, … 2024-01-01 09:00:00     51.5    0.0553  5.79  5.7   250 
#> # ℹ 3,204 more rows
#> # ℹ 14 more variables: air_temp <dbl>, atmos_pres <dbl>, visibility <dbl>,
#> #   dew_point <dbl>, RH <dbl>, ceil_hgt <dbl>, cl_1 <dbl>, cl_2 <dbl>,
#> #   cl_3 <dbl>, cl <dbl>, cl_1_height <dbl>, cl_2_height <dbl>,
#> #   cl_3_height <dbl>, pwc <chr>

Created on 2024-05-17 with reprex v2.1.0

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