Commit 350c61ce authored by Andreas Freise's avatar Andreas Freise
Browse files

cleaning up files up to this point.

parent 7ec0e7db
......@@ -83,13 +83,8 @@ def main():
tmpfile = shelve.open(tmpresultfile)
tmpfile['result']=result
tmpfile.close()
#-------------------------------------------------------------------
#-------------------------------------------------------------------
#-------------------------------------------------------------------
#---------------------------------------------------------------------------
def pd_signal(tmpkat):
......
......@@ -100,9 +100,14 @@ def main():
print "--------------------------------------------------------"
print " 8. compute ASC signal matrix at WFS1 and WFS2"
signal = asc_signal(kat)
print "--------------------------------------------------------"
print " 9. ASC signals for large misalignments (ITM)"
asc_large(kat)
print "--------------------------------------------------------"
print " Saving results in temp. files to be read by master2.py"
print " Saving results in temp. files to be read by master3.py"
tmpkatfile = "asc_base3.kat"
tmpresultfile = "myshelf2.dat"
print " kat object saved in: {0}".format(tmpkatfile)
......@@ -116,7 +121,7 @@ def main():
#-----------------------------------------------------------------------------------
def asc_signal(tmpkat):
kat = copy.deepcopy(tmpkat)
......
......@@ -7,14 +7,6 @@ import copy
import sys
import shutil
from itertools import cycle
import matplotlib
from matplotlib import rc
import matplotlib.pyplot as plt
formatter = matplotlib.ticker.EngFormatter(unit='', places=0)
formatter.ENG_PREFIXES[-6] = 'u'
def main():
print """
......@@ -27,7 +19,9 @@ def main():
to generate the Finesse results reported in the document:
`Comparing Finesse simulations, analytical solutions and OSCAR
simulations of Fabry-Perot alignment signals', LIGO-T1300345
This file is part of a collection. Run this after master2.py
Run this file to create the data and master3_plot.py to plot
the results. Results are saved after each step and plots can
be created at any time.
......@@ -59,7 +53,8 @@ def main():
print "--------------------------------------------------------"
print " 9. ASC signals for large misalignments (ITM)"
asc_large(kat)
#-----------------------------------------------------------------------------------
def asc_large(tmpkat):
kat = copy.deepcopy(tmpkat)
......@@ -98,46 +93,6 @@ def asc_large(tmpkat):
tmpfile['out']=out
tmpfile['maxtems']=done_maxtems
tmpfile.close()
def asc_signal(tmpkat):
kat = copy.deepcopy(tmpkat)
code_lock = """
set err PDrefl_p re
lock z $err 900 1p
put* ETM phi $z
noplot z
"""
kat.parseKatCode(code_lock)
kat.parseKatCode('yaxis abs')
kat.noxaxis = True
kat.maxtem=1
signal=np.zeros((2, 2))
kat.ITM.ybeta=1e-10
kat.ETM.ybeta=0.0
out = kat.run(printout=0,printerr=0)
WFS1_idx=out.ylabels.index("WFS1_I")
WFS2_idx=out.ylabels.index("WFS2_I")
signal[0,0] = out.y[WFS1_idx]
signal[1,0] = out.y[WFS2_idx]
kat.ITM.ybeta=0.0
kat.ETM.ybeta=-1e-10
out = kat.run(printout=0,printerr=0)
signal[0,1] = out.y[WFS1_idx]
signal[1,1] = out.y[WFS2_idx]
signal = signal *1e10
sensors=('WFS1', 'WFS2')
mirrors=('ITM', 'ETM')
print " ASC Matrix:"
for i in range(2):
print " ", sensors[i], " ",
for j in range(2):
print "%12.10g" % signal[i,j],
print mirrors[i]
return signal
if __name__ == '__main__':
......
......@@ -3,20 +3,14 @@ from pykat.commands import *
import pylab as pl
import numpy as np
import shelve
import copy
import sys
import shutil
from itertools import cycle
import matplotlib
from matplotlib import rc
import matplotlib.pyplot as plt
formatter = matplotlib.ticker.EngFormatter(unit='', places=0)
formatter.ENG_PREFIXES[-6] = 'u'
import matplotlib.backends.backend_pdf
def printPDF(self):
filename = 'test.pdf'
pdfp = matplotlib.backends.backend_pdf.PdfPages('large_ITM.pdf')
pdfp.savefig(self,dpi=300,bbox_inches='tight')
pdfp.close()
......@@ -50,15 +44,6 @@ def main():
#global out
#global result
tmpresultfile = 'myshelf2.dat'
# loading data saved by master.py
try:
tmpfile = shelve.open(tmpresultfile)
result=tmpfile['result']
tmpfile.close()
except: raise Exception("Could not open temprary results file {0}".format(tmpresultfile))
print "--------------------------------------------------------"
print " 9. Plotting ASC signals for large misalignments"
asc_large()
......
......@@ -7,13 +7,6 @@ import copy
import sys
import shutil
from itertools import cycle
import matplotlib
from matplotlib import rc
import matplotlib.pyplot as plt
formatter = matplotlib.ticker.EngFormatter(unit='', places=0)
formatter.ENG_PREFIXES[-6] = 'u'
def main():
......@@ -27,7 +20,9 @@ def main():
to generate the Finesse results reported in the document:
`Comparing Finesse simulations, analytical solutions and OSCAR
simulations of Fabry-Perot alignment signals', LIGO-T1300345
This file is part of a collection. Run this after master2.py
Run this file to create the data and master4_plot.py to plot
the results. Results are saved after each step and plots can
be created at any time.
......@@ -98,47 +93,6 @@ def asc_large(tmpkat):
tmpfile['out']=out
tmpfile['maxtems']=done_maxtems
tmpfile.close()
def asc_signal(tmpkat):
kat = copy.deepcopy(tmpkat)
code_lock = """
set err PDrefl_p re
lock z $err 900 1p
put* ETM phi $z
noplot z
"""
kat.parseKatCode(code_lock)
kat.parseKatCode('yaxis abs')
kat.noxaxis = True
kat.maxtem=1
signal=np.zeros((2, 2))
kat.ITM.ybeta=1e-10
kat.ETM.ybeta=0.0
out = kat.run(printout=0,printerr=0)
WFS1_idx=out.ylabels.index("WFS1_I")
WFS2_idx=out.ylabels.index("WFS2_I")
signal[0,0] = out.y[WFS1_idx]
signal[1,0] = out.y[WFS2_idx]
kat.ITM.ybeta=0.0
kat.ETM.ybeta=-1e-10
out = kat.run(printout=0,printerr=0)
signal[0,1] = out.y[WFS1_idx]
signal[1,1] = out.y[WFS2_idx]
signal = signal *1e10
sensors=('WFS1', 'WFS2')
mirrors=('ITM', 'ETM')
print " ASC Matrix:"
for i in range(2):
print " ", sensors[i], " ",
for j in range(2):
print "%12.10g" % signal[i,j],
print mirrors[i]
return signal
if __name__ == '__main__':
main()
......@@ -3,20 +3,14 @@ from pykat.commands import *
import pylab as pl
import numpy as np
import shelve
import copy
import sys
import shutil
from itertools import cycle
import matplotlib
from matplotlib import rc
import matplotlib.pyplot as plt
formatter = matplotlib.ticker.EngFormatter(unit='', places=0)
formatter.ENG_PREFIXES[-6] = 'u'
import matplotlib.backends.backend_pdf
def printPDF(self):
filename = 'test.pdf'
pdfp = matplotlib.backends.backend_pdf.PdfPages('large_ETM.pdf')
pdfp.savefig(self,dpi=300,bbox_inches='tight')
pdfp.close()
......@@ -50,15 +44,6 @@ def main():
#global out
#global result
tmpresultfile = 'myshelf2.dat'
# loading data saved by master.py
try:
tmpfile = shelve.open(tmpresultfile)
result=tmpfile['result']
tmpfile.close()
except: raise Exception("Could not open temprary results file {0}".format(tmpresultfile))
print "--------------------------------------------------------"
print " 10. Plotting ASC signals for large misalignments (ETM)"
asc_large()
......
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