Python make pretty pictures
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.
New Treo 850?!?!
So Palm has announced its latest Treo on its way the 850! I’ve also seen a number of posts listing the specs. And for the most part I keep hearing praises. Yes this phone is a good thing, not only has Palm finally added WiFi but they’ve also added GPS. So why do I not sound so exited about this? Very simple…. check out the last spec line in the PalmAddicts post linked here: PalmAddicts: Palm again makes me want one!
Do you see my problem with the 850? You don’t… how can you not… its running WINDOWS MOBILE(WM). Palm keeps telling the market and there followers that they are committed to there own OS and that they are working hard to release a new linux-based version of PalmOS, but if this is the case, why more WM phones?
I know, there are separate development teams at work, one working on the new OS and one on Palm-based hardware and another on WM-based hardware, but other than a miniturized Treo (aka the Centro, which don’t get me wrong if it was available for T-Mobile USA I’d already have one), but what have you done for Palm OS? Wasn’t one of the reasons given for discontinuing the Foleo that you didn’t want to be developing and maintaining 2 OS flavors? so what is the difference, okay so MS is developing WM, but don’t you have to support it on your phones?
So Palm, Congrats on moving in the right direction by adding WiFi and GPS (and a much better with the Centro). Also the move to mini-USB is also a good one. But please do something for the PalmOS world soon, otherwise, I see a nice new shiny BlackBerry in my furture, with the exception of a touchscreen the Curve has everything you’ve just added to the WM-Treo with the bonus that it is not WM.
Fink vs MacPorts
Well a few weeks ago I decided that my Fink installation had gotten crazy. There were tones of apps and libraries installed that I needed at one time but no more. I decided it was time to start fresh. Basically I’ve been using Fink since the Mac OSX 10.0 days. For the most part I’ve just simply upgraded over the older versions and continued right along. With Apple’s ability to migrate between machines, I’ve even migrated my Fink installation a few times. This all said, it was pretty nasty, so I decided it was time to clean house, also I’ve been programming in Python lately and realized that I had ended up with multiple versions of Python and add-on modules. So again another reason to flush and start clean.
So first step: ’sudo rm -rf /sw’, wises first step, maybe not, but in reality I didn’t care. Second step install Fink again… well I didn’t do that. A few years ago I gave DarwinPorts a try, liked it but many of the needed libraries and such just weren’t available and the few that weren’t in Fink but in Ports, I was willing to manually install. But sometime last year (maybe the year before) DarwinPorts became MacPorts and was moved to a host sponsored by Apple. Whether or not this means that Apple endorses or supports MacPorts over Fink is not mentioned anywhere [side note: the name Fink is German for Finch].
Anyways… I decided to give the latest MacPorts a try. Initially (and still am) I was impressed by the available list of ports and its simplicity of use. Fink is based on the Debian package system, while MacPorts is based on the BSD Ports system. I personally am a Debian fan and a Ubuntu desktop user, but Mac OSX is and since the NeXTStep days been based on BSD, so presuminingly, the BSD model should be a better match. Overall both Fink and MacPorts provide mirror functionality, so it should make no difference which route you choose.
So again back to my discussion…..
Well I chose MacPorts this time. Installation – no problem, usage – no problem (besides naming/systax the only main difference is that for MacPorts you need to implicitly call ’sudo’, with Fink, it is integrated), package availability – no problem. So where do the problems begin… well they don’t… well sort of… well they have nothing to do with MacPorts vs Fink… they have to do with the fact that it is nearly impossible to remember every package you need, want or use. Now I’m remembering why atleast since 10.2 I’ve always simply upgraded my Fink and not done a full re-install.
Now some packages are easy to remember, like the latest GCC (4.4 with gfortran), and Latex (or Tetex). And since I’m working in the meteorological/science community, NetCDF, HDF5, GDAL, GRADS, qGis, GnuPlot and so forth. But then I added Python to my portfolio, I needed to make sure that I had the right libraries there too. … This is where I think I went wrong….
When I first started learing Python, I simply found online the packages I needed/wanted, then checked Fink and installed them. Since then (and since I’ve been using Trac on a project management site for work) I’ve learned about ‘easy_install’ for Python. So this time I decided to install most of my Python modules/packages the Python way with easy_install. Well maybe I did something wrong or what not, but I don’t think I did something right… so who know… but when I tried to run some of my Python code, it didn’t work. So well then I tried the MacPort equivalent to the Fink route, and yes I found that they too had many of the packages available I was looking for, so maybe the easy_install way doesn’t work for a Mac, don’t know haven’t checked… but the bottom line is that in the process of trying to clean things out… I’ve made things worse so today… I’ve remove all the MacPorts stuff (sudo rm -rf /opt).
And now…. lets try this again……..
Oh yeah… if you didn’t guess about the results of MacPorts vs Fink… I personally still think that it doesn’t matter…. so you choose.
Nick’s Random Fragmentations – moving to tumblr (at least my feed)
For those of you who are subscribing to my feed via my Feedburner publishing, then you may have noticed additional posts showing up from my various social web cloud. I’ve started using Tumblr to aggregate my feeds together into a single sharable feed. Blog post are still done through Blogger, Twits through Twitter, News Diggs through Digg, and a few others are also included. The main change is that now my feed includes all of them together, so no more checking my various streams… only one now. This said, if you are interested in consilidating your own feeds, check out Tumblr. If you are looking for an easy way to consolidate your friends various feeds check out FriendFeed or SocialThing. I personally use both but lately I’ve been leaning towards only using SocialThing… anyways, that is another post altogether.
Nick’s Random Fragmentations – moving to tumblr (at least my feed)






Wind Data gripes
Well first let me start off by saying, any and all wind data is helpful….
I’ve been working with HRD going on 12 years now, and for most of that time (like the last 11) one of my main tasks has been data collections. This include collecting information about particular stations as well as the data itself. Every year before the start of hurricane season (June 1st for the Atlantic) I go through all my reference tables and check and add any new stations that have come online since the previous year (usually I do this a couple times a year, but always right before the season starts). So this year like all the past years, there are a number of new stations. First yay!, second…. ugh… Why I say ‘ugh’ well 1 it means that I now have to research new stations and collect information for them, and 2 it reminds me of how many stations, well how do I put it… are installed by … (this is a family safe blog), but I have to hope that the installer has no formal meteorological training.
But again I must say, all data is greatly appreciated. But when you install an anemometer on the roof of a building or house or near a tree, wall or anything that can change the flow of air to the anemometer… well lets just say that you basically make your data almost useless. When anemometers are installed they should be in clean air, that means a safe distance from any upwind obstacles. And no the roof is not a good place, unless you are going to install a tower tall enough to avoid the affects the roof actually cause, especially roof with a good steep angle. Depending on the location, winds can have increased values or in many cases where they are partially blocked, very low poor values. Also if you are wonder what a good height is… where the National Hurricane Center defines a surface wind at 10 meters, so if you can get you anemometer up 10 meters even better.
Now before all you amateur meteorologist start sending me hate mail… well let me state that the only reason I’ve writing this post is because these sites that I’m complaining about are installed by public sector groups, not private citizens. In most cases, I have no access to private data collected by home owners and amateur meteorologist, I only have access to data on the international feeds. So now do you see why I’m so frustrated with the installations….
All I ask is that you think before you install. And yes there are standards… take a look at http://www.ofcm.gov/siting/text/a-cover.htm if you are serious about this kind of thing.
But again, for all you out there providing wind data. THANKS! and yes I do mean it… any data is better than no data.
May 28, 2008 Posted by nickc321 | commentary, rants, work | | No Comments Yet