Skip to content

Instantly share code, notes, and snippets.

View TobiasGlaubach's full-sized avatar

Tobias Glaubach TobiasGlaubach

View GitHub Profile
@TobiasGlaubach
TobiasGlaubach / tune_train_select_classifier.py
Created March 7, 2019 11:19
python pseudocode for multi label labeling problem to select features, tune a classifier and validate it as well as selct the best fitting classifier from a range
from numpy import min, argmin
from sklearn.feature_selection import RFECV
from sklearn.model_selection import cross_val_score, RandomizedSearchCV, ShuffleSplit, StratifiedKFold
from sklearn.preprocessing import StandardScaler
from sklearn.pipeline import make_pipeline
# here would be the code to get the data and initialize the classifiers
# with their associated search ranges as well as all labels
# namely the functions and variables:
@TobiasGlaubach
TobiasGlaubach / schmitt_trigger.py
Created January 27, 2019 14:07
A simple purely state and voltage based model for a schmitt_trigger HEF4093B with 13V supply voltage parameters were roughly interpolated for 13V supply voltage
# -*- coding: utf-8 -*-
"""
Created on Sun Jan 27 13:58:13 2019
DISCRIPTION:
A simple purely state and voltage based model for a schmitt_trigger HEF4093B
with 13V supply voltage
values taken from data sheet:
https://assets.nexperia.com/documents/data-sheet/HEF4093B.pdf#G1001577288
values were roughly interpolated for 13V supply voltage
@TobiasGlaubach
TobiasGlaubach / resampleDataFrameFixed.py
Created November 17, 2018 16:14
a small file to show how to resample a pandas data frame to a fixed number of rows, assuming its indices are numerical and monotonically rising (e.G. time series data)
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
#%% make some data frame for testing
phi = np.linspace(0, 2*np.pi, 1024)
df = pd.DataFrame({
'cos': np.cos(phi),
'sin': np.sin(phi),
@TobiasGlaubach
TobiasGlaubach / Worldview-2_toar_v2.py
Created October 22, 2018 15:19
this is a script a friend of mine and me did today for her masters thesis, it converts Worldview-2 Sensor data to top of atmosphere TOA data and saves them in the same Tiff format as provided by the input data. Assumes the data is available as individual files for each band
#!/usr/bin/env python
############################################################################
#
# MODULE: Worldview-2_toar_v2
#
# AUTHOR(S): Overall script by Mirijam Zickel (University of Cologne)
# Python scripting and support by T. Glaubach
#