This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This tiny script tries to grab all USDA SNOTEL data | |
| # for safekeeping. SNOTEL monitors snow and water across | |
| # the US but mostly in the west. | |
| # https://www.nrcs.usda.gov/resources/data-and-reports/snow-and-water-interactive-map | |
| # | |
| # The data downloaded are the historical reports | |
| # summarizing daily values of snow pack and additional | |
| # metrics. Reports lag real-time values with a couple | |
| # of weeks. | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git checkout --orphan gh-pages | |
| # preview files to be deleted | |
| git rm -rf --dry-run . | |
| # actually delete the files | |
| git rm -rf . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #' Format and run p-model drivers on Euler | |
| #' | |
| #' Takes site information for a single | |
| #' or multiple sites and grabs all data | |
| #' required for a p-model run in rsofun. | |
| #' | |
| #' Parameter settings are provided as | |
| #' arguments, but could be altered after | |
| #' the fact if desired. | |
| #' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(terra) | |
| library(stringr) | |
| #---- static code ---- | |
| # read in the original data | |
| r <- rast("LPX-Bern_SH1_gpppft.nc") | |
| # first subset to only the required years | |
| # 1978 - 2020 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| find . -name '*.zip' -exec sh -c 'unzip {};' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| gdal_translate -a_ullr -180 90 180 -90 -a_srs EPSG:4326 world.topo.bathy.200408.3x5400x2700.jpg tmp.tif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Interpolation using a loess smoother | |
| # and optimal span determination | |
| library(MODISTools) | |
| library(phenocamr) | |
| library(tidyverse) | |
| VI <- mt_subset( | |
| product = "MOD13Q1", | |
| lon = -72.1755, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(rvest) | |
| # base html url | |
| url <- "http://dapds00.nci.org.au/thredds/fileServer/ks32/CLEX_Data/PLUMBER2/v1-0/Flux/" | |
| # catalogue | |
| html_page = read_html("https://dap.nci.org.au/thredds/remoteCatalogService?catalog=http://dapds00.nci.org.au/thredds/catalog/ks32/CLEX_Data/PLUMBER2/v1-0/Flux/catalog.xml") | |
| # grab files from the catalogue | |
| files = html_page %>% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # convert pngs to mp4 | |
| ffmpeg -r 2 -i tmp/%03d.png -y out.mp4 | |
| # convert mp4 to twitter compatible format | |
| ffmpeg -i out.mp4 -vf scale=1280:720 -b:v 5000K -minrate 5000K -maxrate 5000K -b:a 128K -r 30 -f mp4 -vcodec libx264 -profile:v high -pix_fmt yuv420p -strict -2 -ac 2 -acodec aac twitter.mp4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # data wrangling | |
| library(tidyverse) | |
| # waffle plot | |
| library(waffle) | |
| # combining graphs | |
| library(patchwork) | |
| # text magic |
NewerOlder