{{ message }}

Instantly share code, notes, and snippets.

# sixtenbe

Last active Oct 1, 2021 — forked from endolith/peakdet.m
Peak detection in Python
View analytic_wfm.py
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
 #!/usr/bin/python2 # Copyright (C) 2016 Sixten Bergman # License WTFPL # # This program is free software. It comes without any warranty, to the extent # permitted by applicable law. # You can redistribute it and/or modify it under the terms of the Do What The # Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See
Created Sep 4, 2011
plotting in wxPython
View wxPlot.py
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 wx import matplotlib matplotlib.use('WXAgg') from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas from matplotlib.backends.backend_wx import NavigationToolbar2Wx from matplotlib.figure import Figure from matplotlib.ticker import ScalarFormatter, LogFormatter from os import path, remove
Created Sep 1, 2011
analytic wafeforms
View analytic_wfm.py
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 numpy import linspace from math import pi, sqrt, sin #Heavyside step function H = lambda t: 1 if t > 0 else 0 # pure sine ACV_A1 = lambda T, Hz = 50: 1000 * sqrt(2) * np.sin(2*pi*Hz * T) # ACV_A2 = lambda T, Hz = 50: 1000 * sqrt(2) * np.sin(2*pi*Hz * T) + 500
Created Sep 1, 2011
WXpython excepthook
View wx_except.py
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 wx import sys import traceback class Mainframe(wx.Frame): def __init__(self, parent, id = wx.ID_DEFAULT, title = "The title", **kwargs): sys.excepthook = self.excepthook super(Mainframe, self).__init__(parent, id, title, *args, **kwargs) #wx graphics code here