Python 3 fixes for new demos
This commit is contained in:
parent
0524bfa6e8
commit
6e9d5c3cfb
@ -1 +1 @@
|
|||||||
from pyoptic import *
|
from .pyoptic import *
|
@ -14,7 +14,7 @@ class GlassDB:
|
|||||||
def __init__(self, fileName='schott_glasses.csv'):
|
def __init__(self, fileName='schott_glasses.csv'):
|
||||||
path = os.path.dirname(__file__)
|
path = os.path.dirname(__file__)
|
||||||
fh = gzip.open(os.path.join(path, 'schott_glasses.csv.gz'), 'rb')
|
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]
|
lines = [x for x in r]
|
||||||
self.data = {}
|
self.data = {}
|
||||||
header = lines[0]
|
header = lines[0]
|
||||||
@ -47,8 +47,8 @@ class GlassDB:
|
|||||||
info = self.data[glass]
|
info = self.data[glass]
|
||||||
cache = info['ior_cache']
|
cache = info['ior_cache']
|
||||||
if wl not in cache:
|
if wl not in cache:
|
||||||
B = map(float, [info['B1'], info['B2'], info['B3']])
|
B = list(map(float, [info['B1'], info['B2'], info['B3']]))
|
||||||
C = map(float, [info['C1'], info['C2'], info['C3']])
|
C = list(map(float, [info['C1'], info['C2'], info['C3']]))
|
||||||
w2 = (wl/1000.)**2
|
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])))
|
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
|
cache[wl] = n
|
||||||
|
@ -1 +1 @@
|
|||||||
from chain import ChainSim
|
from .chain import ChainSim
|
@ -1,7 +1,7 @@
|
|||||||
import pyqtgraph as pg
|
import pyqtgraph as pg
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import time
|
import time
|
||||||
from relax import relax
|
from .relax import relax
|
||||||
|
|
||||||
|
|
||||||
class ChainSim(pg.QtCore.QObject):
|
class ChainSim(pg.QtCore.QObject):
|
||||||
|
Loading…
Reference in New Issue
Block a user