SQLite to CSV export

Yes, I could have written yet another little Python script to do this, but it turns out there’s a really easy way to export a SQLite database table to a CSV file from the command-line interface.

% sqlite3 databasefile.sqlite
sqlite> .headers on
sqlite> .mode csv
sqlite> .output outputfile.csv
sqlite> select * from table_name;
sqlite> .quit

And that’s it. Couldn’t be easier really.

Hat tip to http://www.sqlitetutorial.net/sqlite-export-csv/

Advertisements

Lunar pilots

The first-quarter moon hangs between Sky Pilot and Copilot at the end of a balmy autumn day.

Well who can resist such a sight? The moon floating in the sky between two of the most photogenic mountain peaks in the area. The biggest challenge was holding the camera steady, since I was down at 1/30 sec thanks to the polarizer (which helped enhance the colours). But the railing on the patio up at the Sea to Sky gondola makes a pretty good makeshift tripod.

Alas we were too late to have a post-hike celebratory beer, so we had to be content with taking the gondola back down and finding beer elsewhere.

Fancy a brew?

Backcountry huts attract a lot of attention, so much so that we rarely intend to stay in them. However, on this particular weekend in July 2015, we found ourselves the only people at the Brew Hut, run by the UBC Varsity Outdoor Club and opted to spend the night there. Just us and the mice.

Or so we thought. Not long before sunset, a couple of guys staggered into the hut proclaiming thanks at eventually finding it. Our quiet bubble well and truly burst, we ended up having a really pleasant evening chatting with them and helping them demolish the 13 cans of beer they’d brought along. Remarkably, they went to bed at the same time as us, and only stirred when we started moving in the morning. Their reason for visiting? They just liked the name and its association with beer…

1. Instagram-ready view of Garibaldi from Brew Hut.

I really liked this shot, especially at the time it was taken when Instagram was home to square photos. Indeed, one of the reasons I joined Instagram was to explore the possibilities with square crops. Now that it supports other crops (though no more than 5×4 in portrait orientation) I feel some of that creativity has been lost as I no longer feel I have to think in terms of that constraint.

2. Brew Hut with Garibaldi, a very nice place to spend a weekend.

Brew Hut in all its glory – the location is stunning with great views in every direction. The tricky part is the access road which requires at least modest clearance and potentially 4-wheel drive for the final section (though there is a lower trailhead for vehicles that can’t make it up the last hill). I was happy to make it to the upper parking lot on a stifling hot day.

I remember the drive home after that trip, coming back through Squamish and being unable to see the Chief from the highway due to the thick smoke from forest fires in the neighbouring Elaho valley. We could see the red glow from those fires – very eery.

Petrified

A different kind of forest for forest Friday – the fallen logs of the Petrified Forest National Park. These stone logs messed with my perception: looks like wood, feels like rock. I’d love to go back and spend more time exploring the park when it wasn’t so chilly (taken in Dec 2013)!

The petrified forest was a place I’d wanted to visit ever since I was about 6 or 7 years old and I first learned about fossils and petrified trees. That dream came true just under four years ago and I have to say the experience was even better than I expected. The location is unreal: high, open desert which, at an altitude of 1700 m (5600 ft), is far from warm in December (there was snow in shaded areas). The logs – mostly fragments as the rock is extremely brittle – lie all around having emerged from sediments now washed away. In places, the end of a stone log pokes out of the landscape.

The biggest surprise for me was the disconnect between my senses of sight and touch. To look at some of the pieces, my brain said “wood”, yet the moment my fingers touched the cold stone, I only saw rock. I went back and forth several times, and it was like one of those perspective puzzles where you see a view that changes in time depending on how you concentrate on it.

I loved it. And being such a clear sunny day I was able to use the polarizer to maximum effect to enhance the colour and contrast. The bigger challenge was finding a composition that captured both the wonderful old trees and the sense of openness, almost desolation. I’ve just looked back through the full album on Flickr and I think we did OK.

From the beginning

Today is a Throwback-Thursday and, seeing as I didn’t start blogging my Instagram posts until I’d posted nearly 100, I thought it’d a fun way to fill in the gaps with some Throwbacks and Flashbacks. I might not post one every week, and looking back I will group together photos from a single trip or with a theme (as long as they were posted close together) so I don’t have to write another 90+ individual blog posts!

