Friday 10 June 2016

Python and programming

When I started my Master's degree in 2014 I knew how to program in MATLAB. My supervisor suggested that I learnt OriginLab to process my data and make pretty graphs so I did. It took me several weeks to get the IT department to find who had the license keys to the university's distribution of OriginLab.
And after spending a year using OriginLab on a university PC (very slow machine) and being enormously frustrated at it eating all the RAM of the computer I decided to stop using proprietary softwares for my data handling. That meant scrapping MATLAB as well.

I had taken a half-day workshop in Python and knew that it was fairly similar to MATLAB in the basic data handling and plotting functionality. So after finishing my Master's degree I was waiting for my visa for going back to New Zealand for my PhD and decided to take a 10 week online course at edX from MITx in computer science using python. It was really good and I learnt to handle python pretty well. I've also heard great things about Codecademy from fellow PhD students.

I have since been doing all of my programming in python and I am very happy with my decision to learn it. I no longer have to worry about licenses or compatibility between operating systems.

Up until now I have mainly used Spyder for my python programming. It is a great way to convert from MATLAB to python, as it is built basically the same way. It also comes with almost all packages pre-installed and it is pretty much plug-and-play. If you are not used to using the terminal Spyder is a great choice. This week at a workshop run by MESA I was introduced to Atom and running scripts from the terminal. I think Atom is a much better code editor than the Spyder editor so I will be migrating over to Atom over the coming weeks. I will also take to opportunity to rewrite all of my scripts from python 2 to python 3. No major changes required, but it should be done.

If you are considering changing from programming in MATLAB to python, I definitely recommend it. It has an enormous amount of packages, and many people develop machine communication protocols in python (very useful for automatic experiment monitoring). Python has a very active community. Every time I have encountered a problem it is usually solved within a few minutes by typing in the package name or error message into Google.

Saturday 4 June 2016

Sewing machine

A few months ago I found what I had been looking for for a while: An old sewing machine!

On a trip the Souther landfill Second Treasures shop (second hand store) I found a great looking old sewing machine. The machine is a Pfaff Synchromatic 1209. It is made in West Germany, so it is pretty old. It is a very sturdy machine with a body mostly made of metal.

When I got it didn't sew particularly well, the threads kept making a mess. I found the original manual online and realised that the previous owner had not threaded the machine properly (and made extra notches for holding the thread instead). But even after threading the machine properly it kept making really ugly seams. So I got out a few screwdrivers and took apart the bobbin and soaked it in WD-40. I cleaned most of the insides with WD-40 too, and changed the needle (after finding a secret compartment on the side of the machine).

After letting the machine dry for a few weeks I put it all back together. I googled how to correctly set the bobbin thread tension and then gave it a try. And it ran beautifully! Below is a photo of the difference in seam quality before (left) and after (right) cleaning and re-tensioning. Notice the huge lumps of thread on the before picture? Haven't had a single incident like that since the cleaning.

Not bad for a $10 machine from the second hand store!