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
# Scratch work for Maximum Length Sequence calculations. | |
import numpy as np | |
from scipy.signal import lfilter, lfiltic | |
# These are definitions of linear shift register taps for use in mls() | |
_mls_taps = {2: [1], 3: [2], 4: [3], 5: [2], 6: [5], 7: [6], 8: [7, 6, 1], | |
9: [5], 10: [7], 11: [9], 12: [11, 10, 4], 13: [12, 11, 8], | |
14: [13, 12, 2], 15: [14], 16: [15, 13, 4], 17: [14], |
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 | |
from scipy.signal.filter_design import _cplxreal | |
def pop_real(p): | |
"""Pop the first real value in the list p.""" | |
k = 0 | |
while k < len(p) and p[k].imag != 0: | |
k += 1 | |
if k == len(p): |
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
"""Base class for sparse matrice with a .data attribute | |
subclasses must provide a _with_data() method that | |
creates a new matrix with the same sparsity pattern | |
as self but with a different data array | |
""" | |
__all__ = [] |
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
from enable.api import Component, ComponentEditor | |
from enable.tools.api import DragTool | |
from traits.api import HasTraits, Instance | |
from traitsui.api import View, UItem | |
class MyDragTool(DragTool): | |
end_drag_on_leave = True |
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 | |
from scipy.stats.distributions import gamma_gen | |
class erlang_gen(gamma_gen): | |
def _argcheck(self, a): | |
good = (a > 0) & (np.floor(a) == a) | |
if not np.all(good): |
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 warnings | |
import numpy as np | |
from scipy.stats.distributions import gamma_gen, rv_continuous | |
class erlang_gen(gamma_gen): | |
"""An Erlang continuous random variable. | |
%(before_notes)s |
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
from __future__ import print_function, division | |
import time | |
import numpy as np | |
from numpy import convolve as np_convolve | |
from scipy.signal import convolve as sig_convolve, fftconvolve, firwin | |
from scipy.ndimage import convolve1d | |
from pylab import grid, show, legend, loglog, xlabel, ylabel, figure |
This file has been truncated, but you can view the full file.
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
.................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................KFKFKK.K.....K...........K...KKKSF..KSSKKKKKSK..K...S..SFKKKSKKKKKKK..K........................................................ | |
====================================================================== | |
FAIL: test_mpmath.TestSystematic.test_chebyt_int | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "/home/warren/anaconda/lib/python2.7/site-packages/nose/case.py", line 197, in runTest | |
self.test(*self.arg) | |
File "/home/warren/a |
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
.................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................K.K..F.K.....K...........K...KKKS...KSSKKKKKSK..K...S..S.KKKSKKKKKK............................................................. | |
====================================================================== | |
FAIL: test_mpmath.TestSystematic.test_ci | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "/home/warren/anaconda/lib/python2.7/site-packages/nose/case.py", line 197, in runTest | |
self.test(*self.arg) | |
File "/home/warren/anaconda |
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
# File: animated_gif_writer.py | |
# Author: Warren Weckesser | |
# License: BSD 2-Clause (http://opensource.org/licenses/BSD-2-Clause) | |
# | |
# Copyright (c) 2015, Warren Weckesser | |
# All rights reserved. | |
# | |
# Redistribution and use in source and binary forms, with or without | |
# modification, are permitted provided that the following conditions are met: | |
# |
OlderNewer