Be warned: all of my early posts originated on my phone. Indeed that was the whole point of getting an Instagram account in the first place, to give me a place to put casual phone pics, often processed in ways that I wouldn’t dream of with photos from our real cameras. Some (like the two below) work quite well as black-and-white, while others made use of either Instagram filters or the processing options in Google Photos that were available at the time as attempts to mask or at least draw attention away from the poor image quality. Was I successful? Sometimes…

I took these on one of the extreme low tides we get in the summer where we were able to walk out on Spanish Banks almost to the steep drop-off into the deeper waters of Burrard Inlet. Bright sunny days, with their high mid-day contrast, can often work well for black and white photos. And that’s exactly what I did for these two.

1. Low tide in Vancouver.

Low tide in Vancouver #lowtide #beach #spanishbanks #vancouver

A post shared by Andy Gibb (@_andy_gibb_) on

The first is unusual for me in that it’s almost street photography – I don’t normally put people in my photos, especially strangers. But I liked the fact the three people in the group were all looking the same direction – out to sea – as well as the curve of the breaking waves leading towards the high-rises of downtown Vancouver. As far as street-style photos go, it’s one of my favourites. If I want to get picky, I should be held the camera higher to avoid merging the heads and the background ship, but then, try seeing that detail on a phone screen on a sunny day…

2. Go no further.

Go no further #lowtide #blackandwhite #beach #spanishbanks #vancouver

A post shared by Andy Gibb (@_andy_gibb_) on

The second was simply a record of where we were, looking over to the North Shore, with the sentry-like structure guarding the transition to deep water as if to say that we should indeed go no further. I like the simplicity and the fluffy clouds over the mountains. That’s it really.

Behind you!

Behind you! This awesome view of the Wedge group is waiting behind your back as you admire Iceberg Lake.

Hikes to lakes rarely offer 360-degree views, but sometimes you get a good 180. Iceberg Lake is definitely one of those lakes. As you’re admiring the sheer headwall and the glacial lake at its base, all it takes to get the view above is to turn around. The meadows were a beautiful burnished gold and the distant peaks dusted with the season’s first fall of snow. I read a recent blog article from someone who climbed up Mt Cook on this same day: he’s in one of the pixels somewhere 🙂

There’s something off about this photo though: Wedge Mountain (right) is actually higher than Mt Weart (left) which appears as the highest point. I guess I didn’t hold the camera as level as I should have, always tricky when there’s no obvious horizon. Except – wait – there are actually two; there’s the treeline and the snowline. Going by the trees next to the meadow, I thought that this was about right but I can clearly see from the either that I’m still a little bit off, and that a further correction would probably restore the natural order to the world. Mind you, those trees are starting to look like they’re leaning to my eyes – the final result will be some sort of compromise between the two, a blend of reality and perspective.

Iceberg Lake

Gorgeous Iceberg Lake at last, surprisingly difficult to photograph with a standard wide-angle lens. But the view in the opposite direction makes up for that. A big thank-you to ACC-Whistler for a wonderful trail.

As mentioned in my previous post, we hiked up to Iceberg Lake near Whistler last weekend. In its own way the lake is like a miniature version of Wedgemount Lake (or at least the meltwater tarn at the toe of the Wedge glacier), the peaks surrounding which can be seen in the opposite direction. There’s a small permanent snowfield or even remnant glacier that calves into a lake coloured teal-green by rock flour.

The trail is superb, passing through old-growth forest for much of the ascent, and hugging Nineteen Mile Creek (see link above) with its picturesque waterfalls for the upper section before exiting the trees into beautiful subalpine meadows for an awe-inspiring view of the headwall of Rainbow Mountain. The view of the Rainbow glacier is fore-shortened as you get closer to Iceberg Lake (as at upper Joffre Lake), so the best view is from the meadows.

Photographic notes. This place needs an ultra-wide angle lens, at least for views looking towards Rainbow Mountain; the standard 28-mm equivalent simply does not go wide enough to capture the scale. Here, I was glad to be able to make use of a couple of hikers for scale, otherwise there’s simply no way to make it look impressive. Also, since the headwall faces more-or-less due east, morning light is essential. This is less of an issue in the summer when the sun is higher in the sky, though the shadows might be even darker than today (I had to play with the processing to bring up the deep shadows in the original version of this image).

Still, despite photographic challenges, it is definitely a beautiful spot to visit, and deservedly popular. Plus there are two more hikes in this area for next year’s list…