Skip to content

Instantly share code, notes, and snippets.

View geggo's full-sized avatar

Gregor Thalhammer-Thurner geggo

View GitHub Profile
import gc
import numpy as np
import pyopencl as cl
import pyopencl.array as cla
import threading
import sys
import time
ctx = cl.create_some_context(answers=['0', '1'])
queue = cl.CommandQueue(ctx)
#notes: figure out matplotlib/agg image interpolation
# start with src/_image_resample.h:resample(...)
# agg_span_image_filter_gray.h / very end: -> clipping
import matplotlib as mpl
mpl.use('agg')
import matplotlib.pyplot as plt
import matplotlib.colors as mcolors
import matplotlib.image as mimage
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@geggo
geggo / RedPitaya.py
Created April 21, 2017 08:20
Red Pitaya Python Signal Generator and Vector Analyzer
import sys
import time
from traits.api import *
from traitsui.api import *
from traits_persistence import HasTraitsPersistent
import numpy as np
from RedPitayaProxy import RP_Proxy
import sys, traceback
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@geggo
geggo / test_unicode.ipynb
Created February 14, 2016 18:28
IPython notebook with unicode
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/bin/python
#-*- coding: latin-1 -*-
"""This module contains pure Python implementations of the
Levenberg-Marquardt algorithm for data fitting.
"""
import numpy
from numpy import inner, max, diag, eye, Inf, dot
from numpy.linalg import norm, solve