Filesystem Organization for Physicists Part 1: The Problem

Tags

, , , , ,

I’ve been warned that I sometimes veer too far in the direction of toolmaker away from the standard path followed by most scientists.  Try as I might, I cannot seem to avoid finding the process of doing science nearly as interesting as the goal of getting that science done. And so, my mind has been orbiting around a problem I suspect is endemic amongst all physicists, if not all scientists.  That problem, captured so nicely by this PhD comic is that of filesystem cruft.  Science, being at it’s core an experimental art, produces for every successful idea a whole panoply of failed experiments, mistakes, and generally messed-up crap.  Being paranoid creatures consumed by our own fears, along with the awareness that serendipity has been a cornerstone of great work, we are loathe to sweep these ill-fated children of the mind into the trash where they (mostly) belong. And so those of us who rely on computers for most of our day-to-day work end up with home directories filled to the brim with old scripts, corrupted data files, a dozen different versions of the same list of values, and other digital detritus.  And this situation makes for errors, confusion, thousand yard stare, anal leakage, and other evils too foul to discuss in polite company.  Just looking at my /home directory on my workstation at the University, I have more than 100,000 files sitting around, waiting for me to stare at them for a quarter hour trying to remember what they were for.

Continue reading »

Sunset Time Series

Tags

, , ,

Inspired by a reddit image post (which I cannot for the life of me find again), I decided to take a series of photos of the sunset from my parents’ house at Cedar-by-the-Sea, Vancouver Island. I many photos over the course of several hours using a digital camera fixed in position on a tripod.

I thought it would look good to blend the images one into the other, so I wrote a quick python script using the Python Image Library. The script blends consecutive images using linear interpolation. An artistic choice to make was how wide the blended regions should be. I tried everything from relatively thin blending regions:

To almost completely blended images:

In the end, however, I decided that what looked the best was actually to have no blending, but rather sharp boundaries between the images. This actually accentuates the effect I was going for, which was to show the changing light over time. Blending the images together actually lessens the effect, rather than enhancing it as had hoped. I plan to get the finished product printed and framed:

Here’s the code for the script I used (apologies for quick-and-dirtiness):

import sys
from PIL import Image

def imageblend(imdir, numimages = 5, blendwidth=0):
    if not blendwidth%2 == 0:
        raise Exception('blendwidth not even')

    im = Image.open(imdir+"im1.jpg")
    (width, height) = im.size

    for i in range(1, numimages):
        imnum = i+1
        centre = i*width/numimages - 1

        im_i = Image.open(imdir+'im%d.jpg'%(imnum))

        for x in range(blendwidth):
            col_ind = centre - (blendwidth/2) + x +1
            col_box = (col_ind, 0, col_ind+1, height-1)
            col_o = im.copy().crop(col_box)
            col_i = im_i.copy().crop(col_box)
            col = Image.blend(col_o, col_i, float(x)/blendwidth)
            im.paste(col, col_box)

        rest_box = (centre+blendwidth/2+1, 0, width-1, height-1)
        rest = im_i.copy().crop(rest_box)
        im.paste(rest, rest_box)

    im.save(imdir+"im_output.jpg")

def main():
    imdir = sys.argv[1]
    imageblend(imdir)

if __name__=='__main__':
    main()
 

I’m back

Tags

,

So, as you are all fully aware, I have been silent for the past few weeks.  Moving across the country can do that to you.  Now that I am no longer living out of boxes, expect a rapid catchup as I make up the posts I missed.

I’ll be keeping track at the bottom of my posts.

24

Change I Can Count On

Tags

, ,

On my first day of University five years ago, whilst shopping for dorm supplies, I bought this large beer-and-hockey themed piggy bank. Since then, I have deposited any coins smaller than a quarter (ie pennies, nickels and dimes). Today, just 2 weeks shy of moving to the US to start grad school, was time to finally cash in.

2L bottle provided for size-comparison.

Before counting, I wanted to see if I could reasonably estimate how much money there would be. I considered doing a “random sample” approach, counting the value of a small portion and scaling up to the full weight. However, unfortunately the only means at my disposal to weigh the samples was a bathroom scale inteded for weighing people in 0.1kg increments, so I didn’t think this would be accurate enough. Instead I weighed the entire piggy-bank (which came out to an impressive 4.2kg) and made some simple estimations of what the relative proportions of the coins would be as so:

Continue reading »

Milky Way Nights

Tags

, ,

I just got back from the University of Calgary’s fantastic Rothney Astrophysical Observatory.  Since there is a new moon in Calgary, we have had late night open houses yesterday, today, and one tomorrow from 10PM until 2AM.  Since I am exhausted, let me show you the awesome picture of the beautiful tendrils of cool dust in the Eagle Nebula we were able to capture using the 16″ Clark-Milone Telescope:

M16

Messier 16, the Eagle Nebula

Are Password Lockers Safe?

Tags

, ,

Well, I was hoping to make a more interesting post today, but seem to have lost the route through my cluttered mind to get to the synapses that store my github private key passphrase.  So, in an attempt to keep up the quantity if not the quality of my blogging, let me turn to this dire state of mnemonic affairs.  I can’t remember my passwords very well anymore.  I’ve always been leery of password storage utilities, but I think I need to rethink them.  I keep my machines with full disk encryption, and commit those passwords well into my memory, so I should be somewhat secure, right?  Talk me in to this, dear readers, or tell me the path of folly I am embarking upon.

Backup Your Google Life: gback

Tags

, , , , ,

You should all be watching Steins;Gate There was a rant that bounced up and down the tubes of the internet this week, talking about how one poor fellow migrated all of his important data into google services, only to have google pull the digital rug out from under him by deleting his account after it was algorithmically flagged.  This sucks, but one thing I have always been pestered about is the importance of regular backups.  Just because google is “the cloud” doesn’t mean your data is in a deadly limbo state of potential destruction if you don’t back it up.  The problem is, backing up a machine you control is damn easy, while backing up your cloudified data is not. Continue reading »

What The Hell Is Wrong With My Computer?

Tags

,

So, after my machine ran out of battery power while suspended, I booted it up to be greeted with the most strange bug I’ve ever seen on a linux machine:  All my text was screwed up.  In every application, including GDM.  It disappeared after I ran an apt-get upgrade and rebooted.  Has anyone else ever seen this bug?  I’m running Ubuntu 10.04, for the record.  Screenshot after the jump.

Continue reading »

Battlestations!

Tags

, ,

I’m a huge redditor, and one of my favourite little-known subreddits is r/battlestations.  It’s a nifty page where people show off their computer/desk areas and compare notes for cool monitor setups, epic workstations, and efficient office layouts.  Check it out if you want to kill some time and drool over other peoples offices. That was a short lame-o link post.  Sorry about that, I’ll be including vouchers for free nothing in the next post.

Morbid Statistics & The 27 Club

Tags

, , ,

Sorry about the late post, I was out far too late yesterday evening, and I missed the last train out of down town.  I had to bike for 2 hours to get home, ugh.   Anyways, as I’m sure many of you are aware, Amy Winehouse died today, at the age of 27.  There is a semi-common urban legend that for celebrities, and musicians in particular, 27 is something of a cursed age.  Jimmi Hendrix, Kurt Cobain, Janis Joplin, and others all died at age 27.  I was intrigued by this idea.  It’s entirely possible that 27 is just the median age in a distribution of ages for celebrities dying from drugs and alcohol, and that this has been picked up on in the pop culture.  So, I figured I would do some back-of-the envelope type research to see if this idea is plausible. Continue reading »

Follow

Get every new post delivered to your Inbox.