Skip to content

Instantly share code, notes, and snippets.

View endolith's full-sized avatar
😑

endolith

😑
View GitHub Profile
@endolith
endolith / zfft.py
Created August 14, 2021 18:36 — forked from aluchies/zfft.py
Zoom FFT functionality. Includes implementation of chirpz transform.
""" Zoom FFT function"""
import numpy as np
from time import time
from scipy.fftpack import fft, ifft
from numpy import swapaxes
def chirpz(x, A=None, W=None, M=None):
"""chirpz(x, A, W, M) - Chirp z-transform of variable x
@endolith
endolith / fourex.py
Last active December 2, 2022 00:48 — forked from tartakynov/fourex.py
Fourier Extrapolation in Python
import numpy as np
import pylab as pl
from numpy import fft
def fourierExtrapolation(x, n_predict):
n = x.size
n_harm = 10 # number of harmonics in model
t = np.arange(0, n)
p = np.polyfit(t, x, 1) # find linear trend in x
@endolith
endolith / bootstrap.ipynb
Created November 6, 2019 18:01 — forked from kjordahl/bootstrap.ipynb
Gaussian process bootstrap plots in iPython notebook
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@endolith
endolith / fftconv-conv-timings-2d.ipynb
Created July 24, 2019 19:19 — forked from stsievert/fftconv-conv-timings-2d.ipynb
constant timing for convolution methods (fft and direct)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@endolith
endolith / reverse_cmap.py
Last active July 26, 2017 18:11 — forked from stefanv/reverse_cmap.py
Reverse colormap
from skimage import io as sio
import skimage
import numpy as np
import matplotlib.pyplot as plt
filename = 'Lennert jet.png'
img = skimage.img_as_float(sio.imread(filename))[:,:,:3]
jet = plt.cm.jet
@endolith
endolith / gist-backup.py
Created May 18, 2012 15:49 — forked from nicerobot/backup.sh
Clone or update a user's gists locally
#!/usr/bin/env python
# Clone or update all a user's gists
# curl -ks https://raw.github.com/gist/1622504/gist-backup.py | python
# curl -ks https://raw.github.com/gist/1622504/gist-backup.py | USER=nicerobot python
import json
import urllib
from subprocess import call
from urllib import urlopen
import os
@endolith
endolith / matplotlibrc
Created May 16, 2012 02:56 — forked from huyng/matplotlibrc
my default matplotlib settings
### MATPLOTLIBRC FORMAT
# This is a sample matplotlib configuration file - you can find a copy
# of it on your system in
# site-packages/matplotlib/mpl-data/matplotlibrc. If you edit it
# there, please note that it will be overridden in your next install.
# If you want to keep a permanent local copy that will not be
# over-written, place it in HOME/.matplotlib/matplotlibrc (unix/linux
# like systems) and C:\Documents and Settings\yourname\.matplotlib
# (win32 systems).