Skip to content
Snippets Groups Projects
Commit f8bb0250 authored by Andreas Freise's avatar Andreas Freise
Browse files

fixing cavity_scan to work with Python 3

parent d07d891d
No related branches found
No related tags found
No related merge requests found
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
"""
Fabry-Perot cavity scan example.
......@@ -314,14 +318,14 @@ r = kat.run()
# output the raw FINESSE file that PyKat has generated
scriptList = kat.generateKatScript()
print ''.join(scriptList)
print (''.join(scriptList))
# calculate and print cavity finesse
r1r2 = np.sqrt(parameters['cavity']['itm']['reflectivity']['inner']) * np.sqrt(parameters['cavity']['etm']['reflectivity']['inner'])
finesse = np.pi / (2 * np.arcsin((1 - r1r2) / (2 * np.sqrt(r1r2))))
print "Cavity finesse: {0:.0f}".format(finesse)
print ("Cavity finesse: {0:.0f}".format(finesse))
# create plot
pl.plot(r.x, r.y)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment