Want updates? Opt out any time

Connect
News
Blogroll
Tuesday
Aug142012

## Great geophysicists #4: Fermat

This Friday is Pierre de Fermat's 411th birthday. The great mathematician was born on 17 August 1601 in Beaumont-de-Lomagne, France, and died on 12 January 1665 in Castres, at the age of 63. While not a geophysicist sensu stricto, Fermat made a vast number of important discoveries that we use every day, including the principle of least time, and the foundations of probability theory.

Fermat built on Heron of Alexandria's idea that light takes the shortest path, proposing instead that light takes the path of least time. These ideas might seem equivalent, but think about anisotropic and inhomogenous media. Fermat continued by deriving Snell's law. Let's see how that works.

We start by computing the time taken along a path:

$\fn_cm t = \frac{\sqrt{a^2 + x^2}}{v_1} + \frac{\sqrt{b^2 + y^2}}{v_2}$

Then we differentiate with respect to space. This effectively gives us the slope of the graph of time vs distance.

$\fn_cm \frac{\mathrm{d}t}{\mathrm{d}x} = \frac{x}{v_1 \sqrt{a^2 + x^2}} - \frac{y}{v_2 \sqrt{b^2 + y^2}}$

We want to minimize the time taken, which happens at the minimum on the time vs distance graph. At the minimum, the derivative is zero. The result is instantly recognizable as Snell's law:

$\fn_cm 0 = \frac{\sin\theta_1}{v_1} - \frac{\sin\theta_2}{v_2}$

### Maupertuis's generalization

The principle is a core component of the principle of least action in classical mechanics, first proposed by Pierre Louis Maupertuis (1698–1759), another Frenchman. Indeed, it was Fermat's handling of Snell's law that Maupertuis objected to: he didn't like Fermat giving preference to least time over least distance.

Maupertuis's generalization of Fermat's principle was an important step. By the application of the calculus of variations, one can derive the equations of motion for any system. These are the equations at the heart of Newton's laws and Hooke's law, which underlie all of the physics of the seismic experiment. So, you know, quite useful.

### Probably very clever

It's so hard to appreciate fundamental discoveries in hindsight. Together with Blaise Pascal, he solved basic problems in practical gambling that seem quite straightforward today. For example, Antoine Gombaud, the Chevalier de Méré, asked Pascal: why is it a good idea to bet on getting a 1 in four dice rolls, but not on a double-1 in twenty-four? But at the time, when no-one had thought about analysing problems in terms of permutations and combinations before, the solutions were revolutionary. And profitable.

For setting Snell's law on a firm theoretical footing, and introducing probability into the world, we say Pierre de Fermat (pictured here) is indeed a father of geophysics.

Friday
Aug102012

## Lower case j

This morning I was looking over the schedule for the SEG IQ Earth Forum and a 35 minute block of time caught my eye. Did they not have enough talks to fill the morning? Perhaps. So instead a discussion: Do we need an Interpretation Journal?

What a cool idea! The book versus the machine. Deliberate and community-supported penmanship for scientists to connect with their work. A hand-crafted symbol of romantic scripture in the midst of the sound and fury of a working realm infested with white noise and draining digital abstractions. Old school fights back against tech. Getting back in touch with the analog world, chronicling observations, geologic doodles, jotting down questions and nonsense precisely at the teachable moment.

The da Vinci of seismic interpretation?

I wondered how many other interpreters might be longing for the same thing. Surely if it is to take up a slot in the conference agenda, there must be some ample demand from the geophysical workforce. I want to be a part of it. I start early. I built a wiki page, a series of notes to corral group action and discussion, somewhat naïvely anticipating roaring praise for my inititiative. Most folks have notebooks with shopping lists, and phone messages. But a dedicated, deliberate interpretation journal is refreshing. Just me, my thoughts, and my project. Me getting back in touch with my cursive.

Just now, I realize, while instant-messaging with Matt on Skype, that it is not a Diary the conference organizers are after, it's a Journal. Capital J. As in publication entity. A Journal for Interpreters. Huh. Well, I guess that'd be good too.

The image of Leonardo da Vinci's journal was modified from an original photograph by user Twid on Flickr. Click the image to view the original.

Wednesday
Aug082012

## When to use vectors not rasters

In yesterday's post, I looked at advantages and disadvantages of various image formats. Some chat ensued in the comments and on Twitter about making drawings and figures and such. I realized I hadn't been very clear: when I say 'image', I really mean 'raster' or 'bitmap'. That is, a discretized (pixel-based) grid of data.

### What are vector graphics?

Click to enlarge — see a simulation of the difference between vector and raster art.What I was not writing about was drawings and graphics combining text, lines, and images. Such files usually contain vector graphics. Vector graphics do not contain descriptions of pixels, but instead they contain descriptions and positions of text, paths, and polygons. Example file formats are:

