Skip to content

Instantly share code, notes, and snippets.

View DanHickstein's full-sized avatar

Danhickstein DanHickstein

  • Octave Photonics
  • Boulder, CO
View GitHub Profile
import numpy as np
import matplotlib.pyplot as plt
import sys, os
import abel
transforms = [
("BASEX" , 'basex' ),
("Lin-BASEX" , 'linbasex' ),
("Direct" , 'direct' ),
% \documentclass{article}
\documentclass[preview]{standalone}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{color}
\renewcommand{\familydefault}{\sfdefault}
\definecolor{c1}{RGB}{114,0,172} % primary
# from abel.analytical import GaussianAnalytical
import matplotlib.pyplot as plt
import numpy as np
import scipy.integrate
import time
import warnings
# warnings.filterwarnings("ignore")
r = np.linspace(0,10,51)
height = 5
import numpy as np
import matplotlib.pyplot as plt
import sys
import abel
import scipy.integrate
transforms = [
# ("BASEX" , abel.basex.basex_transform),
# ("linbasex" , abel.linbasex.linbasex_transform),
# must have higher symmetry for linbasex
import numpy as np
import matplotlib.pyplot as plt
from pynlo.devices.grating_compressor import TreacyCompressor as tc
import pynlo
l_mm = 940
angle = 47.5
comp = tc(l_mm,angle)
import numpy as np
import matplotlib.pyplot as plt
from numpy import linspace, pi, log10, exp
# from numpy.fft import fft, ifft, fftshift # Sometimes numpy is faster
from scipy.fftpack import fft, ifft, fftshift # but usually scipy is faster
from scipy.misc import factorial
from scipy.integrate import complex_ode
import scipy.ndimage
import time
import numpy as np
import scipy.ndimage
import matplotlib.pyplot as plt
before = np.zeros((10,10))
before[5] = 1
# after = np.rot90(before) # uncomment to switch to np.rot90s
after = scipy.ndimage.interpolation.rotate(before, 45)
import numpy as np
import matplotlib.pyplot as plt
import time
ns = 2**(np.arange(4,14))
times = np.zeros_like(ns, dtype='float')
rep = 10
for count, n in enumerate(ns):
im = np.random.random((n,n))
@DanHickstein
DanHickstein / linalg_compare0.2.py
Created September 5, 2018 13:16
Comparison of np.linalg.solve
import numpy as np
import matplotlib.pyplot as plt
import timeit
import time
length = 10
ns = 2**np.arange(0,length)
t0s = np.zeros(length)
t1s = np.zeros(length)
@DanHickstein
DanHickstein / StageAndThorUpdated4.py
Created September 13, 2018 16:57
Thorlabs OSA and thorlabs rotation stage
# -*- coding: utf-8 -*-
"""
StageAndThor.py
By Grace Kerber and Dan Hicktein ([email protected])
This program connects a Thorlabs Rotation Stage and a Thorlabs OSA (ours OSA 205)
# to take power scans while recording the spectra
"""
# This program defines zero as the position when stage is plugged into computer, will home in first part of code