Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
from matplotlib import cm | |
import numpy as np | |
from skimage import data | |
from skimage.color import rgb2gray | |
from colorspacious import cspace_converter | |
I = data.astronaut() | |
I = rgb2gray(I) | |
cmaps = ['gray', 'magma', 'jet', 'RdGy'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
from scipy.spatial import KDTree | |
# Generate some number of sites in | |
# the square [0, 1] x [0, 1] | |
np.random.seed(0) | |
n_sites = 20 | |
sites = np.random.rand(n_sites, 2) | |
# Create random velocities |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import scipy.io.wavfile as wavfile | |
import matplotlib.pyplot as plt | |
duration = 20 | |
fs = 44100 | |
y = np.zeros(fs*duration) | |
n_harmonics = 5 | |
t = np.arange(fs*duration) # INCORRECT SAMPLING | |
#t = np.linspace(0, duration, fs*duration) # CORRECT SAMPLING |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
from mpl_toolkits.mplot3d import Axes3D | |
def getEDM(X): | |
""" | |
Compute an all pairs distance matrix using broadcasting | |
and matrix multiplications to speed up computations | |
Parameters | |
---------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Programmer: Chris Tralie | |
Purpose: To show how to plot "time-ordered point clouds" | |
with colors on the rainbow to indicate the time | |
(red beginning, magenta end) | |
""" | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from mpl_toolkits.mplot3d import Axes3D |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Programmer: Chris Tralie ([email protected]) | |
Purpose: To implement the connection Laplacian and show its use | |
for synchronizing a set of vectors on an NxN grid | |
""" | |
import numpy as np | |
import numpy.linalg as linalg | |
from scipy import sparse | |
from scipy.sparse.linalg import lsqr, cg, eigsh | |
import matplotlib.pyplot as plt |