Why is photographic metadata not treated properly?

I am looking forward to the day when there will be a good industry standard for adding metadata to digital photographs. Right now, it is a real mess, especially if you want to add new information to the photos that have already been downloaded to the computer.

More to the point: as I mentioned before, I have a small GPS receiver that I like to use whenever I am doing geological field work or I am just hiking (is there a difference? 🙂 ). In addition, I cannot do any of these things (hiking or fieldwork) without having a camera with me and taking pictures all the time. And, when I get home, I try to add the approximate geographic location to at least a number of photographs. This can be done using a variety of software packages that write the geographic coordinates into the EXIF part of the image file, the part that contains all kinds of information about the picture, such as date taken, camera manufacturer, camera model, exposure time, etc.

To combine the geographic information from the GPS with the photos, I am using GPSPhotoLinker, which is by far the best application among those that I have tried (and I have tried many). The nice thing about it is that you don’t have to process the photos one by one; the program has a batch mode that does everything in one go, using the time stamps in the photographs and the time data from the GPS unit. [There are other programs that claim to be able to do this, but GPSPhotoLinker actually works.]

In my case, the problems start when I try to edit the pictures with iPhoto. I am a big fan of iPhoto, I think it is a fantastic photo management program, but apparently it is unable to properly deal with the modified EXIF data. If I embed the geocoordinates before taking the pics into iPhoto, they show up correctly in iPhoto, but then they (at least some of them) get corrupted when I export the images from iPhoto (usually to put them on Smugmug). So the only option is to geotag the photos after they have been edited in and exported from iPhoto. Fair enough, I can live with that. The problem is that with the new version of iPhoto (iPhoto ’08), GPSPhotoLinker cannot write the coordinates to the exported images.

Scheisse mare, as my friend Radu would say (“mare” means big in Romanian, if you want to know). The only workaround I have found is to open the exported images in Adobe Photoshop, and save them again as JPEG files; after this operation – that probably rearranges the EXIF data – GPSPhotoLinker works fine.

Part of the issues are probably rooted in the fact that the EXIF part of the image can be located anywhere in the file. There is a good reason why the longest section of the the Wikipedia article on EXIF is entitled “Problems”.

I hope that things will improve soon. In the meantime, if you have a good workflow or workaround for doing automated geotagging on a Mac, please let me know.

A day in a delta’s life

I did some hiking recently in the Canadian Rockies. There is some stunning mountain scenery over there, with glaciers, lakes of out-of-this-world colors, icecap-covered humongous peaks, abundant wildlife, and so on. But some of the most exciting finds for a sedimentologist/geologist like myself must be the beautifully developed deltas that enter the glacial lakes. ‘Enter’ is actually an euphemism here, because the rivers are slowly, but surely filling with sediment these magnificent bodies of water, and it is only a matter of a few hundred or thousand years before most of the average size lakes become relatively uninteresting flatlands.

The delta at the updip end of the well-known (and somewhat overrated) Lake Louise is one of these lacustrine deltas. However, the one that really caught my attention is feeding into Peyto Lake. We got to the Peyto Lake overview area relatively early in the morning, when there was no wind, and the lake’s turquoise surface was perfectly smooth. Stunning view from high above, but most of my excitement evaporated (<– euphemism) when a busload of noisy (<– euphemism) tourists arrived and the viewing area suddenly felt like a Houston shopping mall on a weekend (<– exaggeration). So we started our descent toward the lake, on the trail that ultimately, if you are brave enough and rough enough (we were neither of these, but that is a different story), leads to Caldron Lake, above Peyto Glacier.

After only a couple of hundreds of meters, the population density dropped to zero, and my excitement not only went back to its previous levels, but exponentially grew as the lakehead delta started to take shape beyond the trees below us. You could see very well the active distributary channels sending slightly muddy or silty plumes into the lake. Because it was relatively cold, the glacier up in the valley was not melting too fast, and the discharge was small, so the plumes themselves seemed nice, but were barely noticeable.

This has changed during the day: as temperatures rose, the river that enters the lake became larger and larger, and by the time we got back to the lakehead delta in the afternoon, the plumes became much larger and much more evident.

The discharge of the river coming from the Peyto Glacier increases during the day and sends larger plumes into the lake in the afternoon


What is even more interesting is the fact that these plumes terminate relatively abruptly and it is very likely that they form density underflows in the lake. In other words, the sediment-rich water descends toward the lake bottom and flows down the slope as an underwater extension of the river, until it reaches the deepest parts of the lake. That is where it slows down and lets all of the sediment settle out, probably forming a graded layer, similar to the graded turbidites well known from marine sediments and rocks.

Such underflows often form in lakes when the sediment concentration in the river entering the lake is relatively high. In addition to the sediment concentration, the density excess can be enhanced by lower temperatures of the river. However, if the river is entering a sea or the ocean, it is much more difficult to form such underflows (that are often called hyperpycnal flows — just to make it a bit more confusing 🙂 ), because seawater has a lot of salt in it and therefore is denser than the river’s water. In this case, the sediment concentration of the river must be much higher to overcome the density of the seawater.

