{"id":1872,"date":"2018-03-01T20:51:53","date_gmt":"2018-03-02T04:51:53","guid":{"rendered":"http:\/\/antoine.wojdyla.fr\/blog\/?p=1872"},"modified":"2018-04-26T16:37:04","modified_gmt":"2018-04-27T00:37:04","slug":"oasys","status":"publish","type":"post","link":"http:\/\/antoine.wojdyla.fr\/blog\/2018\/03\/01\/oasys\/","title":{"rendered":"Oasys"},"content":{"rendered":"<p>With increasingly tight beamline specifications, optical modeling software becomes necessary in order to design and predict the performances of conceptual beamlines. This becomes particularly true with the advent of highly coherent light sources (such the proposed upgrade of the ALS), where additional considerations such mirror deformation under heat load and effects of partial coherence needs to be studied. Luca Rebuffi will present the latest features of OASYS\/Shadow, an optical beamline modeling tool widely used in the synchrotron community and show how to get started with beamline simulations.<\/p><a href=\"https:\/\/github.com\/awojdyla\/ALS-U_Examples\" onclick=\"_gaq.push(['_trackEvent', 'outbound-article', 'https:\/\/github.com\/awojdyla\/ALS-U_Examples', 'https:\/\/github.com\/awojdyla\/ALS-U_Examples']);\" >https:\/\/github.com\/awojdyla\/ALS-U_Examples<\/a><\/p><a href=\"http:\/\/antoine.wojdyla.fr\/blog\/wp-content\/uploads\/zero-order.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-1892 aligncenter\" src=\"http:\/\/antoine.wojdyla.fr\/blog\/wp-content\/uploads\/zero-order.png\" alt=\"\" width=\"209\" height=\"187\" srcset=\"http:\/\/antoine.wojdyla.fr\/blog\/wp-content\/uploads\/zero-order.png 618w, http:\/\/antoine.wojdyla.fr\/blog\/wp-content\/uploads\/zero-order-300x269.png 300w\" sizes=\"auto, (max-width: 209px) 100vw, 209px\" \/><\/a><u>Program:<\/u> <!--more--><u><br \/>\n<\/u><\/p><strong>Monday February 26th, 2018<\/strong>: Introduction and discussions<br \/>\n<em>(B2-400 all day) 2pm: ALS\/CXRO Seminar | Luca Rebuffi (2-400)<\/em><\/p><strong>Tuesday February 27th, 2018<\/strong>:<br \/>\n9-11am (B15-300): Modeling ALS-U flagship beamline with OASYS<br \/>\n1-5pm (B2-200): Using SRW to create a source in Oasys<\/p><strong>Wednesday February 28th<\/strong>, 2018<br \/>\n9am-12pm (B6-1105): Tutorial on scripting with OASYS<br \/>\n1-5pm (B2-200): Tutorial on widgets with OASYS<\/p><strong>Thursday March 1st, 2018<\/strong>: Tutorial on widgets with OASYS<br \/>\n9am-6pm (B2-200)<\/p><strong>Friday March 2nd, 2018<\/strong>: Advanced topics<br \/>\nAndrew McPhee (LLNL) &#8211; crystals<br \/>\nWidgets and parameter loops<\/p><strong>Monday March 5th, 2018<\/strong>:<br \/>\n9am-12pm (B2-200) Tutorial on basic usage of Oasys<br \/>\n1-5pm: Publishing widgets on PyPI and distributing them<\/p><strong>Tuesday March 6th, 2018<br \/>\n<\/strong>Visit of SLAC<strong><br \/>\n<\/strong><\/p><strong>Wednesday March 7th, 2018<br \/>\n<\/strong>Wrap-up and conclusion<\/p>\n<h1 id=\"OASYS\/ShadowatLBNL-GettingstartedwithOASYS\">Getting started with OASYS<\/h1><p>Download it here: <a href=\"https:\/\/www.elettra.trieste.it\/oasys.html\" onclick=\"_gaq.push(['_trackEvent', 'outbound-article', 'https:\/\/www.elettra.trieste.it\/oasys.html', 'https:\/\/www.elettra.trieste.it\/oasys.html']);\" class=\"external-link\"  rel=\"nofollow\">https:\/\/www.elettra.trieste.it\/oasys.html<\/a><\/p>It works with Max and Linux; if you&#8217;re using a Windows PC, you will need to use a <a href=\"https:\/\/nul.elettra.eu\/f\/0e579d4aa35e46b6a2b4\/\" onclick=\"_gaq.push(['_trackEvent', 'outbound-article', 'https:\/\/nul.elettra.eu\/f\/0e579d4aa35e46b6a2b4\/', 'virtual machine']);\" class=\"external-link\"  rel=\"nofollow\">virtual machine<\/a>.<\/p>You can also try a web-based version of Shadow at <a href=\"http:\/\/sirepo.lbl.gov\" onclick=\"_gaq.push(['_trackEvent', 'outbound-article', 'http:\/\/sirepo.lbl.gov', 'sirepo.lbl.gov']);\" class=\"external-link\"  rel=\"nofollow\">sirepo.lbl.gov<\/a> (it doesn&#8217;t have the same user interface, but most of the capabilities and a nice collaborative environment.)<\/p>\n<h1 id=\"OASYS\/ShadowatLBNL-ShadowOui-Tutorial\">ShadowOui-Tutorial<\/h1><p>Files for tutorial are available here:<\/p><a href=\"https:\/\/github.com\/srio\/ShadowOui-Tutorial\" onclick=\"_gaq.push(['_trackEvent', 'outbound-article', 'https:\/\/github.com\/srio\/ShadowOui-Tutorial', 'https:\/\/github.com\/srio\/ShadowOui-Tutorial']);\" class=\"external-link\"  rel=\"nofollow\">https:\/\/github.com\/srio\/ShadowOui-Tutorial<\/a><\/p>(clone and dowload&gt; download zip &gt; unzip on your computer and you&#8217;re good to go<\/p>OR type\u00a0<code>git clone <a href=\"https:\/\/github.com\/srio\/ShadowOui-Tutorial.git\" onclick=\"_gaq.push(['_trackEvent', 'outbound-article', 'https:\/\/github.com\/srio\/ShadowOui-Tutorial.git', 'https:\/\/github.com\/srio\/ShadowOui-Tutorial.git']);\" class=\"external-link\"  rel=\"nofollow\">https:\/\/github.com\/srio\/ShadowOui-Tutorial.git<\/a> <\/code>in your terminal window)<\/p>WARNING: It is recommended to download the FULL directory (in a zip for example). Downloading the individual *.ows files may not work (if doing that, click the &#8220;RAW&#8221; button in github before downloading).<\/p><a href=\"https:\/\/github.com\/srio\/ShadowOui-Tutorial\/blob\/master\/tutorial_shadowoui.pdf\" onclick=\"_gaq.push(['_trackEvent','download','https:\/\/github.com\/srio\/ShadowOui-Tutorial\/blob\/master\/tutorial_shadowoui.pdf']);\" class=\"external-link\"  rel=\"nofollow\">ShadowOui tutorial<\/a>\u00a0(pdf kindly provided by M. Sanchez del Rio, replete with python scripting and other nice tricks)<\/p>\n<h2 id=\"OASYS\/ShadowatLBNL-AboutShadow,ShadowOuiandOASYS\">About Shadow, ShadowOui and OASYS<\/h2><p>Shadow is a software developed for the optical simulation of beamlines. It features many options. It is a ray-tracing based simulation, and implicity assumes an incoherent beam, without diffraction effects (there are ways to incorporate these effects, see below.)<\/p>\n<h2 id=\"OASYS\/ShadowatLBNL-Someexamplesofbeamlinedesign\">Some examples of beamline design<\/h2><p>Canonical examples to come!<\/p>\n<h2 id=\"OASYS\/ShadowatLBNL-HowtousePython\">How to use Python<\/h2><p>make sure you always import\u00a0<code>numpy<\/code> and\u00a0<code>Shadow<\/code>\u00a0in your scripts:<\/p>\n<pre><code class=\"language-python\">import Shadow\r\nimport numpy as np<\/code><\/pre><p>Then you can access the properties of\u00a0<code>in_object_1<\/code>, e.g. the first column<\/p>\n<pre><code class=\"language-python\">x = in_object_1._beam.getshonecol(1)<\/code><\/pre><p>A proper documentation is still needed, here&#8217;s a description for the columns for earch ray:<\/p><em>Each ray is an array of 18 variables or columns. Each variable of column has an special physical meaning. The first six defines the geometry: spatial coordinates (Col. 1,2,3 or x, y and z, respectively) and the direction of the ray (cols. 4,5,6, or x\u2019,y\u2019 and z\u2019, respectively). The rest of the columns defines the history of the ray traversing the optical system (electric vector for s-polarization (cols. 7,8,9) and p-polarization (cols. 16-18), flag for lost ray (10), wavelength (11)<\/em><\/p>This is for accessing data within Oasys.<\/p>Now if you want to play around more, here&#8217;s how to do so:<\/p>\n<pre><code class=\"language-python\">src = Shadow.Source()\r\noe1 = Shadow.OE()\r\noe2 = Shadow.OE()\r\nbeam = Shadow.Beam()<\/code><\/pre><p>In the case we want to read variables from existing files do:<\/p>\n<pre><code class=\"language-python\">src.load(\u201cstart.00\u201d)\r\noe1.load(\u201cstart.01\u201d)\r\noe2.load(\u201cstart.02\u201d)<\/code><\/pre><p>For applying to the beam the source:\u00a0<code>beam.genSource(src)<\/code><\/p>For tracing the two optical elements:<\/p>\n<pre><code class=\"language-python\">beam.traceOE(oe1)\r\nbeam.traceOE(oe2)<\/code><\/pre><p>Write binary file:<\/p>\n<pre><code class=\"language-python\">beam.write('star.02')<\/code><\/pre>\n<pre><code class=\"language-python\">Shadow.ShadowTools.plotxy(beam,1,3)\r\nShadow.ShadowTools.histo1(beam,1)<\/code><\/pre>\n<h2 id=\"OASYS\/ShadowatLBNL-Afewthingstoknow:\">A few things to know:<\/h2>\n<ul>\n<li>The coordinate system is always relative to the previous optical element (o.e)<\/li>\n<li>you can set the continuation plane at zero to get full control of the coordinates<\/li>\n<\/ul>\n<h2 id=\"OASYS\/ShadowatLBNL-DiffractionandPartialcoherence\">Diffraction and Partial coherence<\/h2><p>Use Wise & HYBRID<\/p>\n<h2 id=\"OASYS\/ShadowatLBNL-Othersoftwareandresources\">Other software and resources<\/h2><p>The webpage of the\u00a0<a href=\"https:\/\/www.elettra.eu\/Conferences\/2016\/SOS\/Main\/Program\" onclick=\"_gaq.push(['_trackEvent', 'outbound-article', 'https:\/\/www.elettra.eu\/Conferences\/2016\/SOS\/Main\/Program', 'SOS Workshop 2016\u00a0']);\" class=\"external-link\"  rel=\"nofollow\">SOS Workshop 2016\u00a0<\/a>has many resources.<\/p>Software:<\/p>\n<ul>\n<li><a href=\"http:\/\/beta.sirepo.com\/\" onclick=\"_gaq.push(['_trackEvent', 'outbound-article', 'http:\/\/beta.sirepo.com\/', 'Sirepo']);\" class=\"external-link\"  rel=\"nofollow\">Sirepo<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/ochubar\/SRW\" onclick=\"_gaq.push(['_trackEvent', 'outbound-article', 'https:\/\/github.com\/ochubar\/SRW', 'SRW']);\" class=\"external-link\"  rel=\"nofollow\">SRW<\/a>\u00a0(Synchrotron Radiation Workshop; coherent, diffraction-based simulations)<\/li>\n<li><a href=\"https:\/\/github.com\/kklmn\/xrt\" onclick=\"_gaq.push(['_trackEvent', 'outbound-article', 'https:\/\/github.com\/kklmn\/xrt', 'xrt']);\" class=\"external-link\"  rel=\"nofollow\">xrt<\/a>\u00a0(XRayTracer; it has a Shadow backend, and a\u00a0<a href=\"http:\/\/xrt.readthedocs.io\/\" onclick=\"_gaq.push(['_trackEvent', 'outbound-article', 'http:\/\/xrt.readthedocs.io\/', 'comprehensive documentation']);\" class=\"external-link\"  rel=\"nofollow\">comprehensive documentation<\/a>)<\/li>\n<li><a href=\"http:\/\/www.helmholtz-berlin.de\/forschung\/oe\/fg\/nanometeroptik\/science\/layout\/ray_en.html\" onclick=\"_gaq.push(['_trackEvent', 'outbound-article', 'http:\/\/www.helmholtz-berlin.de\/forschung\/oe\/fg\/nanometeroptik\/science\/layout\/ray_en.html', 'RayUI']);\" class=\"external-link\"  rel=\"nofollow\">RayUI<\/a><\/li>\n<li><a href=\"https:\/\/www.lighttrans.com\/\" onclick=\"_gaq.push(['_trackEvent', 'outbound-article', 'https:\/\/www.lighttrans.com\/', 'Virtual Lab']);\" class=\"external-link\"  rel=\"nofollow\">Virtual Lab<\/a>\u00a0&#8211; (proprietary, but\u00a0<a href=\"https:\/\/www.elettra.eu\/Conferences\/2016\/SOS\/uploads\/Main\/Abstract1366.pdf\" onclick=\"_gaq.push(['_trackEvent','download','https:\/\/www.elettra.eu\/Conferences\/2016\/SOS\/uploads\/Main\/Abstract1366.pdf']);\" class=\"external-link\"  rel=\"nofollow\">can be used for modeling<\/a>)<\/li>\n<li><a href=\"http:\/\/spectrax.org\/spectra\/\" onclick=\"_gaq.push(['_trackEvent', 'outbound-article', 'http:\/\/spectrax.org\/spectra\/', 'spectra']);\" class=\"external-link\"  rel=\"nofollow\">spectra<\/a><\/li>\n<\/ul><p>Using Zemax is feasible, but not recommended<\/p>\n<h2 id=\"OASYS\/ShadowatLBNL-Referencesandcitation\">References and citation<\/h2>\n<ul>\n<li>&#8220;<a href=\"http:\/\/www.mhprofessional.com\/handbookofoptics\/vol5.php\" onclick=\"_gaq.push(['_trackEvent', 'outbound-article', 'http:\/\/www.mhprofessional.com\/handbookofoptics\/vol5.php', 'Ray Tracing of X-Ray Optical Systems']);\" class=\"external-link\"  rel=\"nofollow\">Ray Tracing of X-Ray Optical Systems<\/a>&#8221; by F. Cerrina and M. Sanchez del Rio in Handbook of Optics (volume V, 3rd edition, Ch 35), edited by M. Bass, Mc Graw Hill, New York, 2009. ISBN: 0071633138 \/ 9780071633130<\/li>\n<li>&#8220;<a href=\"http:\/\/dx.doi.org\/10.1107\/S0909049511026306\" onclick=\"_gaq.push(['_trackEvent', 'outbound-article', 'http:\/\/dx.doi.org\/10.1107\/S0909049511026306', 'SHADOW3: a new version of the synchrotron X-ray optics modelling package']);\" class=\"external-link\"  rel=\"nofollow\">SHADOW3: a new version of the synchrotron X-ray optics modelling package<\/a>&#8221; by M. Sanchez del Rio, N. Canestrari, F. Jiang and F. Cerrina in J. Synchrotron Rad. (2011). 18, 708-716<\/li>\n<li>&#8220;<a href=\"http:\/\/dx.doi.org\/10.1117\/12.2061834\" onclick=\"_gaq.push(['_trackEvent', 'outbound-article', 'http:\/\/dx.doi.org\/10.1117\/12.2061834', 'A proposal for an open source graphical environment for simulating X-ray optics']);\" class=\"external-link\"  rel=\"nofollow\">A proposal for an open source graphical environment for simulating X-ray optics<\/a>&#8221; by M. Sancez del Rio, L. Rebuffi, J. Dem\u0161ar, N.Canestrari and O. Chubar in Proc. SPIE 9209, 92090X (2014)<\/li>\n<li>&#8220;<a href=\"http:\/\/dx.doi.org\/10.1107\/S1600577516005014\" onclick=\"_gaq.push(['_trackEvent', 'outbound-article', 'http:\/\/dx.doi.org\/10.1107\/S1600577516005014', 'DABAM: an open-source database of X-ray mirrors metrology']);\" class=\"external-link\"  rel=\"nofollow\">DABAM: an open-source database of X-ray mirrors metrology<\/a>&#8221; by M. Sanchez del Rio, D. Bianchi, D. Cocco, M. Glass, M. Idir, J. Metz, L. Raimondi, L. Rebuffi, R. Reininger, X. Shi, F. Siewert, S. Spielmann-Jaeggi, P. Takacs, M. Tomasset, T. Tonnessen, A. Vivo and V. Yashchuk in J. Synchrotron Rad. 23 (2016)<\/li>\n<li>&#8220;<a href=\"http:\/\/dx.doi.org\/10.1107\/S1600577516013837\" onclick=\"_gaq.push(['_trackEvent', 'outbound-article', 'http:\/\/dx.doi.org\/10.1107\/S1600577516013837', 'ShadowOui: A new visual environment for X-ray optics and synchrotron beamline simulations']);\" class=\"external-link\"  rel=\"nofollow\">ShadowOui: A new visual environment for X-ray optics and synchrotron beamline simulations<\/a>\u201d by L. Rebuffi, M. Sanchez del Rio in J. Synchrotron Rad. 23 (2016)<\/li>\n<li>&#8220;<a href=\"http:\/\/dx.doi.org\/10.1117\/12.2274263\" onclick=\"_gaq.push(['_trackEvent', 'outbound-article', 'http:\/\/dx.doi.org\/10.1117\/12.2274263', 'OASYS (OrAnge SYnchrotron Suite): an open-source graphical environment for x-ray virtual xperiments']);\" class=\"external-link\"  rel=\"nofollow\">OASYS (OrAnge SYnchrotron Suite): an open-source graphical environment for x-ray virtual xperiments<\/a>\u201d by L. Rebuffi, M. Sanchez del Rio in Proc. SPIE 10388, 103880S (2017) &#8220;<a href=\"http:\/\/dx.doi.org\/10.1117\/12.2274232\" onclick=\"_gaq.push(['_trackEvent', 'outbound-article', 'http:\/\/dx.doi.org\/10.1117\/12.2274232', 'Interoperability and complementarity of simulation tools for beamline design in the OASYS environment']);\" class=\"external-link\"  rel=\"nofollow\">Interoperability and complementarity of simulation tools for beamline design in the OASYS environment<\/a>\u201d by L. Rebuffi, M. Sanchez del Rio in Proc. SPIE 10388, 1038808 (2017)<\/li>\n<\/ul><p>Using Shadow\/Oasys:<\/p>\n<ul>\n<li>&#8220;<a href=\"http:\/\/doi.org\/10.1117\/12.2274571\" onclick=\"_gaq.push(['_trackEvent', 'outbound-article', 'http:\/\/doi.org\/10.1117\/12.2274571', 'X-ray optics simulation and beamline design for the APS upgrade']);\" class=\"external-link\"  rel=\"nofollow\">X-ray optics simulation and beamline design for the APS upgrade<\/a>&#8221; by Shi, X., Reininger, R., Harder, R., & Haeffner, D. in Advances in Computational Methods for X-Ray Optics IV, 10388, 12 (2017)<\/li>\n<li>&#8220;<a href=\"http:\/\/doi.org\/10.1107\/S1600577517010281\" onclick=\"_gaq.push(['_trackEvent', 'outbound-article', 'http:\/\/doi.org\/10.1107\/S1600577517010281', 'Mutual optical intensity propagation through non-ideal mirrors']);\" class=\"external-link\"  rel=\"nofollow\">Mutual optical intensity propagation through non-ideal mirrors<\/a>&#8221; by Meng, X., Shi, X., Wang, Y., Reininger, R., Assoufid, L., & Tai, R. (2017). in Journal of Synchrotron Radiation, 24(5), 954\u2013962 (2017) (2014).<\/li>\n<li>&#8220;<a href=\"http:\/\/doi.org\/10.1107\/S160057751400650X\" onclick=\"_gaq.push(['_trackEvent', 'outbound-article', 'http:\/\/doi.org\/10.1107\/S160057751400650X', 'A hybrid method for X-ray optics simulation: Combining geometric ray-tracing and wavefront propagation']);\" class=\"external-link\"  rel=\"nofollow\">A hybrid method for X-ray optics simulation: Combining geometric ray-tracing and wavefront propagation<\/a>&#8221; by Shi, X., Reininger, R., Sanchez Del Rio, M., & Assoufid, L. in Journal of Synchrotron Radiation, 21(4), 669\u2013678 (2014<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>With increasingly tight beamline specifications, optical modeling software becomes necessary in order to design and predict the performances of conceptual beamlines. This becomes particularly true with the advent of highly coherent light sources (such the proposed upgrade of the ALS), where additional considerations such mirror deformation under heat load and effects of partial coherence needs [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,16,5],"tags":[],"class_list":["post-1872","post","type-post","status-publish","format-standard","hentry","category-english","category-resources","category-science-life"],"_links":{"self":[{"href":"http:\/\/antoine.wojdyla.fr\/blog\/wp-json\/wp\/v2\/posts\/1872","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/antoine.wojdyla.fr\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/antoine.wojdyla.fr\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/antoine.wojdyla.fr\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/antoine.wojdyla.fr\/blog\/wp-json\/wp\/v2\/comments?post=1872"}],"version-history":[{"count":3,"href":"http:\/\/antoine.wojdyla.fr\/blog\/wp-json\/wp\/v2\/posts\/1872\/revisions"}],"predecessor-version":[{"id":1893,"href":"http:\/\/antoine.wojdyla.fr\/blog\/wp-json\/wp\/v2\/posts\/1872\/revisions\/1893"}],"wp:attachment":[{"href":"http:\/\/antoine.wojdyla.fr\/blog\/wp-json\/wp\/v2\/media?parent=1872"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/antoine.wojdyla.fr\/blog\/wp-json\/wp\/v2\/categories?post=1872"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/antoine.wojdyla.fr\/blog\/wp-json\/wp\/v2\/tags?post=1872"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}