Friday, September 18, 2015

How a blinky light helped me like coding

-Alison aka The reluctant coder

I know I should spend more time learning to code. It is an excellent way to solve problems, and if anything I see myself as a problem solver. I’ve had enough interactions with Matlab and Python (and good old Matplotlib) that I know firsthand how a little bit of coding knowledge goes a long way. I find that when I discover a problem where I know a solution involving code will ultimately save time and look more elegant, I find that because the time it would take me to set up said code, debug it, swear at it, and stubborn my way to a solution, could also be used to just solve it some more analog way. Now, if I only want to do something once, making a clunky excel spreadsheet is fine. However, if I want to process multiple datasets the same way, really I know I should just make the code and save future me lots of time. I know I am not alone when I choose to be mean to my future self and choose the more immediate results that come from sticking with what I know.
But I want to share with my fellow reluctant coders, the teachers of code to reluctant students, and the ‘don’t want to touch it with a ten foot pole’ coders. I think we can help reluctant coders be excited about coding with a single-board computer. Raspberry Pi, Arduino and many, many more of these programmable computers are on the market making makers, artists and scientists squee with the possibilities. They come in a range of prices and level of sophistication.

My current love affair with these programmable circuit boards started this semester when one of University at Buffalo’s resident Hydrologists, Chris Lowry, decided to run a course for graduate students (and postdocs who don’t mind spending time as a student still) using Arduino. Our goal is that by the end of the semester we will have all built a working sensor for our own research. As someone who studies destructive processes at volcanoes, and uses dynamite for my experiments, the idea of a sensor that can be lost and replaced without draining our research budget is very appealing. The sensors built on these platforms do not have the precision of high cost sensors with parts from professional tech companies, but they can make up for that in number. Want to know when the local stream level is high? Want to know if a debris flow is moving through a channel? Want to know if the ground is tilted over a specific threshold? All of these things I am promised I can make an Arduino do.
These resistors and wires will help me transform that piece of metal and plastic into a sensor that can be sent out to do dangerous jobs.
So the big picture motivation is one thing. The real reason I am so excited about my programmable sensor-to-be is the instant gratification of programming a responsive three-dimensional object. The very first tutorial that we did is the equivalent of ‘Hello World’ of classic coding tutorials where we make a tiny LED already built into the Arduino light up. Every student in the room exclaimed with satisfaction (and sometimes downright glee) when the board behaved the way they had told it to. Nothing against “Hello World,” but I was never that excited about a screen output. Then we added our own LED to the board and moved from programming to circuitry. Which, for me, is far more approachable. Its physical, rather than a string of characters. My brain is happy to follow wires and resistors, but it is likely to make text on a screen blur. I’ve known for years that I am a lazy typist. I grew up with spell check and a desire to move on to the next cool thing, not proofread my typed text. Now, I do work very hard to proofread what I write, but the best way for me to proofread is to physically print out my text and read it aloud. This is not very efficient when coding. Plus it would annoy all my fellow classmates…
Blink my little Arduino, Blink!
Regardless of your affinity for circuitry, the tangible and rapid response of a blinking light was inspiring. As we made more and more complicated circuits I finally found the motivation to make a more elegant code. The reason was again the circuit board. The little breadboard that comes in Arduino kits is tiny. If you want to have more than one LED or button on the board it gets messy fast. Then, because I wanted a less messy circuit I started wanting a tidy code. Our computer science TA can sleep better knowing that we won’t stop whining when he gives us advice on more elegant codes, but we might listen to him. These single-board computers are mostly open source with lots of tutorial codes and instructions available online so we can start adding complexity to our computers without having to be told to do it. Want your lights to blink out GEOLOGY in Morse code? Of course you can, and its not hard to find out how to do it either.
Buttons and LEDs bring inspiration to those less impressed by a string a text on a string. Use what works, right?
I still have a way to go until this little green piece of plastic and metal becomes something to use in my experiments. But I now know it is possible and reasonable to assume it will be more than just a well-behaved blinking light by November. These boards are a great confidence builder that helps even reluctant coders stick through the troubleshooting and error messages.
Three buttons and three LEDs doing my bidding. As the Kiwis taught me to say, I was chuffed. Though this mess of a breadboard made me want to make both my code and my circuit more organized!
What surprised me the most, is after a class in Arduino making buttons and LEDs do my bidding I started to think about that abandoned Python code. This really isn’t so bad, and I do like the results, maybe I can make that code help me more efficiently analyze crater shapes. I think sneaking programmable single-board computers into classes (at lots of levels) is a great way to move into the coding world, or break down the walls of reluctance that prohibit a lot of scientists from taking advantage of awesome technology and add one more tool to our problem solving kits.

 Now to use my renewed excitement and go see if I can get python to help me work on my craters.
