Skip to content

Instantly share code, notes, and snippets.

@cboettig
Created March 3, 2021 23:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cboettig/8316df8ae9fe2d38865e4bfcdd73a7ce to your computer and use it in GitHub Desktop.
Save cboettig/8316df8ae9fe2d38865e4bfcdd73a7ce to your computer and use it in GitHub Desktop.
access EFI NOAA data
```{r setup}
library(tidync)
```
Today's (2021-03-03) 16-day forecast made for ABBY NEON site at 6h-intervals: (other intervals and older forecasts also possible)
```{r}
download.file("https://data.ecoforecast.org/drivers/noaa/NOAAGEFS_6hr/ABBY/2021-03-03/12/NOAAGEFS_6hr_ABBY_2021-03-03T00_2021-03-19T12_ens00.nc", "~/NOAAGEFS_6hr_ABBY_2021-03-03T00_2021-03-19T12_ens00.nc")
```
```{r}
library(RNetCDF)
print.nc(open.nc("~/NOAAGEFS_6hr_ABBY_2021-03-03T00_2021-03-19T12_ens00.nc"))
```
```{r}
nc <- tidync::tidync("~/NOAAGEFS_6hr_ABBY_2021-03-03T00_2021-03-19T12_ens00.nc")
nc
```
```{r}
nc$variable
```
data at the ABBY lat/long for
```{r}
df <- nc %>% hyper_tibble()
df
```
```{r}
# forecasts go 16 days into future
max(df$time) / 24
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment