Skip to content

Instantly share code, notes, and snippets.

View philippkraft's full-sized avatar

Philipp Kraft philippkraft

View GitHub Profile
@philippkraft
philippkraft / README.md
Last active May 12, 2024 01:16
Convert xyz elevation models to GeoTiff

Convert .xyz elevation models to GeoTiff

In Germany, more and more state agencies allow free access to high resolution elevation models. However, these are often released as xyz tables, which are not easily used in GIS environments. A standard method to convert this format to raster formats (eg. GeoTiff) is the GDAL function gdal_translate [1, 2]. However, converting 1M lines takes dozens of seconds and is not trivial to parallize.

@philippkraft
philippkraft / rfactor.py
Created July 7, 2021 09:29
Calculating the R-factor according to the ABAG
# -*- coding: utf-8 -*-
import numpy as np
import pandas as pd
import pylab as plt
import datetime as dt
from glob import glob
import sys
def calculate_r_factor(t0, ri_mm_h):
R_i = []
"""
A simple and ugly tool to program SDI12 sensors
@author: philippkraft
"""
# The serial port, for linux something like /dev/ttyUSB1, None meens use mock
port = None
# Timeout for the serial port
timeout = 0.3
@philippkraft
philippkraft / smoothing_function.ipynb
Last active March 6, 2019 10:33
Discussion of an overflow smoothing function as introduced by Clark et al 2008
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.