River, minibasin, delta, lake


As you walk up from the lakeshore toward the apex of the delta (which, by the way, has a classic triangular textbook delta shape), the size of the clasts on the delta’s surface slowly increases (statistically speaking). Further up, the valley gets narrow and then widens up again, giving place to a small minibasin. This minibasin probably was a lake some time ago, a lake that was completely filled.

The river is a Serious River


Where the delta meets the lake, you can easily get close to the distributary channels and their termination points. The coarser sediment tends to be deposited here from the flow, because the flow expands as it enters the lake and its velocity drops. Lower velocity means (1) lower shear stress at the bottom, and therefore fewer grains carried along the bottom, and (2) lower turbulence in the water column, which translates to less sediment carried in suspension. The enhanced deposition right in front of the channel mouth gives rise to a so-called distributary mouth bar, that tends to split the flow into two branches. With time, the mouth bar becomes an island, and the channel splits into two lower-order and simultaneously active distributary channels.

One of the distributary channels, with a nice mouth bar that splits the flow into two

It turns out, of course, that I am not the first to note how superb this little sedimentary system is — there are a number of studies that looked at the density underflows of Peyto Lake. This article tells us that Peyto Lake has a 7 m high sill in the middle, which splits the lake into two subbasins. Underflows (or turbidity currents) fill with sediment-rich water the updip subbasin to the spillpoint, and then the underflow spills over into the other subbasin. As far as I know, this is the only documented example of a truly ponded turbidity current. It has also been calculated that 61% of the sediment deposited in the lake comes from the underflows (most of the rest of the deposition is due to delta progradation).

Detailed view of the sediment-rich distributary mouths and their plumes


The sad news is that, with sedimentation rates similar to those observed today, Peyto Lake will be completely filled within less than 600 years. You should go and witness this jawdropping place before that happens.

* * *

PS: As Brian points out, the Peyto delta is remarkably similar to some of the experimental deltas generated at St. Anthony Falls Laboratory. See for example the image above — it is *not* a lake in the Canadian Rockies!

If you talk about power laws, read this paper:

A. Clauset, C. R. Shalizi and M. E. J. Newman, “Power-law distributions in empirical data”, arxiv:0706.1062. Let me just repeat three key points that Shalizi summarizes on his blog:

Lots of distributions give you straight-ish lines on a log-log plot. True, a Gaussian or a Poisson won’t, but lots of other things will. Don’t even begin to talk to me about log-log plots which you claim are “piecewise linear”.

And:

Abusing linear regression makes the baby Gauss cry. Fitting a line to your log-log plot by least squares is a bad idea. It generally doesn’t even give you a probability distribution, and even if your data do follow a power-law distribution, it gives you a bad estimate of the parameters. You cannot use the error estimates your regression software gives you, because those formulas incorporate assumptions which directly contradict the idea that you are seeing samples from a power law. And no, you cannot claim that because the line “explains” a lot of the variance that you must have a power law, because you can get a very high R^2 from other distributions (that test has no “power”). And this is without getting into the errors caused by trying to fit a line to binned histograms.

It’s true that fitting lines on log-log graphs is what Pareto did back in the day when he started this whole power-law business, but “the day” was the 1890s. There’s a time and a place for being old school; this isn’t it.

In addition,

Use a goodness-of-fit test to check goodness of fit. In particular, if you’re looking at the goodness of fit of a distribution, use a statistic meant for distributions, not one for regression curves. This means forgetting about R^2, the fraction of variance accounted for by the curve, and using the Kolmogorov-Smirnov statistic, the maximum discrepancy between the empirical distribution and the theoretical one. If you’ve got the right theoretical distribution, KS statistic will converge to zero as you get more data (that’s the Glivenko-Cantelli theorem). The one hitch in this case is that you can’t use the usual tables/formulas for significance levels, because you’re estimating the parameters of the power law from the data. This is why God, in Her wisdom and mercy, gave us the bootstrap.

If the chance of getting data which fits the estimated distribution as badly as your data fits your power law is, oh, one in a thousand or less, you had better have some other, very compelling reason to think that you’re looking at a power law.

The good news is that, despite having been submitted for publication too soon to cite Clauset et al., this paper is largely following the advice above and is trying to convey the message to sedimentary geologists (hopefully others will look at it as well) that straightish-looking lines on log-log plots with a large R squared are not enough evidence for power-law behavior.

Related previous posts:
The fractal nature of Einstein’s and Darwin’s letter writing
My talk on bed thicknesses and power laws
On cumulative probability curves
Power laws and log-log plots II.
Power laws and log-log plots I.

Richard Dawkins – author of the year

He is also on Time’s list of the 100 most influential people of the year. Although that list is kind of a joke, I am not sure what Sanjaya Malakar and quite a few other not-so-influential people are doing there. It is also a joke (and an extremely stupid joke, I must say) that Dawkins’ profile was written by Michael Behe, a creationist and intelligent-designer-ologist (whatever).

