This file contains 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 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 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 | |
# MODIS Batch Download Tool Command Line (MBDTcl) | |
# | |
# Bash script to download all modis hdf files for a particular year | |
# to the current directory. | |
# | |
# Beware this script will only download level 5 products | |
# if other products are selected the script will fail. | |
# | |
# Coded by Koen Hufkens at Boston University 2010 |
This file contains 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 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 | |
# Insert PDF meta-data into exif header | |
# for pdf files with format author - year - title.pdf. | |
# This allows e-readers to query meta-data for proper | |
# display and sorting of authors and titles | |
# (note: relies on exiftool) | |
for filename in *.pdf; do | |
noext=`echo "${filename%.*}"` |
This file contains 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 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 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 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 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) |