Well as those who know me, know that I've been on sort of a
Python kick lately. A few months ago I started
learning Python. So now that a few months have past I'll share the latest reason I like Python... Graphics....
Early in my time with
HRD I started working with graphical products. Initially I was playing with a product called
IDL. I thought the product was great, but we had a mathematician in join our group who was way more advanced with IDL than I and I let him take control of the product and was very happy to move on to other projects. This said I've always been interested in computer graphics as far back as I can remember... in grade school it started with Logo, and then Graphics on an Apple IIe.... Back to the some what present... even in grad school I took a course on
OpenGL, even made a nifty 3d maze game. Anyways again I digress (pretty typical of all my blog posts...)
So graphics has always been something I've wanted to get into, plus with the always evident idea in my group of making our product portable and deployable, I also new one day that I'd have to find a non-IDL/commercial solution. I state non-commercial as well since I could also have looked at MatLab or such. Anyways the first two products that leapt out at me a while back were
GDL a GNU clone of IDL and
Octave, another GNU project compatible with MatLab. The only problem was that GDL at the time did not support many of the IDL tools we were now using, and Octave... well I still don't know MatLab so that wasn't going to work.
Anyways.... so I place the idea of a free and distributable version of our product tools on the very back burner... you know the one that was never even attached to the stove...
So we move foward in time to the real present... Like I said in the beginning of the post, a few months ago I started learning Python. Like learning any new programming language, it is mostly syntax and package/module discovery. The syntax part was straight forwards, I'm a C/Fortran/Java/Unix scripter.... so yes, Python syntax, not anything new. As for packages... well they are abuyndant, but easily managable. Unlike Perl which I don't even know where to start on how large it has gotten (and yes in my early days I was even a Perl programmer), trying to find the 'best' package can take as long as trying to write your own... So as for Python, I quickly learned to read and write ASCII files and perform some simple mathematical calculations on data and a few other simpler tasks.
Then a co-worker of mine asked me about writing a program for a project he was looking into. The project seemed straight forward enough... read in a couple years worth of data (all of which were simple 2d matrixs), perform some simple stats on them (mean, std, median, min, max), spit out a simple ASCII summary, and generate some pretty pictures. All of the first steps seemed straight forward, the pretty pictures... well that was a different story. Anyways still being on my Pytohn kick, I quickly started out on this new project in Python. Took a couple of days to get the files read and stats processed, was even easier when I learned about
NumPy and
SciPy. NumPy is great, it provides great array handling for large matrixes and such. Plus now the reason for this post... an additional package called
MatPlotLib is also part of the NumPy/SciPy family. MatPlotLib made plotting the matrixes an almost breeze. Basically once I figured out my dimensions and the geospatial area for my map to plot on, all I had to do was give it my NumPy array and say draw, and poof.... pretty picture.

Don't ask me what the picture is exactly of, but ain't it pretty? I do know that it is some sort of thermal data from the GOES satellite (or atleast I think it is from the GOES satellite). But ain't that cool... all I did was create
Basemap and then tell it to plot using the pcolor(...) command. It was that simple. Another reason I think Python and I are going to have a long happy relationship. A few more tweaks and I should have my program fully ready to go... only issue is... currently it is kind of slow.