Skip to content

Instantly share code, notes, and snippets.

View fzimmermann89's full-sized avatar

Felix F Zimmermann fzimmermann89

View GitHub Profile
from __future__ import print_function
import threading
from joblib import Parallel, delayed
import Queue
import os
# Fix print
_print = print
_rlock = threading.RLock()
def print(*args, **kwargs):
###### SETTINGS ######
url= '"
username = ""
password = ""
team_name = ""
channel_name = ""
#######################
import os
import requests
@fzimmermann89
fzimmermann89 / radial_profile.py
Created February 22, 2020 03:00
radialprofile
def radial_profile(data, center=None, calcStd=False, os=1):
'''
calculates a radial profile of ND data around center. will ignore nans
calStd: calculate standard deviation, return tuple of (profile, std)
os: oversample by a factor. With default 1 the stepsize will be 1 pixel, with 2 it will be .5 pixels etc.
'''
if center is None:
center = np.array(data.shape)//2
if len(center) != data.ndim:
raise TypeError('center should be of length data.ndim')
@fzimmermann89
fzimmermann89 / ifi.py
Last active February 18, 2020 22:27
2d correlation
import numpy as np
#this accum class is ripped out of some of my other code, I think it should work standalone now
#or we just do it another way, we just need a mean^^
class accumulator:
'''
simple accumulator for large number of data points. allows retrieval of mean and stdev
'''
def __init__(self, like=None):
self._n = 0
<!DOCTYPE html>
<html>
<head>
<title>Leaflet debug page</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.0.0-beta.2/leaflet.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.0.0-beta.2/leaflet.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="screen.css" />