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 | |
pandoc in.md -o out.pdf | |
pandoc in.md -o out.tex | |
pandoc out.tex -o out2.pdf |
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 | |
for FILE in *.asc | |
do | |
BASENAME=$(basename $FILE .asc) | |
OUTFILE=${BASENAME}.tif | |
echo "Processing: ${BASENAME}.asc" | |
gdal_translate -of GTiff -co COMPRESS=DEFLATE $FILE $OUTFILE |
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(maptools) | |
library(rgdal) | |
library(rgeos) | |
setwd("~/type1") | |
species <- 'speciesX1' | |
list_shp <- list.files(path=species, pattern="*.shp", full.names = TRUE, | |
recursive = TRUE, include.dirs = FALSE) | |
shp_objects <- lapply(list_shp, function(x) {readOGR(dsn=x, | |
layer=ogrListLayers(x))}) |
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
# Buffer the coordinates with a desired distance | |
sp.espoo.etrs89.buffer <- gBuffer(sp.espoo.etrs89, byid=TRUE, width=100) | |
sp.espoo.etrs89.buffer <- SpatialPolygonsDataFrame(sp.espoo.etrs89.buffer, | |
sp.espoo.etrs89@data) | |
sp.tarto.etrs89.buffer <- gBuffer(sp.tarto.etrs89, byid=TRUE, width=100) | |
sp.tarto.etrs89.buffer <- SpatialPolygonsDataFrame(sp.tarto.etrs89.buffer, | |
sp.tarto.etrs89@data) | |
# See which SpatialPoints from the KML files fall within the buffer from sp |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
#!/usr/bin/env python | |
""" Utility script to compare whether the content of 2 folders appear to be | |
same. | |
Similarity is based on simple file name matching. | |
""" | |
import argparse | |
from difflib import get_close_matches |
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(reshape) | |
library(ggplot2) | |
dat <- data.frame(Paikka=rep(c("Hanko", "Helsinki","Turku"), 4), | |
Vuosi=factor(rep(c(2009, 2010, 2011, 2012), each=3)), | |
Prosentti=runif(12, 0, 1)) | |
# Barplot | |
ggplot(dat, aes(Paikka, Prosentti, fill=Vuosi)) + | |
geom_bar(position="dodge", stat="identity") |
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
#!/usr/bin/env python | |
# Requires GDAL with python installed https://pypi.python.org/pypi/GDAL | |
import osgeo.ogr as ogr | |
import osgeo.osr as osr | |
# Adapted from http://lists.osgeo.org/pipermail/gdal-dev/2009-October/022284.html | |
# Create wkt string of point coords |
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(data.table) | |
read.weather.data.table <- function(folder, hilas, jdate.start, jdate.end, years='All') { | |
# List all the csv files in the folder | |
csv.files <- list.files(folder, "\\.csv$", full.names = TRUE) | |
# Create an empty list to hold the content of each csv file | |
csv.files.data <- list() | |
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
read.weather.data <- function(folder, hilas, jdate.start, jdate.end, years='All') { | |
# List all the csv files in the folder | |
csv.files <- list.files(folder, "\\.csv$", full.names = TRUE) | |
# Create an empty list to hold the content of each csv file | |
csv.files.data <- list() | |
col.names = c("hila", "year", "x1", "x2", "temp", "rain", "jdate") | |