My new website is deployed here. I’m debating whether to switch completely over to the minimalistic blogging app I built for the website; I’m probably better served by continuing to write here, and continuing to add features to the blog over at my site, so I’ll probably end up staying here for a while.
A foray into web design
•June 20, 2009 • 1 CommentBefore I continue my series on scientific visualization with Python, I want to segue into another realm of computing: web design. I have nearly zero experience with web design and programming for the web, but when people hear that you like to “program,” that’s the first thing they ask about. Back in the day, I learned HTML and some some basic CSS, as well as a small amount of JavaScript, but I’ve never really deployed anything more than a GeoCities website.
Until now. I was asked to become the webmaster of the CCAMS website, a job which really just entails keeping the news up-to-date and making sure the thing doesn’t crash too heinously. But in the vein of Walt Disney, I feel compelled to “plus” it. The site looks a bit dated; it’s got bloated JavaScript menus and a less-than-beautiful design. I immediately thought that it could be rebuilt into something incredible, so I decided that I would finally learn web design and build a great, Web 2.0 site for the club. Problem is, I don’t have any idea how to do that.
Or I didn’t until a few days ago. A friend recommended I use Django to build the site, and after having spent a day reading over version 2.0 of the Django Book, I’m compelled to do so. I envision the new CCAMS website as a hub for our club/department’s activities. It should be able to dynamically serve forecasts and keep up-to-date news and goings of the club. It should support users so that members with certain responsibilities – such as the WeatherPhone or Forecast Competition – can log in and discretely upload their data for others to see. The site could evolve into a really useful utility.
But first I need to practice deploying a fully-functioning site. I decided to design myself a simple 6-page home website. Last night I went into GIMP and drew out a template for what the site should look like (see the bottom of the page). It’s really a simple thing:
- The title changes to reflect what page you’re on
- The navigation bar also does
- The main content is served in the white body wrapper
- The footer at the bottom will h.ave some sort of cute, random quotes
At least, at first. Each of the navigation pages will afford me a chance to practice a certain technique which will help me learn Django for the CCAMS site:
- Home – A simple, static page for starting out
- Resume – I’ll write a simple app which will store the data for me resume in a database. Then, I can dynamically serve that data when the user visits the “Resume” tab; I’ll have Django query the DB for all the information, style it in nice CSS, and present it in a few formats like HTML, PDF, PostScript, the likes.
- Research – Like Resume, but simpler. Rather than generate a new file to present for download, I’ll just display it directly on the screen.
- Music – I plan on writing an app for the CCAMS site that downloads information from NOAA/NWS, and this will be preparation for that. I’ll gather media and information for bands like Weggalo Star and the Cornell Symphony Orchestra and present it dynamically on this page
- Blog – Every web designer undergoes the rite of passage of building a blog application. I’ll take an existing one, hack it to my needs, then re-code it by hand from scratch to synthesize everything I’ve learned
- Contact – A simple form-driven contact page.
I’m pretty excited. I hope to spend the rest of today coding a static HTML/CSS homepage to get the website all layed out.

Visualizing Climate Data – A Better Approach
•June 15, 2009 • 1 CommentMy internship/research this summer involves a great deal of plotting data from giant netCDF files, generated from runs of NCAR’s CCSM3. Initially, I used legacy scripts written in IDL to create the necessary figures for my professor’s analysis. Those scripts had been collected over the years and while performing the job adequately, I was unhappy to find them poorly commented or documented. Thus, I persuaded my professor to let me explore alternative ways to accomplish our plotting needs. Continue reading ‘Visualizing Climate Data – A Better Approach’
Moire Patterns with PyCUDA
•May 28, 2009 • Leave a CommentBefore the semester ended, two of my good friends – Dave and Adrian – procrastinated a bit and developed a very cool Matlab program. The program generates Moire patterns by creating arrangements of concentring circles and having them decay across the screen into one another. It’s a very clever program, and I’ve decided to one-up them a little bit. I just finished prototyping my own version of the program, but there’s a catch – rather than use Matlab, I decided to tackle the problem with a different set of tools.
For starters, I’m addicted to Python. I think it’s the go-to language for a myriad of tasks as diverse as scirpting, software prototyping, and even applicaiton development. Although the climate models I study are coded mostly in Fortran, I’ve developed my own set of tools for processing their outpat data through Python – mostly through the help of RPy, NumPy, and SciPy (with the help of NCO for working with netCDF files, of course, although SciPy has a great I/O functionality for them). I decided to port Dave and Adrian’s code to Python.
However, there were issues. For starters, I wasn’t sure how to do 2D graphics with Python. I first tried TKinter but I couldn’t optimize the drawing very well. So, I settled with PyGame, which turned out to be very easy to use! Even with PyGame, though, the prototype program ran very sluggishly. So, I decided to up the ante and try something a bit esoteric – PyCUDA. PyCUDA is a convenient module for utilizing CUDA code within a Python script or program. For those of you who don’t know, CUDA is nVidia’s solution for bringing GPGPU to the masses – that is, general purpose programming on graphics processing units. In a nutshell, modern GPU’s are massively parallel constrcuts; they have hundreds of cores and have theoretical computing powerof over a teraflop! They are perfectly suited for SIMD situations.
The code for my prototype program follows after the break, and serves as a practice attempt at utilizing PyCUDA. Now, this isn’t real hardcore CUDA programming here – I’m using very convenient abstractions available in PyCUDA because my translation algorithm is so simple. As far as I can tell, there isn’t even any real speed increase in this situation (although I plan on modifying things a bit here in a second and doing some time trials). However, this is a neat project for seeing how PyCUDA can be effortlessly thrown into a script or small program. Again, this is only a prototype program to explore PyGame and PyCUDA; hopefully in the coming days I’ll flesh out the same simulation that Dave and Adrian ran, and then I’ll post both their Matlab code and my Python code for comparison and experimentation.
