Skip to content

Instantly share code, notes, and snippets.


Floris van Breugel florisvb

View GitHub Profile
import multiprocessing
import numpy as np
import time
def compute_something(input):
a = input[0]
b = input[1]
r = a**b**b
return r
florisvb /
Created May 2, 2018
Psuedo script for opening and plotting hdf5 data
import h5py
f = h5py.File(filename)
print f.keys()
data = f[keyname].value # choose a keyname from the list of keys
print data
a = data[name] # choose a name from the data dtype names
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(111)
florisvb /
Last active Jan 14, 2019
Install ROS and make mac camera available
sudo apt-get update
sudo apt-get upgrade -y
# install ROS
sudo sh -c 'echo "deb $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-key adv --keyserver hkp:// --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
sudo apt-get update
sudo apt-get install ros-kinetic-desktop-full -y
sudo rosdep init
rosdep update
florisvb /
Last active Apr 11, 2018
Some handy commands for getting FigureFirst and Jupyter installed in a virtualenv

Install inkscape

sudo apt-get install inkscape

Download figurefirst:

git clone

Make a virtual environment

Include the system site packages (that way we don't have to install numpy, scipy, etc)
sudo apt-get install python-virtualenv

virtualenv FIG --system-site-packages

florisvb / SystemVersion.plist
Created Mar 23, 2018
File required for making ubuntu bootable on a Mac
View SystemVersion.plist
<xml version="1.0" encoding="utf-8"?>
<plist version="1.0">
<string>Ubuntu Linux</string>
View map elevation data
import gdal
d = gdal.Open('10n060e_20101117_gmted_mea300.tif')
arr = d.ReadAsArray()
def get_elevation_at_point(x, y, elevation_array):
# skip interpolation for now
return elevation_array[int(x), int(y)]
def get_elevation_profile_for_path(x, y, elevation_array):
e = [get_elevation_at_point(x[i], y[i], elevation_array) for i in range(len(x))]