{"id":148,"date":"2019-12-18T12:36:02","date_gmt":"2019-12-18T12:36:02","guid":{"rendered":"https:\/\/logbooks.ifosim.org\/iucaa2019\/?p=148"},"modified":"2019-12-18T12:53:30","modified_gmt":"2019-12-18T12:53:30","slug":"simple-cavity-error-signal","status":"publish","type":"post","link":"https:\/\/logbooks.ifosim.org\/iucaa2019\/2019\/12\/18\/simple-cavity-error-signal\/","title":{"rendered":"Simple Cavity Error Signal"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>from pykat import finesse        # import the whole pykat.finesse package\nfrom pykat.commands import *     # import all packages in pykat.commands\nimport numpy as np               # for basic math\/sci\/array functions\nimport matplotlib.pyplot as plt  # for plotting\nimport scipy                     # for analysing the plots\n\n# tell the notebook to automatically show plots inline below each cell\n%matplotlib inline               \n# use pykat's plotting style. change dpi to change plot sizes on your screen\npykat.init_pykat_plotting(dpi=90)<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>basecode = \"\"\"\nl laser 0.005 0 n0   # Laser (Power = 5 mW, wavelength offset = 0)\ns s1 0.5 n0 nc1\n\n## The cavity ##\nm m1 0.99 0.01 0 nc1 nc2  # Mirror  (R = 0.99, T = 0.01, phi = 0)\ns sL 1 nc2 nc3            # Space (Length = 1 m)\nm m2 0.99 0.01 0.01 nc3 nc4  # Mirror  (R = 0.99, T = 0.01, phi = 0)\n\nfsig signal1 m2 phase 1000 0\n\"\"\"\n\n#initialise Finesse with a new empty kat object\nbasekat = finesse.kat() \n#tell Finesse to talk less\nbasekat.verbose = False\n#parse the Finesse code into PyKat\nbasekat.parse(basecode)\n\nkat1 = deepcopy(basekat)\nnewcode1 = \"\"\"\n# pd1 tran $fs nc4\npd1 tran 0 nc4\n\nxaxis signal1 f log 100 100k 1000\nput tran f1 $x1\nyaxis abs:deg\n\"\"\"\nkat1.parse(newcode1)\nout1 = kat1.run()\n\nout1.plot()<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>kat2 = deepcopy(basekat)\nnewcode2 = \"\"\"\npd tran nc4\n\nxaxis m2 phi lin -10 10 1000\nyaxis abs\n\"\"\"\nkat2.parse(newcode2)\nout2 = kat2.run()\n\nout2.plot()<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":31,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"ssl_alp_hide_revisions":false,"footnotes":"","ssl_alp_hide_crossreferences_to":false},"categories":[1],"tags":[41,43],"ssl-alp-coauthor":[32],"class_list":["post-148","post","type-post","status-publish","format-standard","hentry","category-uncategorised","tag-cavity","tag-locking"],"_links":{"self":[{"href":"https:\/\/logbooks.ifosim.org\/iucaa2019\/wp-json\/wp\/v2\/posts\/148","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/logbooks.ifosim.org\/iucaa2019\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/logbooks.ifosim.org\/iucaa2019\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/logbooks.ifosim.org\/iucaa2019\/wp-json\/wp\/v2\/users\/31"}],"replies":[{"embeddable":true,"href":"https:\/\/logbooks.ifosim.org\/iucaa2019\/wp-json\/wp\/v2\/comments?post=148"}],"version-history":[{"count":5,"href":"https:\/\/logbooks.ifosim.org\/iucaa2019\/wp-json\/wp\/v2\/posts\/148\/revisions"}],"predecessor-version":[{"id":155,"href":"https:\/\/logbooks.ifosim.org\/iucaa2019\/wp-json\/wp\/v2\/posts\/148\/revisions\/155"}],"wp:attachment":[{"href":"https:\/\/logbooks.ifosim.org\/iucaa2019\/wp-json\/wp\/v2\/media?parent=148"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/logbooks.ifosim.org\/iucaa2019\/wp-json\/wp\/v2\/categories?post=148"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/logbooks.ifosim.org\/iucaa2019\/wp-json\/wp\/v2\/tags?post=148"},{"taxonomy":"ssl-alp-coauthor","embeddable":true,"href":"https:\/\/logbooks.ifosim.org\/iucaa2019\/wp-json\/wp\/v2\/ssl-alp-coauthor?post=148"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}