Commit 6e9d5c3c authored by Luke Campagnola's avatar Luke Campagnola
Browse files

Python 3 fixes for new demos

parent 0524bfa6
from pyoptic import *
\ No newline at end of file
from .pyoptic import *
\ No newline at end of file
......@@ -14,7 +14,7 @@ class GlassDB:
def __init__(self, fileName='schott_glasses.csv'):
path = os.path.dirname(__file__)
fh = gzip.open(os.path.join(path, 'schott_glasses.csv.gz'), 'rb')
r = csv.reader(fh.readlines())
r = csv.reader(map(str, fh.readlines()))
lines = [x for x in r]
self.data = {}
header = lines[0]
......@@ -47,8 +47,8 @@ class GlassDB:
info = self.data[glass]
cache = info['ior_cache']
if wl not in cache:
B = map(float, [info['B1'], info['B2'], info['B3']])
C = map(float, [info['C1'], info['C2'], info['C3']])
B = list(map(float, [info['B1'], info['B2'], info['B3']]))
C = list(map(float, [info['C1'], info['C2'], info['C3']]))
w2 = (wl/1000.)**2
n = np.sqrt(1.0 + (B[0]*w2 / (w2-C[0])) + (B[1]*w2 / (w2-C[1])) + (B[2]*w2 / (w2-C[2])))
cache[wl] = n
......
from chain import ChainSim
\ No newline at end of file
from .chain import ChainSim
\ No newline at end of file
import pyqtgraph as pg
import numpy as np
import time
from relax import relax
from .relax import relax
class ChainSim(pg.QtCore.QObject):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment