Skip to content

Instantly share code, notes, and snippets.

import traceback
from pyrx_imp import Rx, Ge, Gi, Db, Ap, Ed, Cv
def PyRxCmd_pydebug() -> None:
import PyRxDebug
PyRxDebug.startListener()
drawProps = {'colorIndex': 255,'radius': 0.2}
def getIds(vAlignment):
@schoeller
schoeller / dwd2dat.py
Created December 3, 2022 21:13
Pull precipitation series in SWMM format from DWD data
import warnings
warnings.filterwarnings("ignore")
from wetterdienst.provider.dwd.observation import DwdObservationRequest, \
DwdObservationPeriod, DwdObservationResolution, DwdObservationParameter, DwdObservationDataset
# # all
# print("All available parameters")
# print(
# DwdObservationRequest.discover()
@schoeller
schoeller / FP.pat
Created October 2, 2022 08:12
Schraffuren analog zu Revit BIM Bibliothek - Allgemein
; Schraffuren analog zu https://www.rug-dach.de/download/sammeldateien.html
*FP1_1, Ortbeton - bewehrt
45, 0,0, 0,203.2, 101.6, -101.6
45, 179.605,35.921, 0,203.2
*FP1_10, Mauerwerk - ohne Dämmeigenschaften
45, 0,0, 0,152.4
45, 71.842,0, 0,152.4
@schoeller
schoeller / gs5.txt
Last active May 29, 2022 20:08
Recipe for GS5
Recipe for Eos 0.23.9-r:
repo init -u https://gitlab.e.foundation/e/os/releases.git -b refs/tags/v0.23.9-r
mkdir .repo/local_manifests
vi .repo/local_manifests/eos.xml
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote name="fdroid" fetch="https://gitlab.com/fdroid/" />
<remote name="sfX" fetch="https://github.com/sfX-Android/" />
@schoeller
schoeller / landuse2inp.py
Created January 26, 2022 16:55
Mapping subcatchments to nodes
# -*- coding: utf-8 -*-
"""
@author: Sebastian Schoeller
Source:
https://github.com/Deltares/pyflwdir/issues/15
1. Create regions from the landuse map, using e.g. scipy.ndimage.label. This returns a map with unique IDs for connected regions with the same landuse.
2. Find the most downstream "outflow pixel" of each region using pyflwdir.FlwdirRaster.inflow_idxs Note: should still be added to the API Reference in the docs. This returns a list with linear indices of outflow pixels.
3. Derive subbasins using pyflwdir.FlwdirRaster.basins based on the indices of the outflow pixels from step 2, supplied using the idxs_out option. This returns a map with unique IDs for each basin.
@schoeller
schoeller / gx290.txt
Last active May 15, 2023 10:59
Lineage 17.1 on GX290
1.Follow instruction as per https://wiki.lineageos.org/devices/river/build to setup the environment including repo, caching
2.When initializing the repo use branch 17.1
repo init -u https://github.com/LineageOS/android.git -b lineage-17.1
repo sync
3.Clone specific repos for enabling device support
git clone https://github.com/GS290-dev/android_device_gigaset_GX290-unified -b lineage-17.1 device/gigaset/GX290-unified
git clone https://github.com/GS290-dev/proprietary_vendor_gigaset/ -b lineage-17.1 vendor/gigaset
git clone https://github.com/GS290-dev/android_device_gigaset_mt6763-common -b lineage-17.1 device/gigaset/mt6763-common
@schoeller
schoeller / runDamBreak.py
Last active September 17, 2019 10:49
Simulating dam break
# Based on https://github.com/Hydrata/ChennaiFloodModel and adapted to Anuga examples for further automisation
# Anuga imports
from math import sin, pi, exp
from osgeo import gdal, osr
import csv
import anuga, os, sys, numpy, urllib
import anuga.utilities.quantity_setting_functions as qs
import anuga.utilities.log as log
from anuga.shallow_water.forcing import Rainfall
@schoeller
schoeller / taudem.sh
Last active October 12, 2018 19:13
Automatic DEM treatment with TauDEM
#!/usr/sh
# works with Taudem 5.0.6
# Pit fill
mpiexec -n 8 pitremove -z dtm.tif -fel dtmfel.tif
# Flow directions
mpiexec -n 8 d8flowdir -p dtmp.tif -sd8 dtmsd8.tif -fel dtmfel.tif
mpiexec -n 8 dinfflowdir -ang dtmang.tif -slp dtmslp.tif -fel dtmfel.tif
@schoeller
schoeller / stl2dxf.py
Created January 30, 2017 21:15
Script to convert STL mesh to 3dfaces in DXF-format
import sys
# Writing STL mesh to 3dfaces as DXF using dxfwrite
# Dirty script thus only for triangles
from dxfwrite import DXFEngine as dxf
drawing = dxf.drawing('test.dxf')
for line in sys.stdin.readlines():
if line.find(" facet") == 0: