Skip to content

Instantly share code, notes, and snippets.

View pierstitus's full-sized avatar

Piers Titus van der Torren pierstitus

View GitHub Profile
@pierstitus
pierstitus / GTiff_compression_benchmark.py
Created September 5, 2017 12:39 — forked from kr-stn/GTiff_compression_benchmark.py
Benchmark filesize and read/ write times for various GeoTiff compression algorithms
__author__ = 'kersten.clauss'
"""Benchmark different GeoTiff compression algorithms.
Usage: GTiff_compression_benchmark.py some_geo.tif
Requires the GDAL tools to be present and executable from the command line of your system.
This script will take a GeoTiff as input and create copies with different compression algorithms from it.
It measures the filesize, compression and decompression times and returns them as a table.
import re
import string
def iban_cepa_check(nr):
""" Check if given IBAN/CETA account number is valid. """
nr = nr.replace(' ', '')
if re.fullmatch('[A-Z]{2}\d{2}[A-Z]{4}\d{10}', nr):
check_org = int(nr[2:4])
nr = nr[4:] + nr[:2]
else:
@pierstitus
pierstitus / pcbnew_easy.py
Last active August 29, 2015 14:13
pcbnew pythonic scripting api
# pcbnew_easy.py
# Wrapper API for more convenient/pythonic creation of PCB boards and modules.
# Probably this should better be integrated in the default API instead of as
# a wrapper. However this was the quickest way to improve the usability for
# myself.
#
# All values are in mm, and coordinates and sizes can be given as iterables
# (tuples, lists, numpy arrays, ...)
#
# Copyright 2014 Piers Titus van der Torren <[email protected]>