<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Diogo Aguiam on Medium]]></title>
        <description><![CDATA[Stories by Diogo Aguiam on Medium]]></description>
        <link>https://medium.com/@diogoaguiam?source=rss-86a69cdd7474------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*a_7GJ5TN3bZ8DYfrskidhA.jpeg</url>
            <title>Stories by Diogo Aguiam on Medium</title>
            <link>https://medium.com/@diogoaguiam?source=rss-86a69cdd7474------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 20 May 2026 12:53:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@diogoaguiam/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[ITER: the great fusion endeavour]]></title>
            <link>https://medium.com/@diogoaguiam/iter-the-great-fusion-endeavour-4aa293a9f2cb?source=rss-86a69cdd7474------2</link>
            <guid isPermaLink="false">https://medium.com/p/4aa293a9f2cb</guid>
            <category><![CDATA[climate-change]]></category>
            <category><![CDATA[fusion]]></category>
            <category><![CDATA[nuclear]]></category>
            <category><![CDATA[energy]]></category>
            <category><![CDATA[research]]></category>
            <dc:creator><![CDATA[Diogo Aguiam]]></dc:creator>
            <pubDate>Sat, 11 Nov 2017 11:23:57 GMT</pubDate>
            <atom:updated>2017-11-11T13:23:38.837Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LL-kszNR-uDV-9fEwpDkQg.jpeg" /><figcaption>Oleg Lavrentiev. Picture: Eyesteelfilm</figcaption></figure><p>Our use of fossil fuels has an accelerating countdown timer. Either we completely deplete our available reserves or we damage the environment just enough to prevent human society from continuing as we know it. We have to find alternative sources of clean energy, whatever they may be. As the head of the Electron Cyclotron Section of ITER and advocate of fusion energy, Dr. Mark Henderson, puts it: <em>“We are addicted to carbon. We have to prove, as a species, that we are collectively intelligent enough to prevent our own extinction.”</em> Fusion looks like a promising answer.</p><blockquote><em>We are addicted to carbon. We have to prove, as a species, that we are collectively intelligent enough to prevent our own extinction. — </em>Dr. Mark Henderson</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/340/0*teyStr0Sb2N7fOMs.jpg" /><figcaption>Dr. Mark Henderson. Picture: Eyesteelfilm</figcaption></figure><h3>Not there yet</h3><p>Fusion power plants will create artificial stars and become the clean energy source that will power our way of life in the future. But we are not quite there yet. At the moment, it takes a lot of energy to confine the plasma and a lot more to heat it up to the temperature required for fusion to occur. At this time, we are building ITER to prove that we will be able to obtain a net gain of energy output from a fusion reaction, sometime in the next 20 years. Then, DEMO, a prototype power plant, will be built in order to transform the excess output fusion energy into usable electricity, based on everything we learn from ITER.</p><blockquote><em>As fusion scientists we have the chance to impact the future of the hundreds or thousands of generations to come. — Dr. Mark Henderson</em></blockquote><h3>Long term commitment</h3><p>Generations of scientists have dedicated their whole careers to fusion research, but there is still a long way to go. The end goal is so far into the future that those who finally make fusion happen may not have even been born yet. The tens of thousands of scientists and individuals working towards fusion today are well aware that they might not be remembered in thirty or forty years, and that is okay. Believing in fusion is looking beyond the importance and the lifetime of our generation. Mark presumes that <em>“as fusion scientists we have the chance to impact the future of the hundreds or thousands of generations to come.”</em></p><h3>Fusion is part of our future</h3><p>Nuclear fusion is the epic scientific quest of our time. <em>“We have to face the fact that fusion is extremely complicated”</em>, warns Mark. <em>“We need to orient the scientific community and the population towards it. Otherwise, look at the consequences”</em>. Fusion is one of our best hopes, as a species, to have a sustainable and reliable near-limitless source of clean energy within the 21st century.<em> “I believe we will have multiple clean sources of energy in the future: solar, wind — but fusion will be the basis”</em>, says the ITER expert.</p><p><em>This article was originally published in the November Issue of the Fusion in Europe newsletter at </em><a href="https://www.euro-fusion.org/newsletter/fusion-endeavour/"><em>www.euro-fusion.org</em></a><em>. Check out the other great articles </em><a href="https://www.euro-fusion.org/newsletters/2017-november/"><em>here</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4aa293a9f2cb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Consistently writing your PhD dissertation]]></title>
            <link>https://medium.com/@diogoaguiam/consistently-writing-your-phd-dissertation-898d5d92a84c?source=rss-86a69cdd7474------2</link>
            <guid isPermaLink="false">https://medium.com/p/898d5d92a84c</guid>
            <category><![CDATA[writing]]></category>
            <category><![CDATA[phd-thesis]]></category>
            <category><![CDATA[phd]]></category>
            <category><![CDATA[phd-dissertation]]></category>
            <dc:creator><![CDATA[Diogo Aguiam]]></dc:creator>
            <pubDate>Sun, 15 Oct 2017 00:00:00 GMT</pubDate>
            <atom:updated>2017-10-15T04:47:56.805Z</atom:updated>
            <content:encoded><![CDATA[<p>You were advised since the beginning of your PhD to write your dissertation alongside your research. But you hit snooze and now it’s six months till due date and your draft barely has the tentative content list.</p><p>When you embark on a long-term project such as writing your dissertation, it’s easy to get distracted.</p><p>You tell yourself the deadline is still acceptably far away and you trust the last-minute adrenaline will make you more productive… later.</p><p>You procrastinate.</p><p><em>I procrastinate…</em></p><p>I am five weeks away from getting my draft of on the hands of my supervisor for review. I should be writing my thesis right now. Instead, I am writing this post, so go figure.</p><h3>Don’t break the chain</h3><p>A few years ago I read about Jerry Seinfeld’s awesome <a href="https://lifehacker.com/281626/jerry-seinfelds-productivity-secret"><em>Don’t break the chain</em></a> productivity hack:</p><blockquote>When you need motivation to accomplish a goal, get a calendar and set it up on your wall. For every day you work towards your goal, you cross that day with a big red maker on your calendar. At first it won’t seem much. But soon you will have an increasingly longer chain you’ll be proud of.</blockquote><p>I didn’t set up a calendar.</p><p>Instead, I set my dissertation project up on <a href="https://github.com/">GitHub</a>.</p><p>GitHub is a platform that hosts most of the world’s open source repositories. Any text based project can take advantage of the awesome features git version control has to offer! The online writing editor <a href="https://www.overleaf.com/signup?ref=28bea65b2da7">Overleaf <em>(referral link)</em></a> also provides <a href="https://www.overleaf.com/help/233-how-do-i-connect-an-overleaf-project-with-a-repo-on-github-gitlab-or-bitbucket">git</a> revision history!</p><p>Best of all, GitHub keeps track of my activity! Just look at my beautiful chain:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/745/0*QC9sLS1naixTbcQk.png" /><figcaption><em>hmm… those beautiful green markers</em></figcaption></figure><p>For every section or subsection I write, I add a new commit to my project. At the end of the day I push everything up to GitHub and check my activity. The more commits I push, the greener the marker.</p><p><em>Okay, I know this calendar shows activity in repositories besides my writing, but still… green…</em></p><h4><strong>There are git alternatives</strong></h4><p>A free GitHub account only allows you to create public repositories. This may be an issue when writing your unpublished thesis or papers (<a href="https://daguiam.github.io/blog/consistently-writing-PhD-dissertation-dont-break-the-chain#future-blog-post-perhaps?-would-you-do-it?-email-me"><em>unless you make your thesis writing public</em></a>). Maybe you qualify for a <a href="https://education.github.com/">student account</a> or you can <a href="https://github.com/pricing">subscribe</a> for unlimited private repositories.</p><p>You may otherwise want to try out <a href="https://gitlab.com/">GitLab</a>, which gives you similar features to plus private repositories with a free account.</p><p>It’s a matter of color preference, really:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/0*2ofmcuBvl54j1yaZ.png" /></figure><p><em>We use GitLab to host our research </em><a href="https://www.ipfn.tecnico.ulisboa.pt/"><em>institute</em></a><em>’s projects. We are working to make some of our repositories public in an effort to promote </em><a href="https://science.mozilla.org/"><em>Open Science</em></a><em>.</em></p><h3>Writing tips for git version control</h3><p>I am a huge fan of Microsoft’s <a href="https://code.visualstudio.com/">Visual Studio Code</a>. I use it for everything. Including writing my thesis! It’s free, incredibly fast and has integrated git version control that allows me to effortlessly push to GitHub.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/1*UpkdRGg1FY4jx3tzGFXWoQ.png" /><figcaption>Writing my thesis using Visual Studio Code with LaTeX Workshop extension</figcaption></figure><p>You can replicate my <a href="https://code.visualstudio.com/">Visual Studio Code</a> setup by installing both <a href="https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker">Code Spell Checker</a> and <a href="https://marketplace.visualstudio.com/items?itemName=James-Yu.latex-workshop">LaTeX Workshop</a> extensions, a <a href="http://www.tug.org/mactex/">LaTeX compiler</a>, and adding your <a href="https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/">GitHub repository</a>. But any LaTeX editor and git combination can be used to achieve the same results.</p><p>Here go some thesis writing tips:</p><ul><li>Write sentences in separate lines. This improves git version control.</li><li>Commit for every subsection you write or revise.</li><li>Commit and push every time you leave your computer, even with an unfinished section. This way you have daily cloud backups of your whole project.</li><li>Consider keeping your figure plotting scripts in the same project as your thesis.</li><li>Do check up on your contribution activity to see how long your chain is!</li><li>Share the link to your <a href="https://github.com/daguiam/">contribution activity</a> with your colleagues and supervisor. Make yourself accountable!</li></ul><h3>Find your unbreakable chain</h3><p>Consistency is key to achieving any long-term goal.</p><p>While it may be daunting to write a hundred-page dissertation, you know that it is just the sum of many small contributions.</p><p>Find a chain that suits you and keep at it daily. The longer your chain grows, the stronger it becomes, and the easier it gets to stay motivated.</p><p>Good luck.</p><p>Clap and share if you liked this post and <a href="https://daguiam.github.io/">follow me</a> for more.</p><p><em>Originally published at </em><a href="https://daguiam.github.io/blog/consistently-writing-PhD-dissertation-dont-break-the-chain"><em>https://daguiam.github.io/</em></a><em> on October 15, 2017.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=898d5d92a84c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Going DIY with PCB fabrication]]></title>
            <link>https://medium.com/@diogoaguiam/going-diy-with-pcb-fabrication-741c4ad9a446?source=rss-86a69cdd7474------2</link>
            <guid isPermaLink="false">https://medium.com/p/741c4ad9a446</guid>
            <category><![CDATA[hardware]]></category>
            <category><![CDATA[pcb]]></category>
            <category><![CDATA[fabrication]]></category>
            <category><![CDATA[diy]]></category>
            <category><![CDATA[electronics]]></category>
            <dc:creator><![CDATA[Diogo Aguiam]]></dc:creator>
            <pubDate>Thu, 07 Sep 2017 10:40:36 GMT</pubDate>
            <atom:updated>2017-09-07T10:40:36.990Z</atom:updated>
            <content:encoded><![CDATA[<h4>How we fabricated prototype PCBs back in college</h4><p>While there are plenty of online PCB fabrication facilities, sometimes you just have to get your hands dirty and DIY.</p><p>Back in college, going DIY meant an afternoon in the PCB lab, followed by a morning at the soldering bench.</p><p>Having a brand new PCB board was a luxury, so we would often have to salvage usable leftover corners from the scrap bin.</p><p>But why would you go DIY when you can outsource from a whole PCB industry?</p><p>Well.</p><p>Fabricating your own prototypes does allow for a quick design turnaround. And is highly educational for rookie EE students. Besides, not every class could afford the fabrication on top of the components for all the group projects. Students are free… Make them do it!</p><p>This resulted in a lot of ingenuity in cheap PCB manufacturing.</p><p>Our lab was equipped with a UV exposure machine, a CNC router, a laminator and a bubbly heated etching bath that <em>might</em> have its acid changed twice a year.</p><p>Most of this equipment was no match for our rookie hands, however.</p><p>We would curiously unwrap the photosensitive PCBs outside the dark room resulting in perfect copper plates for the CNC. However, the CNC bits would easily get stuck and break, and there were no replacements.</p><p>In the end, we adopted the <a href="https://www.instructables.com/id/PCB-Etching-Using-Toner-Transfer-Method/">toner transfer method</a>.</p><h4>Toner transfer method</h4><p>Here, we use a laser printer to print our mirrored design onto cheap old magazine paper. The copper plate board is placed face down on top the printout, duct taped to the paper, and swept through a heated laminator a few times for the toner to be released from the paper and stuck to the copper surface. The paper is removed and off to the acid spa.</p><p>The toner transfer method is great for single layer PCB, but is actually doable for <a href="https://www.instructables.com/id/Easy-Consistent-Cheap-Toner-Transfer-Method-for-Si/">double layers</a>.</p><h3>Back in the PCB lab</h3><p>During my final course project, a while ago, I fabricated several single and double layer prototypes before finally finishing the design and outsourcing the PCB.</p><p>Last week, a colleague needed help etching a double sided prototype. So, after a few years, I went back to the PCB lab and took a few photos to show for it.</p><h4>Preparing the mask sheets</h4><p>First we printed the mirrored top and non-mirrored lower masks onto separate magazine sheets. Here we use old football sticker albums that work great!</p><p>We trim one of the sheets to slightly larger than the PCB plate we using. Here we have a 6x6 cm design and used an approximately 8x10 cm plate. We cut at ~1 cm margin around the PCB.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XtQhHhx_qKKtQUG7a3ANqg.jpeg" /><figcaption>Bottom mask printed on a large magazine sheet and mirrored top mask cut out slightly bigger than the PCB plate.</figcaption></figure><h4>Careful alignment</h4><p>On top of the light box, or <a href="https://www.instructables.com/id/Easy-Consistent-Cheap-Toner-Transfer-Method-for-Si/">against a window</a>, we align both sheets to the holes of the design.</p><p>Aligning the top and bottom masks is the most important step in double layer prototyping using toner transfer.</p><p>We duct tape the aligned top and bottom sheets on three sides, making an envelope for the PCB to slide in. Preferably we would use paper tape, but here we used a regular transparent one.</p><p>The two sided copper plate is then slid into the envelope.</p><p>The top sheet is then stretched flat and the envelope is duct tape closed. This stretching allows alignment between both masks must be sustained during the toner transfer procedure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-Fi7R49FIlKC9a2MJl4_qg.jpeg" /><figcaption>Aligned top and bottom masks duct taped on three corners to allow double sided PCB plate to slide in from the side.</figcaption></figure><h4>Transferring the toner</h4><p>We now assume the alignment of the masks while we slide the sheets into the laminator.</p><p>The heat forces the toner to move from the magazine sheet onto the copper surface. It also shrinks the paper around the plate. The PCB is around 1.6 mm so it might seem that the masks have misaligned — but we assume they didn’t.</p><p>We repeat the lamination 4–6 times at around 150ºC</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0QvQYczXP5iXDQhQK0d7Vw.jpeg" /><figcaption>Duct taped PCB fixture goes through the heated laminator very slowly 4–6 times at 150ºC.</figcaption></figure><h4>Revealing the toner mask</h4><p>While the board is hot, after 5 sweeps through the laminator, we drown the board in water and let it soak for a few minutes. This will start to dissolve the paper and let the toner show on the copper surface. We rub the remaining paper with the smooth thumb skin, specially along the exposed tracks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_xcgC57_VLulszV9f1EXEw.jpeg" /><figcaption>Toner transferred to double sided PCB after removing soaked paper. No way to verify that both sides are truly aligned.</figcaption></figure><h4>Etching our board</h4><p>We offer the board a nice warm ferric chloride bath. Our bath is already a few months old and highly saturated so the board takes around 25 minutes to etch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ikkCq8SXTImZAcGg0Lr_Fw.jpeg" /><figcaption>Off to the acid bath it goes</figcaption></figure><h4>Getting results</h4><p>We take the board off the bath when the desired design is etched. We take it out before removing the side copper to prevent over etching of the copper under the protective toner. Some unfortunate etching may still occur due to the grainy paper toner structure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k_4qusxZc9RzQNka0jO-pg.jpeg" /><figcaption>Finished board on light box. The old acid takes too long to remove large unprotected copper surfaces so we took out the board earlier to prevent over etching</figcaption></figure><p>The board is cut out to the correct size and the leftover toner removed by swabbing acetone on both sides.</p><p>Then it’s off to the drilling and via stitching!</p><p><a href="https://twitter.com/diogoaguiam"><em>Follow me around the web</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=741c4ad9a446" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using jupyter notebooks for reproducible publication figures]]></title>
            <link>https://medium.com/@diogoaguiam/using-jupyter-notebooks-for-reproducible-publication-figures-9a195f8c6f1d?source=rss-86a69cdd7474------2</link>
            <guid isPermaLink="false">https://medium.com/p/9a195f8c6f1d</guid>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Diogo Aguiam]]></dc:creator>
            <pubDate>Thu, 17 Aug 2017 12:48:59 GMT</pubDate>
            <atom:updated>2017-08-17T12:48:59.009Z</atom:updated>
            <content:encoded><![CDATA[<p>I usually keep a single python script for each publication figure. The source data is loaded, processed and finally plotted. This allows me to quickly change xy limits or tweak the font size of the third subplot legend. I just have to make the necessary changes and execute the script. The new figure is automatically created and I do not have to mess with any editing programs.</p><p>This method has worked great for me for the past few years. I keep the source code for all the figures as well as code snippets that I may later reuse and share with others.</p><p>Now this is all great when the loading and processing the data doesn’t take that long. I can quickly type the figure changes and rerun the script to see the results.</p><p>However, recently I had to load a 30 GB dataset each time I ran the script, followed by a few minutes of processing. This quickly became boring as I wasn’t managing to get the figure just right.</p><p>Then I found out about <a href="http://jupyter.org/">jupyter</a> notebooks for python. jupyter allows for interactive Mathematica-style notebooks which allow you to execute chunks of code at a time. I can keep the processed data in memory and execute only the code related to the figure plotting.</p><p>In addition, jupyter works by running a server accessible through a web interface. This means I can run the python scripts locally or on a remote server.</p><p>I usually access the data through the computing cluster hosted by the research institute. The most straightforward programming must be done through an SSH session or a VNC interface. Using a jupyter session running in the server allows me to access all the data from the comfort of my own computer without caring for AFS configuration or missing libraries or environment paths.</p><p>So… how to set up the jupyter environment?</p><p>First of all, make sure jupyter is installed and accessible . Try running jupyter notebook. This creates the local server and should open up a browser session to the default <em>localhost:8888</em> URL.</p><p>I used the anaconda module that should include jupyter.</p><p>If you’re running on the same servers as I, do</p><pre>$ module unload python27/basic<br>$ module load anaconda<br>$ jupyter notebook</pre><p>This is great for running local jupyter notebooks. But we want remote access.</p><p>So we must set up the jupyter server to accept any incoming IP addresses and protect it a little bit with a password and encryption. We don’t want anyone with the URL to run arbitrary code on our remote system.</p><p>For this I followed the configuration in <a href="http://jupyter-notebook.readthedocs.io/en/latest/public_server.html">http://jupyter-notebook.readthedocs.io/en/latest/public_server.html</a></p><p>But I resume it here:</p><p>First generate the default configuration file for the jupyter session, in case it doesn’t exist yet:</p><pre>$ jupyter notebook --generate-config</pre><p>Then create a password to access the jupyter interface from the web</p><pre>$ jupyter notebook password<br>Enter password: **** <br>Verify password: **** <br>[NotebookPasswordApp] Wrote hashed password to /Users/you/.jupyter/jupyter_notebook_config.json </pre><p>Now we should create a certificate to use in our encrypted sessions. Go into a known directory where you want to store your certificates and you may create a self signed certificate by:</p><pre>$ openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout mykey.key -out mycert.pem</pre><p>Remember the path to this folder.</p><p>Now make your jupyter server public. Go into the generated jupyter configuration file in <em>/Users/you/.jupyter/jupyter_notebook_config.json</em></p><p>Inside this file, add the paths to your certificates</p><pre>c.NotebookApp.certfile = u’/absolute/path/to/your/certificate/mycert.pem&#39;<br>c.NotebookApp.keyfile = u’/absolute/path/to/your/certificate/mykey.key&#39; </pre><p>Set the IP to * so that any IP can connect to the jupyter</p><pre>c.NotebookApp.ip = &#39;*&#39;</pre><p>If you ran the previous password command, the hashed password is already stored somewhere else making this line redundant</p><pre>c.NotebookApp.password = u’sha1:bcd259ccf...&lt;your hashed password here&gt;&#39; </pre><p>You may disable the automatic opening of the web browser when starting the jupyter server. Since it is running remotely, you don’t need it anyway.</p><pre>c.NotebookApp.open_browser = False </pre><p>And finally fix the port to access the jupyter web interface.</p><pre>c.NotebookApp.port = 9999 </pre><p>Now just open up a web browser and go to <em>https://serverip:port/</em></p><p><a href="http://jupyter-notebook.readthedocs.io/en/latest/public_server.html">http://jupyter-notebook.readthedocs.io/en/latest/public_server.html</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9a195f8c6f1d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>