{"id":32,"date":"2019-12-10T22:27:33","date_gmt":"2019-12-10T22:27:33","guid":{"rendered":"https:\/\/logbooks.ifosim.org\/iucaa2019\/?p=32"},"modified":"2020-06-04T21:02:34","modified_gmt":"2020-06-04T19:02:34","slug":"example-post-finesse-code-for-a-simple-cavity","status":"publish","type":"post","link":"https:\/\/logbooks.ifosim.org\/iucaa2019\/2019\/12\/10\/example-post-finesse-code-for-a-simple-cavity\/","title":{"rendered":"Example Post"},"content":{"rendered":"\n<p>Lets see if I can figure out how to make a post with the common elements we might want, and include some how-to steps as I discover them:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>to insert hyperlinks with different displayed text, <em>first<\/em> write the display text, <em>then<\/em> highlight it and either hit ctrl\/cmd+k or the link icon at the top of the block.<\/li><li>change block type by either hitting the plus sign to the left, or the top left icon at the top of the current block<\/li><li>the &#8216;finesse&#8217; block is called &#8216;finesse plot&#8217;. it&#8217;s in the &#8216;widgets&#8217; category or you can jsut search for it when you hit the plus sign to add a block.<\/li><li>re-order blocks using the up\/down arrows or drag slider to the left of the block<\/li><li>use the backquote key (`) to enter in-line code <\/li><li>shift+return adds a line break without <br>starting a new block (&#8216;paragraph&#8217; blocks), or<br>adding a new item to a list<\/li><\/ul>\n\n\n\n<p>Now let&#8217;s try to make a finesse plot of an FP cavity. I think we&#8217;re restricted to pure finesse code here &#8211; later we hope to also have a good way to display (but not necessarily auto-run) PyKat examples. Showing my test code here for completeness and so the reader doesn&#8217;t have to hunt for it:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>l laser 1 0 n0   # Laser (Power = 1 W, wavelength offset = 0)\ns s1 1 n0 nc1    # Space (Length = 1 m)\n\n## The cavity ##\nm m1 0.7 0.3 0 nc1 nc2  # Mirror  (R = 0.7, T = 0.3, phi = 0)\ns sL 4000 nc2 nc3       # Space (Length = 4 km)\nm m2 0.8 0.2 0 nc3 nc4  # Mirror  (R = 0.8, T = 0.2, phi = 0)\n\n\n## Detectors ##\n\n# Photo diodes measureing DC-power\npd refl nc1          # Reflected field\npd circ nc2          # Circulating field\npd tran nc4          # Transmitted field\n\n## Simulation instructions ##\nxaxis m1 phi lin -450 90 2000   # Varying tuning of input mirror m1.\nyaxis abs                       # Plotting the amplitude of the detector measurements. <\/code><\/pre>\n\n\n\n<p>Once you have a &#8216;finesse plot&#8217; block, click &#8216;script&#8217; at the bottom, paste your code, then click &#8216;plot&#8217;, then &#8216;run&#8217; to show the output. It&#8217;ll be equivalent to the output of pykat&#8217;s <code>out.plot()<\/code> command (with default arguments).<\/p>\n\n\n\n<div class=\"ssl-finesse-kat-tab-panel\" style=\"width:460px\" data-img-width=\"460\" data-img-height=\"345\"><div class=\"ssl-finesse-kat-tab-panel-tab-container\" style=\"height:345px\"><div class=\"ssl-finesse-kat-tab-panel-tab ssl-finesse-kat-tab-panel-tab-selected\" data-tab=\"plot\"><div class=\"ssl-finesse-kat-plot\"><a class=\"ssl-finesse-kat-attachmenturl\" href=\"https:\/\/logbooks.ifosim.org\/iucaa2019\/wp-content\/uploads\/sites\/3\/2019\/12\/plot.svg\"><img decoding=\"async\" class=\"ssl-finesse-kat-plot-img\" src=\"https:\/\/logbooks.ifosim.org\/iucaa2019\/wp-content\/uploads\/sites\/3\/2019\/12\/plot.svg\" \/><\/a><\/div><\/div><div class=\"ssl-finesse-kat-tab-panel-tab\" data-tab=\"script\"><div class=\"ssl-finesse-kat-script\"><pre class=\"ssl-finesse-kat-script-input ssl-finesse-kat-script-input-display\"><code>l laser 1 0 n0   # Laser (Power = 1 W, wavelength offset = 0)\ns s1 1 n0 nc1    # Space (Length = 1 m)\n\n## The cavity ##\nm m1 0.7 0.3 0 nc1 nc2  # Mirror  (R = 0.7, T = 0.3, phi = 0)\ns sL 4000 nc2 nc3       # Space (Length = 4 km)\nm m2 0.8 0.2 0 nc3 nc4  # Mirror  (R = 0.8, T = 0.2, phi = 0)\n\n\n## Detectors ##\n\n# Photo diodes measureing DC-power\npd refl nc1          # Reflected field\npd circ nc2          # Circulating field\npd tran nc4          # Transmitted field\n\n## Simulation instructions ##\nxaxis m1 phi lin -450 90 2000   # Varying tuning of input mirror m1.\nyaxis abs                       # Plotting the amplitude of the detector measurements. <\/code><\/pre><\/div><\/div><\/div><ul class=\"ssl-finesse-kat-tab-panel-tabs\"><li class=\"ssl-finesse-kat-tab-panel-tab-link ssl-finesse-kat-tab-panel-tab-link-selected\" data-tab=\"plot\">Plot<\/li><li class=\"ssl-finesse-kat-tab-panel-tab-link\" data-tab=\"script\">Script<\/li><\/ul><\/div>\n\n\n\n<p>When viewing the post, you can toggle between the plot and code using the buttons below the figure.<\/p>\n\n\n\n<p>When viewing the post, you can toggle between the plot and code using the buttons below the figure.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"has-text-color has-background has-drop-cap has-vivid-cyan-blue-color has-pale-cyan-blue-background-color\">If you like you can also do fun colours and make it look like an illuminated book chapter using the options in the right-hand menu, but you&#8217;ll lose the settings you added if you then change to a different block type and back<\/p>\n\n\n\n<div class=\"wp-block-file\"><a href=\"https:\/\/logbooks.ifosim.org\/iucaa2019\/wp-content\/uploads\/sites\/3\/2019\/12\/SoftwareInstall.pdf\">SoftwareInstall<\/a><a href=\"https:\/\/logbooks.ifosim.org\/iucaa2019\/wp-content\/uploads\/sites\/3\/2019\/12\/SoftwareInstall.pdf\" class=\"wp-block-file__button\" download>Download<\/a><\/div>\n\n\n\n<p>I could upload the pdf fine using the post editor but it rejected the ipynb. Instead, to add notebooks, go to &#8220;Media&#8221; in the left-hand menu, and upload the file there. Then come back to the post editor and you can add a link to the notebook like so: <\/p>\n\n\n\n<div class=\"wp-block-file\"><a href=\"https:\/\/logbooks.ifosim.org\/iucaa2019\/wp-content\/uploads\/sites\/3\/2019\/12\/verify_installation.ipynb\">verify_installation<\/a><a href=\"https:\/\/logbooks.ifosim.org\/iucaa2019\/wp-content\/uploads\/sites\/3\/2019\/12\/verify_installation.ipynb\" class=\"wp-block-file__button\" download>Download<\/a><\/div>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Lets see if I can figure out how to make a post with the common elements we might want, and include some how-to steps as I discover them: to insert hyperlinks with different displayed text, first write the display text, then highlight it and either hit ctrl\/cmd+k or the link icon at the top of [&hellip;]<\/p>\n","protected":false},"author":63,"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":[],"ssl-alp-coauthor":[63],"class_list":["post-32","post","type-post","status-publish","format-standard","hentry","category-uncategorised"],"_links":{"self":[{"href":"https:\/\/logbooks.ifosim.org\/iucaa2019\/wp-json\/wp\/v2\/posts\/32","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\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/logbooks.ifosim.org\/iucaa2019\/wp-json\/wp\/v2\/comments?post=32"}],"version-history":[{"count":5,"href":"https:\/\/logbooks.ifosim.org\/iucaa2019\/wp-json\/wp\/v2\/posts\/32\/revisions"}],"predecessor-version":[{"id":448,"href":"https:\/\/logbooks.ifosim.org\/iucaa2019\/wp-json\/wp\/v2\/posts\/32\/revisions\/448"}],"wp:attachment":[{"href":"https:\/\/logbooks.ifosim.org\/iucaa2019\/wp-json\/wp\/v2\/media?parent=32"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/logbooks.ifosim.org\/iucaa2019\/wp-json\/wp\/v2\/categories?post=32"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/logbooks.ifosim.org\/iucaa2019\/wp-json\/wp\/v2\/tags?post=32"},{"taxonomy":"ssl-alp-coauthor","embeddable":true,"href":"https:\/\/logbooks.ifosim.org\/iucaa2019\/wp-json\/wp\/v2\/ssl-alp-coauthor?post=32"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}