Anyway, congratulations to Professor Dawkins, who could be and should be voted, as far as I am concerned, the author of the century.

Geologic maps in Google Earth

One of the best ways to really start understanding the geology of an area is to look at the geologic map in Google Earth. Of course, unless you are interested in San Francisco or some other top notch place, you will not find the geologic map available in kmz or kml format (although you can get the whole US geological map here, and they are working on covering most of the globe).

Before that happens however, with a little patience it is possible to draw your own maps in Google Earth. You can use an image overlay as a starting point, and draw polygons on it after you managed to position it properly. As a quick test (well, actually it took me almost one day to do it), I created a small map that covers part of the southern East Carpathians in Romania, an area where I did some work for my thesis. It is based on the Geologic Map of Romania, 1:50000 scale, that is, one sheet from the series, edited by Murgeanu et al. and published in 1968. Old stuff, but good stuff. And a lot of work.

No vestige of a beginning, no prospect of an end

When James Hutton saw the unconformity at Siccar Point, where only slightly tilted 345 million years old Old Red Sandstone layers are sitting on top of near-vertical beds of ~425 million years old Silurian greywackes, he realized that such structures could not have formed in only a few thousand years. First, the sediment in the older formation was deposited in horizontal layers; it got buried, compacted and became hard rock; it was tilted to an almost vertical position and lifted above sea level; was eroded by subaerial erosion; and was buried again by much younger sediment that was itself later cemented and tilted by tectonic forces. Most of these processes can be relatively well observed and tracked, especially today, and they are extremely slow compared to most of the things we are dealing with in a human lifetime: both erosion and sedimentation happens at the rate of a few millimeters to centimeters a year, that is, slower than the nail grows. Tectonic movements are not much faster either. Hutton of course had no idea of the absolute age of the rocks, and had no precise measurements of erosion, sedimentation and uplift rates available, but he clearly came to the realization that geology is happening on a timescale a few orders of magnitude larger than that of the Bible and of known human history:

“Here are three distinct successive periods of existence, and each of these is, in our measurement of time, a thing of infinite duration. …The result, therefore, of this physical inquiry is, that we find no vestige of a beginning, no prospect of an end.”

Siccar Point is impressive and one of the most important sites in the history of geology, but the unconformity of all unconformities must be the one in Grand Canyon, appropriately called the Great Unconformity. This is how it looks like from Lipan Point, on the southern rim of the canyon:


And here is another shot with a broader perspective:


The tilted reddish strata in the lower part of the first photo are the Dox Formation; the darker rocks above this belong to the Cardenas Basalt. Both of these formations are of Mesoproterozoic age; the overlying horizontal ledge of rock is the Cambrian Tapeats Sandstone. The time gap between the Cambrian and the Proterozoic is 200 million years, about three times longer than the missing time at Siccar Point. Although the unconformity lower in the stratigraphy exposed at Grand Canyon, between the crystalline basement rocks and Mesoproterozoic sediments represents an even larger gap of 475 million years, the ‘great unconformity’ is visually much more impressive.

It is ridiculous that more than two hundred years after Hutton saw no ‘vestige of a beginning’, and initiated modern geology, there are people who seriously think that the Grand Canyon was carved by the biblical flood, or that sedimentation and erosion can take place at extremely high rates so that all geologic history would fit into six thousand years.

Such idiocies keep showing up over and over again, and I start to think with Hutton one more time that, unfortunately, there is no prospect of an end.

ps. Suggested readings:
Annals of the Former World by John McPhee; there is a highly readable account of Hutton’s discovery of unconformities in the first part of the book, “Basin and Range”.
Vestiges of James Hutton – a nice article about Hutton in American Scientist.

Windows on a Mac – with Parallels Desktop

I have been successfully using Windows XP with Boot Camp on the iMac for a while now. However, it is a pain when you have to reboot every time you want to use a Windows application. So I tried the obvious solution: Parallels Desktop for Mac.

And it works like a charm! Initially I could not figure out how to use the Boot Camp installation of Windows, so I actually installed Windows XP as a separate virtual machine, before I realized that it is quite simple to set up Boot Camp (and then deleted the other virtual machine). You have to use “Custom” installation and choose “Boot Camp” as the “virtual hard disk option”. The rest is easy (although I did have to kill and restart Parallels once during the first run). Windows asked for reactivation, and I said I wanted to reactivate it, and it worked fine. After all, I still have only one Windows installation on the computer.

So now I can run any Windows application on the Mac, right from the dock, using Parallels “coherence” mode, without even having to see the not-too-attractive Windows XP interface! It is a pretty amazing piece of software (I mean Parallels, not Windows XP). The end result of this setup is that I can run three different operating systems at the same time: Mac OS X, Windows XP, and Unix. And I could install Linux as well, if I wanted to. But I don’t need that one right now.