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
| # Downsample HWSD data to the scale of 0.5 degree | |
| # WFDEI / CRU data | |
| library(raster) | |
| library(hwsdr) | |
| library(tidyverse) | |
| # get mu_global at 0.5 degrees from the | |
| # ORNL DAAC (which is easier than reading in | |
| # that monstrous BIL file) |
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
| #!/bin/bash | |
| # convert equirectangular 2 fisheye | |
| files=`ls *.jpg` | |
| for i in $files; | |
| do | |
| noext=`echo $i | cut -d'.' -f1` | |
| echo $noext |
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
| # required libraries | |
| library(phenor) | |
| # where to store the data | |
| out_dir <- "data-raw/" | |
| # sites to process, stored in a csv file | |
| # with columns site, veg_type, roi (check for extra spaces | |
| # which can mess with name formatting) | |
| sites <- read.table("data/sites.csv", sep = ",", header = TRUE) |
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
| #!/bin/bash | |
| # crop section of images | |
| mogrify -crop 2770x2304+3560+296 *.jpg | |
| # compile into animated gif | |
| convert -delay 100 -loop 0 -depth 8 -resize '640x' -quality 75% *.jpg anim.gif |
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
| # download NDVI time series | |
| library(MODISTools) | |
| df <- data.frame( | |
| site_name = | |
| c("US-Bes", | |
| "US-Atq", | |
| "US-Ivo", | |
| "US-ICt", | |
| "DK-ZaH", |
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
| # aligns virtual orientation with physical orientation | |
| mogrify -auto-orient *.png |
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
| montage *.png -bordercolor White -border 5x5 -colorspace Gray -gravity center -tile 7x -geometry +10+0 ~/montage.jpg |
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
| # Ghent air pollution analysis | |
| # parametric t-tests | |
| # non-parametric Mann-Whitney U test | |
| # download and collate the data | |
| pdf_data <- paste0(pdftools::pdf_text("https://klimaat.stad.gent/sites/default/files/nota_circulatieplangent_3.pdf")[2], | |
| collapse = " ") | |
| # some regular expression moving about | |
| subset <- gsub(',', ".", pdf_data) |
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
| # Before you start install all the referenced packages below | |
| # including the development release of ecmwfr you will also | |
| # need the rnaturalearthdata in addition to the normal package | |
| # To run the code copy and paste segments as this is still | |
| # rough around the edges and requires user interaction to | |
| # set your CDS API key. | |
| # load libraries | |
| if(!require(devtools)){install.packages("devtools")} | |
| devtools::install_github("khufkens/ecmwfr") |
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
| # Before you start install all the referenced packages below | |
| # including the development release of ecmwfr you will also | |
| # need the rnaturalearthdata in addition to the normal package | |
| # To run the code copy and paste segments as this is still | |
| # rough around the edges and requires user interaction to | |
| # set your CDS API key. | |
| # load libraries | |
| if(!require(devtools)){install.packages("devtools")} | |
| devtools::install_github("khufkens/ecmwfr") |