Commit 8a55e2af authored by Daniel Brown's avatar Daniel Brown
Browse files

updates

parent 2928044a
......@@ -8,9 +8,9 @@ kat = pykat.finesse.kat()
cmds = """
l l1 1 0 n0
s s0 1000 n0 n1
s s0 100 n0 n1
m m1 0.5 0.5 0 n1 n2
s s1 10 n2 n3
s s1 100 n2 n3
m m2 0.5 0.5 0 n3 n4
s s2 20 n4 n5
bs bs1 0.5 0.5 0 0 n5 n6 n7 n8
......@@ -25,13 +25,13 @@ bs bs2 0.5 0.5 0 0 n9 n12 n13 n14
s s6 3 n12 n15
lens lens1 20 n15 n16
lens lens1 200 n15 n16
s s7 500 n16 n17
gouy g1 x s0 s1 s2
#gouy g1 x s0 s1 s2
bp bp1 x w0 n5
#bp bp1 x w0 n5
gauss g1 l1 n0 8e-3 -1000 4e-3 -1200
noxaxis
maxtem 0
......
......@@ -527,6 +527,9 @@ class kat(object):
if kat_file != None:
self.loadKatFile(kat_file)
def deepcopy(self):
return copy.deepcopy(self)
def getAll(self, type):
"""
Returns a collection of all objects of the type argument that are
......@@ -725,12 +728,18 @@ class kat(object):
pkex.PrintError("Error processing constants:", ex)
sys.exit(1)
def removeBlock(self, name):
def getBlocks(self):
return self.__blocks.keys()
def removeBlock(self, name, failOnBlockNotFound=True):
if name not in self.__blocks:
pkex.PrintError("Error removing block:", pkex.BasePyKatException('Block "{0}" was not found'.format(name)))
sys.exit(1)
if failOnBlockNotFound:
pkex.PrintError("Error removing block:", pkex.BasePyKatException('Block "{0}" was not found'.format(name)))
sys.exit(1)
else:
return
for o in self.__blocks[name].contents:
self.remove(o)
......
......@@ -347,7 +347,7 @@ class surfacemap(object):
fig = pylab.figure()
pcm = pylab.pcolormesh(xRange, yRange, self.data, vmin=zmin, vmax=zmax)
pcm = pylab.pcolormesh(xRange, yRange, self.data)
pcm.set_rasterized(True)
pylab.xlabel('x [cm]')
......@@ -358,8 +358,8 @@ class surfacemap(object):
pylab.title('Surface map {0}, type {1}'.format(self.name, self.type))
cbar = fig.colorbar(axes)
cbar.set_clim(zmin, zmax)
cbar = pylab.colorbar()
#cbar.set_clim(zmin, zmax)
if clabel is not None:
cbar.set_label(clabel)
......
......@@ -64,7 +64,7 @@ def plot_beam_trace(_kat, from_node, to_node):
for n in range(len(spaces)):
s = spaces[n]
Lmax = s.L
N = 100
N = 1000
node = None
cmds = """
......
Supports Markdown
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