Updated 11:51 am to reduce typos. I promise the typos were not an intentional way to show my point about my inability to see errors in text.

Wednesday, September 2, 2015

Science of art, art in science: a potter's perspective


While I love volcanoes and doing science, I do try to spend some time doing other things. In fact, I am frequently reminded that the best thing a person can do for their own success at work is to have something else in their life that is NOT work, but still feels valuable to them. For any graduate students I would actually stress that this includes you.
My activity that I do just for me is pottery. Which as a geologist isn't as separated from science as some might think. Science and art are not incompatible. Frankly I find them to be good friends. Where would we be if the early naturalists didn’t spend hours making amazing sketches of landscapes and animals? There would be several species that we know nothing about, or historical volcanic eruptions that changed the face of a mountain, but which part? If you are interested in science inspired art then Twitter has a hashtag for you #sciart. And if you are just into beautiful images of things from nature I would suggest #thinsectionthursday. A thin section is a 3 mm thick slice of rock that we shine light through to look at minerals and glass in detail. It is good to see the art even in our laboratory samples.  These are my personal favorites, but there are many more.
Thin sections are beautiful. This one even has a duck. This clinopyroxene is viewed through cross-polarized light surrounded by volcanic glass (black).
Pottery is made from earth materials, the clay body itself and the glaze, are made of mineral components. Pottery is a place for me to make a mess, build something, destroy it, and then rebuild it. I can experiment without focusing on precision, and I can incorporate elements of my love of geology into that work.
Making a mess while adding a foot to the bottom of a bowl.
Most clay bodies have a combination of clay minerals: kaolin, smectites, etc. The clays are phylosillicates which means that they form small crystalline sheets, where the key component is silica. The crystalline structure can absorb water readily between these sheets. There are hundreds of clay minerals that form from the breakdown of other minerals and can have lots of different cations: calcium, aluminum, potassium, magnesium, iron etc. When wet, clays are malleable, and that is what makes the whole process of pottery possible.

Vermiculite is a good example of sheet silicates (phylosillicates). You can see how the big chunks are made up of smaller sheets. Water can be stored between those sheets at a molecular level, that's what makes pottery possible. (Wikimedia commons).
Clay bodies can also contain other materials to help provide strength or reduce shrinkage that happens when you dry the clay out. Grog is a common additive to clay that is frequently made out of lithified clay, or clay that has already be heated in a kiln to a point where the individual grains have been cemented together.  Porcelain is on one end of the clay spectrum having no grog, and when you want to throw it is extra slippery, but does make very thin delicate pieces. Stoneware is a group of clays that contain various amounts of grog. Usually the more massive a piece you want to make, the more grog you want.

