Skip to content

Instantly share code, notes, and snippets.

View habi's full-sized avatar

David Haberthür habi

View GitHub Profile
sed -i 's/Haberthuer2010/doi:10.1107\/S0909049510019618/g' *.md
sed -i 's/Haberthur2013/doi:10.1152\/japplphysiol.00642.2013/g' *.md
sed -i 's/Haberth_r2013/doi:10.1152\/japplphysiol.00642.2013/g' *.md
sed -i 's/Haberth_r_2013/doi:10.1152\/japplphysiol.00642.2013/g' *.md
sed -i 's/haberthr/doi:10.5281\/zenodo.3768407/g' *.md
sed -i 's/Barr__2014/doi:10.14814\/phy2.12063/g' *.md
sed -i 's/Barr__2016/doi:10.1152\/ajplung.00325.2016/g' *.md
sed -i 's/Tschanz_2014/doi:10.1152\/japplphysiol.01355.2013/g' *.md
sed -i 's/TSCHANZ_2011/doi:10.1111\/j.1365-2818.2010.03481.x/g' *.md
sed -i 's/Schittny_2008/doi:10.1152\/ajplung.00296.2007/g' *.md
@habi
habi / cropper.py
Created November 24, 2020 12:12
Crop a (DASK) array of (tomographic) data to the biggest blob present in it.
def cropper(image,
despeckle=True,
verbose=False,
threshold=50):
'''Crop array to biggest item in it'''
dimensions = len(image.shape)
if verbose:
print('Cropping %s-dimensional image' % dimensions)
# Threshold
thresholded = image > threshold
@habi
habi / cropper.py
Last active September 28, 2020 15:03
Function to crop a dataset to the smallest cuboid that contains (denoised) data. Displays the data if requested.
def cropper(image,
despeckle=True,
verbose=False,
threshold=50):
'''Crop array to biggest item in it'''
dimensions = len(image.shape)
if verbose:
print('Cropping %s-dimensional image' % dimensions)
# Threshold
thresholded = image > threshold
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@habi
habi / export.geojson
Created November 25, 2019 09:07
ele=* in Bern
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@habi
habi / download.all.sh
Created July 20, 2019 19:27
Ab id Ferie!
youtube-dl -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4' http://habi.gna.ch/u/yta
@habi
habi / download.sh
Created July 17, 2019 10:01
Download all the raw gill data for the ZebraFishGills project. Warning, this downloads 12 GB of data and unzips it!
# Controls
wget -nc -O c01.zip https://osf.io/7utfb/download
wget -nc -O c02.zip https://osf.io/yg4xr/download
wget -nc -O c03.zip https://osf.io/9awx4/download
wget -nc -O c04.zip https://osf.io/57xbk/download
wget -nc -O c05.zip https://osf.io/8kucf/download
wget -nc -O c06.zip https://osf.io/ntxua/download
wget -nc -O c07.zip https://osf.io/bhqez/download
wget -nc -O c08.zip https://osf.io/xwu97/download
wget -nc -O c09.zip https://osf.io/qp584/download
@habi
habi / torta di pane.md
Last active February 6, 2019 18:53
Torta di pane (Recipe for the TOMCAT "Science and Cake" seminar)

Zutaten

Menge Zutat
250 g altbackenes Brot, z. B. Ruchbrot
50 g harte Amaretti
40 g Zucker
0.5 Beutel Vanillezucker
5 dl Milch
25 g Baumnüsse
@habi
habi / export.ch.geojson
Created December 19, 2018 20:54
Guafförs Schweiz
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.