• SVGScalable Vector Graphics, an open format and web standard
• AI — a proprietary format used by Adobe Illustrator
• CDRCorelDRAW's proprietary format
• PPT — pictures in Microsoft PowerPoint are vector format
• SHP — shapefiles are a (mostly) generic vector format for GIS

One of the most important properties of vector graphics is that you can rescale it without worrying about changing the resolution — as in the example (right).

### What are composite formats?

Vector and raster graphics can be combined in all sorts of ways, and vector files can contain raster images. They can therefore be used for very large displays like posters. But vector files are subject to interpretation by different software, may be proprietary, and have complex features like guides and layers that you may not want to expose to someone else. So when you publish or share your work it's often a good idea to export to either a high-res PNG, or a composite page description format:

• PDFPortable Document Format, the closest thing to an open, ubiquitous format; stable and predictable.
• EPSEncapsulated PostScript; the precursor to PDF, it's rarely called for today, unless PDF is giving you problems.
• PSPostScript is a programming and page description language underlying EPS and PDF; avoid it.
• CGMComputer Graphics Metafiles are best left alone. If you are stuck with them, complain loudly.

### What software do I need?

Any time you want to add text, or annotation, or anything else to a raster, or you wish to create a drawing from scratch, vector formats are the way to go. There are several tools for creating such graphics:

Judging by figures I see submitted to journals, some people use Microsoft PowerPoint for creating vector graphics. For a simple figure, this may be fine, but for anything complex — curved or wavy lines, complicated filled objects, image effects, pattern fills — it is hard work. And the drawing tools listed above have some great advantages over PowerPoint — layers, tracing, guides, proper typography, and a hundred other things.

Plus, and perhaps I'm just being a snob here, figures created in PowerPoint make it look like you just don't care. Do yourself a favour: take half a day to teach yourself to use Inkscape, and make beautiful figures for the rest of your career.

Tuesday
Aug072012

## How to choose an image format

Choosing a file format for scientific images can be tricky. It seems simple enough on the outside, but the details turn out to be full of nuance and gotchas. Plenty of papers and presentations are spoiled by low quality images. Don't let yours be one! Get to know your image editor (I recommend GIMP), and your formats.

### What determines quality?

The factors determining the quality of an image are:

• The number of pixels in the image (aim for 1 million)
• The size of the image (large images need more pixels)
• If the image is compressed, e.g. a JPG, the fidelity of the compression (use 90% or more)
• If the image is indexed, e.g. a GIF, the number of colours available (the bit-depth)

Beware: what really matters is the lowest-quality version of the image file over its entire history. In other words, it doesn't matter if you have a 1200 × 800 TIF today, if this same file was previously saved as a 600 × 400 GIF with 16 colours. You will never get the lost pixels or bit-depth back, though you can try to mitigate the quality loss with filters and careful editing. This seems obvious, but I have seen it catch people out.

### JPG is only for photographs

Click on the image to see some artifacts.The problem with JPG is that the lossy compression can bite you, even if you're careful. What is lossy compression? The JPEG algorithm makes files much smaller by throwing some of the data away. It 'decides' which data to discard based on the smoothness of the image in the wavenumber domain, in which the algorithm looks for a property called sparseness. Once discarded, the data cannot be recovered. In discontinuous data — images with lots of variance or hard edges — you might see artifacts (e.g. see How to cheat at spot the difference). Bottom line: only use JPG for photographs with lots of pixels.

### Formats in a nutshell

Rather than list advantages and disadvantages exhaustively, I've tried to summarize everything you need to know in the table below. There are lots of other formats, but you can do almost anything with the ones I've listed... except BMP, which you should just avoid completely. A couple of footnotes: PGM is strictly for geeks only; GIF is alone in supporting animation (animations are easy to make in GIMP).

All this advice could have been much shorter: use PNG for everything. Unless file size is your main concern, or you need special features like animation or georeferencing, you really can't go wrong.

There's a version of this post on SubSurfWiki. Feel free to edit it!

Friday
Aug032012

## News of the month

Our semi-regular news round-up from the greenbelt between geoscience and technology.

### OpendTect 4.4

Our favourite volume interpretation tool, OpendTect, moved to version 4.4 in June. It seems to have skipped 4.3 completely, which never made it into a stable release. With the new version come 3 new plug-ins: Seismic Net Pay, Seismic Feature Enhancement, and Computer Log Analysis Software (right)—we're looking forward to playing with that.

### The cutting edge of interpretation

A new SEG event aimed especially at quantitative interpreters is coming later this month — the SEG IQ Earth Forum. Have a look at the technical program. Evan will be there, and is looking forward to some great discussion, and finding out more about Statoil's open Gullfaks dataset. On the last day, he will be talking about Agile's workflow for interpreting seismic in geothermal fields... stay tuned.

### Geoscience freeware

We read in OilIT that US consultancy Ryder Scott has updated its Reservoir Solutions tools for Excel. These include Volumetrics, QuickLook Economics, Gas Material Balance, and LogWizard. If you try them out, do let us know what you think of them!