Archive for Programming

Plotting data on videos – A useful way to convey qualitative and quantitive information

flameheight_boxscale_cb_rad1



Every once in a while, someone makes an impression on you that lasts for a lifetime. It sticks with you every single time. This is one of those, although a bit on the nerdy side, it is one that can change the way you present information in a very meaningful way.

I was once sitting at the NIST annual fire conference, going about my business, and someone working on a project regarding the structural response aspect of buildings on fire showed a video in their presentation. No big deal, right? Normally, we get cool fire videos, then some plots, and so on. Sometimes the plots are interesting, sometimes they are default from Excel with the ugly legend and all – with no story to tell.

But not this guy. He showed a video with real-time plots superimposed over the video showing the exact real-time structural response of the structure overlaid on the video in a plot. “AMAZING!” I thought. And it stuck with me. A useful way to convey synchronous information. People love videos, why not tell the qualitative AND quantitative story at the same time?

So I started working in grad. school on fire problems, and naturally, soon thereafter, I was scheduled to give a presentation. As most of my real creative coding and writing work happens of hours between the hours of 1 AM and 6 AM, I wanted to make this happen. I REALLY wanted some real-time plotting action in my presentation. No Excel templates for me! So I stayed up for a couple nights and worked on a way to use MATLAB to make this plotting dream a reality: I worked on importing videos, messing with frame rates, tons of images, and so forth. And soon thereafter, it happened. I had a working script.

I used it to show plots of large-scale fire tests with actual and predicted flame heights vs. time as seen here:

You need to a flashplayer enabled browser to view this YouTube video



And I used the script to show the predicted flame heights on a small-scale test in an amazing way that just about anyone can relate to, fire-crazed scientist or not:

You need to a flashplayer enabled browser to view this YouTube video



From anyone who has seen the videos firsthand, the response has been amazing. This is a great teaching and communication tool, and surprisingly enough, I haven’t found any existing program or tool that does this. And so I am sharing the videos and script here for anyone to use to better convey information.

My next steps are: 1) to convert the script to Python (since I am now almost exclusively using Python+numpy+scipy for my graduate research and daily work instead of MATLAB, and 2) to make the script into a cross-platform and easy to use tool.

I’m providing the code in its raw and uncommented and unedited form. It generates a number of images with plots superimposed on them, and then it is trivial to use a program to stitch them together into a video. I used Quicktime’s built in method. Sorry, too much current work going on finishing my MS thesis and Master’s degree to clean up the code, but it’s a brutal use of the “release early, release often” ideal! Hopefully someone can make some use of it.

So, here are the linked .m files:

http://www.koverholt.com/scripts/ssPlotVideo.m
http://www.koverholt.com/scripts/fireplotVideo.m

Enjoy! And please leave your comments or ideas!

Comments (1) »


The Arrival of Collaboration in Fire Protection Engineering

Earlier today, the professor for my Combustion class mentioned that for our final project, we will be working on a problem that currently has no solution. This intrigued me of course, as I wondered if our final grades would have no solution as well. After he explained, it made all the more sense and reminded me why my love and passion is in the field of fire protection engineering, the school I go to, and the people I work with: they all heavily align with my values and principles of sharing knowledge and making information available to everyone, everywhere.

[From NASA]

So, let me explain his model simply by example:

The professor said that when he first started this class 2 years ago, the students were working on a different problem with no solution… at the time. The class worked together and in the end the results were so significant that a couple of students took the initiative to publish the results in a scientific journal. The same happened when the class was taught last year – project done, paper published.

So what does this mean and why do you care? Well, all too often in the academic world, people can get caught up in working on projects and sort of work themselves into a dark corner where nobody gets to benefit from the results… and this is done in real life as well, not just academics. This is where the ridiculous amount of collaborative technology available to us comes in to play. Want to gather up notes on the Smagorinsky constant and publish them for anyone to find who is searching for them in the next 1000 years? Easy: 5 minutes. Want to publish your results in the most useful way? Easy: work on an open source project in your area along with your research – or make your own.

…Or you could write a paper, finish your thesis work, wrap up the loose ends in a few years and show a flashy poster of your work 5 years after anybody cares about it anymore or thinks it to be useful.

I digress. I just wanted to stress this new method of collaboration that is among us, and how it’s going to change the way that we work together and grow together in fire protection engineering and fire science.

[From Rowan University College of Engineering]

Why not make use of motivated students and brainpower when they come together? Here is me welcoming this new phase of community and collaboration in a field that directly impacts life safety and makes safer buildings around the world. So when we work on that final project in a few weeks, it’s not really at all about a grade anymore – it’s about a new way of doing science – together.

Update: This is exactly the kind of stuff that I’m talking about here, posted today on the SFPE National blog that I set up a year ago – collaboration: Foundation Funded Research underway at WPI

Comments (1) »


Passionate and Artful Communication in Science

So there are scientists, and there are artful scientists. Here’s version 0.9999 of the graph from my last post in all of its full and smooth glory. It’s for a homework exercise in my combustion course (go ahead, click for full size – it’s fantastic):

Well, why do you care about my graph? I certainly do. There are many books about conveying information in statistics and how to present data in a very informationally dense format, sure. But let’s think about this graph that I made for a homework assignment. The purpose of the homework was for me to learn, yes? And that nice orange line bought me some extra credit worth 25 points, but that’s another story. I want to learn it inside out, run it amongst others, and in the end communicate great things to many, many people. Every time. With every action.

So I could have left the default Excel settings for the chart, but my soul cannot allow such a thing.

This graph shows relationships, it runs a conversation with itself and lets the numbers drive by each other and say hello. It’s living, and it talks to me. Check out the dark red diamond line called “Mixture Fraction”. This guy drives all of the others. Then the f’s come in. Then we go back to the real quantities like the mass fraction of oxygen (Yo) and fuel (Yf) and we can also grab temperature (in Kelvin) based off of what those f’s are telling each other.

Yes, yes, Kris. You are talking nonsense, I don’t like it. Well, perhaps I’m not as eloquent and direct as this guy (watch this great motivating video, do I ever let you down?):

You need to a flashplayer enabled browser to view this YouTube video

But our messages are the same. Do what you love, and work your ass off at it. All the time. Not the old and dead cliched way of “do what you love” – but the minute by minute, day by day, just got home tired from work but I need more, but I don’t have the time, wake up and do it, it keeps you up and night, but I want to watch TV every day, what you REALLY want to do, an exact thing/action/pursuit every day until you die – kind of way.

If I wasn’t here loving my graphs at 2:34 AM in the morning and pondering the million things I just learned from this 4 day exercise, I’d quit. If I doubted for a second (as the guy in the video says), I’d do us all a favor and leave here. But I want this knowledge, and these relationships so very badly. And when the end-result comes along, I have a sick urge to spend so much time and detail on things so that others may benefit. Make your life, thoughts, and business public, and see what happens to it. It skyrockets.

Now do you see why I care about my graph? I’m proud of what it represents. Now go off and care about your own graph. For the rest of us.

Leave a comment »