Glaze is a chemist’s playground. There is far more room for experimentation in glaze composition with results from the drab to the exciting. Glaze serves multiple purposes from decoration to making a surface watertight and food safe. The glaze most people are familiar with contains high amounts of silica, just like lava, which form a glassy or vitreous surface after being fired in a kiln. The components added to glaze not only make the colors change, but also control the temperature that the mixture melts. The addition of fluxes to a glaze, much like the combination of elements in magma, control what temperature it is liquid and what temperature it is a solid. As the geologists would expect, common fluxes include sodium, potassium and calcium. Elements that are there for color include iron, copper, cobalt and zinc. Cobalt and copper are usually attached to carbonates to help make them stable in the final glaze. Glazes used to contain lead, but like paint, we have learned how to make a full color palate without putting mobile toxic elements next to our food. You can still find decorative only glazes that contain elements you wouldn’t want to eat, but your neighborhood clay artist won’t be sneaking anything suspicious into the piece you liked at that craft fair. The final component is usually aluminum as it helps the glaze behave, or not run off the size of the pot when being fired.
Other color effects come from interactions between the clay body and the glaze, from being in an oxidizing or reducing environment, or salt added to the kiln. One of my favorite color techniques is to apply iron oxide directly to a piece then fire at high temperature in an oxidizing environment and it produces a nice rust color. Not good for eating, but it does help texture pop.
A bear modeling the iron oxide wash.
The temperatures that pottery is fired range from lower than magmatic temperatures to close to the basaltic liquidus at the Earth’s surface (600-1400 C, or 1300-2600 F). The liquidus is the temperature where a melt is completely liquid, no crystals or glass left. Basaltic lava usually erupts at 1100-1200 C on the surface of the Earth but by the time it is at the surface there are usually a few crystals starting to form. Rhyolite lavas erupt closer to 800-900 C. When a piece of pottery is made the first step is to form the clay and dry it. This piece, called greenware, is then fired at temperatures between 950-1000 C (1750-2100 F). This piece is now called bisqueware. It’s fairly stable, but not yet waterproof or ready for the hard usage of a dinner plate. Glaze gets applied as a paste, brushed, dipped, or sprayed on. Once this dries it gets fired again. The temperature that the glazed piece is fired ranges a lot more depending on the composition of the glaze and desired effect 999-1300 C (1830-2381 F). The silica needs to partially melt, but not run off the piece. When it cools it forms the glossy surface we want for a functional surface.

Glazing can be a stressful procedure with lots of opportunity for disappointment. However, when a glaze works just right it is super rewarding. Every potter finds their own happy approach to these steps. It takes a lot of time, occasional experimentation, failure, and adaptation. My current favorite approach to finishing pieces is to add some volcanic ash to my work. When I have access to high temperature equipment I mix the ash (typically very fine basaltic ash, well sorted) into a glaze. The result is small flecks of color from the iron and glass melting partially in the glaze.
The specks within the glaze are from basaltic ash from Askja Volcano in Iceland.
More recently I have been working at a studio at lower temperatures. So I have been taking ash, and in some cases small lapilli, and mixing them with a slurry of very wet clay to make what is called a slip. This slip gets applied to the still-wet pottery. The rest of the process follows in the same pattern described above. The final piece has a textural element and depending on the glaze some color from the ash. I also have been known to depict volcanoes on the pots.
Ash texture under white glaze. Ash from Sakurajima Japan.
Volcanic ash slip from Lunar Crater Volcanic Field under a yellow glaze.

Coarse ash from Sakurajima Volcano Japan under various green glazes.
I also will be more literal with some of my volcano and geology art. As most of these are gifts they tend to have a meaning to the recipient, whether they just love geology, or they want to see a certain location in 2-D on a piece they can use everyday. I've recently started making pieces for finishing graduate students. They provide me with ash or powdered rock from their field area and I turn it into a piece of pottery.
The Galapagos islands.
Lenticular clouds over Kamchatka Volcanoes.

Does your spoon holder have volcanoes on it? The volcanoes depicted are from Kamchatka and the ash is from Iceland.
I also have been known to depict other geologic relationships. You could use this as a block diagram to test student's knowledge of the basic principles of geology. Can you find the cross cutting relationships and name the type of fault?

I have also embraced larger pieces of volcanic rock, and just glued them on afterwards as an accent.
This lid handle is much better with a piece of scoria on it. You can note a map of faults and fractures in the background if you needed more proof that I am a geologist.

One of the most rewarding parts of making pottery is when you get to see your work incorporated into people's lives. They get to interact with your art, and they might even break it. But it provides good perspective. It is always good to make time for life outside of work, and art is one good way that I add balance to my life.