News
Tuesday
Oct232012

Hooray for Fourier!

The theory of truth is a series of truisms - J.L Austin

The mathematical notion that any periodic function, no matter how jagged or irregular, can be represented as a sum of sines — called a Fourier series — is one of the most extraordinarily useful ideas ever. Ever! It is responsible for the theory of transmitting and recovering information, and yes, is ubiquitious in geophysics. Strikingly, any signal can be decomposed into an ensemble of sine waves. They are two different representations of the same object, two equal representations of the same information. Fourier analysis is this act of sending waves through a mathematical prism, breaking up a function into the frequencies that compose it.

To build an arbitrary signal, the trick is to mulitply each of the sines by a coefficient (to change thier amplitude) and to shift them so that they either add together or cancel (changing the phase). From the respective coefficients and phases of the composite sinusoids, one can reconstruct the original curve: no information is lost in translating from one state to the other. 

So the wiggle trace we plot of the seismic waveform has bits of information partitioned across each of its individual sinusoids. The more frequencies it has, the more information carrying capacity it has. Think of it as being able to paint with a full color palette. The degree of richess or range is known as bandwidth. In making this example, I was surprised how few sine waves (only ten) it took to make a signal that actually looks like a bonafide seismic trace. 

In 52 Things You Should Know About Geophysics, Mostafa Nagizadeh wrote an essay on the magic of Fourier; it's applications for geophysics data analysis. And he should know. In tomorrow's post, I will elaborate on the practical and economical issues we encounter making discrete measurements of continuous (analog) phenomena.

Thursday
Oct182012

The blind geoscientist

Last time I wrote about using randomized, blind, controlled tests in geoscience. Today, I want to look a bit closer at what such a test or experiment might look like. But before we do anything else, it's worth taking 20 minutes, or at least 4, to watch Ben Goldacre's talk on the subject at Strata in London recently:

How would blind testing work?

It doesn't have to be complicated, or much different from what you already do. Here’s how it could work for the biostrat study I mentioned last time:

  1. Collect the samples as normal. There is plenty of nuance here too: do you sample regularly, or do you target ‘interesting’ zones? Only regular sampling is free from bias, but it’s expensive.
  2. Label the samples with unique identifiers, perhaps well name and depth.
  3. Give the samples to a disinterested, competent person. They repackage the samples and assign different identifiers randomly to the samples.
  4. Send the samples for analysis. Provide no other data. Ask for the most objective analysis possible, without guesswork about sample identification or origin. The samples should all be treated in the same way.
  5. When you get the results, analyse the data for quality issues. Perform any analysis that does not depend on depth or well location — for example, cluster analysis.
  6. If you want to be really thorough, the disinterested party to provide depths only, allowing you to sort by well and by depth but without knowing which wells are which. Perform any analysis that doesn’t depend on spatial location.
  7. Finally, ask for the key that reveals well names. Hopefully, any problems with the data have already revealed themselves. At this point, if something doesn’t fit your expectations, maybe your expectations need adjusting!

Where else could we apply these ideas?

  1. Random selection of some locations in a drilling program, perhaps in contraindicated locations
  2. Blinded, randomized inspection of gathers, for example with different processing parameters
  3. Random selection of wells as blind control for a seismic inversion or attribute analysis
  4. Random selection of realizations from geomodel simulation, for example for flow simulation
  5. Blinded inspection of the results of a 'turkey shoot' or vendor competition (e.g. Hayles et al, 2011)

It strikes me that we often see some of this — one or two wells held back for blind testing, or one well in a program that targets a non-optimal location. But I bet they are rarely selected randomly (more like grudgingly), and blind samples are often peeked at ('just to be sure'). It's easy to argue that "this is a business, not a science experiment", but that's fallacious. It's because it's a business that we must get the science right. Scientific rigour serves the business.

I'm sure there are dozens of other ways to push in this direction. Think about the science you're doing right now. How could you make it a little less prone to bias? How can you make it a shade less likely that you'll pull the wool over your own eyes?

Tuesday
Oct162012

Experimental good practice

Like hitting piñatas, scientific experiments need blindfolds. Image: Juergen. CC-BY.I once sent some samples to a biostratigrapher, who immediately asked for the logs to go with the well. 'Fair enough,' I thought, 'he wants to see where the samples are from'. Later, when we went over the results, I asked about a particular organism. I was surprised it was completely absent from one of the samples. He said, 'oh, it’s in there, it’s just not important in that facies, so I don’t count it.' I was stunned. The data had been interpreted before it had even been collected.

I made up my mind to do a blind test next time, but moved to another project before I got the chance. I haven’t ordered lab analyses since, so haven't put my plan into action. To find out if others already do it, I asked my Twitter friends:

Randomized, blinded, controlled testing should be standard practice in geoscience. I mean, if you can randomize trials of government policy, then rocks should be no problem. If there are multiple experimenters involved, like me and the biostrat guy in the story above, perhaps there’s an argument for double-blinding too.

Designing a good experiment

What should we be doing to make geoscience experiments, and the reported results, less prone to bias and error? I'm no expert on lab procedure, but for what it's worth, here are my seven Rs:

  • Randomized blinding or double-blinding. Look for opportunities to fight confirmation bias. There’s some anecdotal evidence that geochronologists do this, at least informally — can you do it too, or can you do more?
  • Regular instrument calibration, per manufacturer instructions. You should be doing this more often than you think you need to do it.
  • Repeatability tests. Does your method give you the same answer today as yesterday? Does an almost identical sample give you the same answer? Of course it does! Right? Right??
  • Report errors. Error estimates should be based on known problems with the method or the instrument, and on the outcomes of calibration and repeatability tests. What is the expected variance in your result?
  • Report all the data. Unless you know there was an operational problem that invalidated an experiment, report all your data. Don’t weed it, report it. 
  • Report precedents. How do your results compare to others’ work on the same stuff? Most academics do this well, but industrial scientists should report this rigorously too. If your results disagree, why is this? Can you prove it?
  • Release your data. Follow Hjalmar Gislason's advice — use CSV and earn at least 3 Berners-Lee stars. And state the license clearly, preferably a copyfree one. Open data is not altruistic — it's scientific.

Why go to all this trouble? Listen to Richard Feynman:

The first principle is that you must not fool yourself, and you are the easiest person to fool.

Thank you to @ToriHerridge@mammathus@volcan01010 and @ZeticaLtd for the stories about blinded experiments in geoscience. There are at least a few out there. Do you know of others? Have you tried blinding? We'd love to hear from you in the comments! 

Friday
Oct122012

M is for Migration

One of my favourite phrases in geophysics is the seismic experiment. I think we call it that to remind everyone, especially ourselves, that this is science: it's an experiment, it will yield results, and we must interpret those results. We are not observing anything, or remote sensing, or otherwise peering into the earth. When seismic processors talk about imaging, they mean image construction, not image capture

The classic cartoon of the seismic experiment shows flat geology. Rays go down, rays refract and reflect, rays come back up. Simple. If you know the acoustic properties of the medium—the speed of sound—and you know the locations of the source and receiver, then you know where a given reflection came from. Easy!

But... some geologists think that the rocks beneath the earth's surface are not flat. Some geologists think there are tilted beds and faults and big folds all over the place. And, more devastating still, we just don't know what the geometries are. All of this means trouble for the geophysicist, because now the reflection could have come from an infinite number of places. This makes choosing a finite number of well locations more of a challenge. 

What to do? This is a hard problem. Our solution is arm-wavingly called imaging. We wish to reconstruct an image of the subsurface, using only our data and our sharp intellects. And computers. Lots of those.

Imaging with geometry

Agile's good friend Brian Russell wrote one of my favourite papers (Russell, 1998) — an imaging tutorial. Please read it (grab some graph paper first). He walks us through a simple problem: imaging a single dipping reflector.

Remember that in the seismic experiment, all we know is the location of the shots and receivers, and the travel time of a sound wave from one to the other. We do not know the reflection points in the earth. If we assume dipping geology, we can use the NMO equation to compute the locus of all possible reflection points, because we know the travel time from shot to receiver. Solutions to the NMO equation — given source–receiver distance, travel time, and the speed of sound — thus give the ellipse of possible reflection points, shown here in blue:

Clearly, knowing all possible reflection points is interesting, but not very useful. We want to know which reflection point our recorded echo came from. It turns out we can do something quite easy, if we have plenty of data. Fortunately, we geophysicists always bring lots and lots of receivers along to the seismic experiment. Thousands usually. So we got data.

Now for the magic. Remember Huygens' principle? It says we can imagine a wavefront as a series of little secondary waves, the sum of which shows us what happens to the wavefront. We can apply this idea to the problem of the tilted bed. We have lots of little wavefronts — one for each receiver. Instead of trying to figure out the location of each reflection point, we just compute all possible reflection points, for all receivers, then add them all up. The wavefronts add constructively at the reflector, and we get the solution to the imaging problem. It's kind of a miracle. 

Try it yourself. Brian Russell's little exercise is (geeky) fun. It will take you about an hour. If you're not a geophysicist, and even if you are, I guarantee you will learn something about how the miracle of the seismic experiment. 

Reference
Russell, B (1998). A simple seismic imaging exercise. The Leading Edge 17 (7), 885–889. DOI: 10.1190/1.1438059

Tuesday
Oct092012

Your best work(space)

Doing your best work requires placing yourself in the right environment. For me, I need to be in an uncluttered space, free from major distractions, yet close enough to interactions to avoid prolonged isolation. I also believe in surrounding yourself with the energetic and inspired people, if you can afford such a luxury.

The model workspace

My wife an I are re-doing our office at home. Currently mulling over design ideas, but websites and catalogs only take me so far. I find they fall short of giving me the actual look and feel of a future space. To cope, I have built a model using SketchUp, catering to my geeky need for spatial visualization. It took me 35 minutes to build the framework using SketchUp: the walls, doors and closets and windows. Now, it's taking us much longer to design and build the workspace inside it. I was under the impression that, just as in geoscience, we need models for making detailed descisions. But perhaps, this model is complicating or delaying us getting started. Or maybe we are just being picky. Refined tastes.

This is a completely to-scale drafting of my new office. It is missing some furniture, but the main workspace is shown on the left wall; a large, expansive desk to house (up to) two monitors, two chairs, and two laptops. The wide window sill will be fitted with bench cushions for reading. Since we want a built-in look, it makes sense construct a digital model to see how the components line up with other features in the space. 

More than one place to work 

So much of what we do in geoscience is centered around effectively displaying information, so it helps to feel fresh and inspired by the environment beyond the desktop. Where we work affects how we work. Matt and I have that luxury of defining our professional spaces, and we are flexible and portable enough to work in a number of settings. I like this.

There is a second place to go to when I want to get out of the confines of my condo. I spend about 30 hours a month at a co-working space downtown. The change in scenery is invigorating. I can breathe the same air as like-minded entrepreneurs, freelancers, and sprouters of companies. I can plug into large monitors, duck into a private room for a conference call, hold a meeting, or collaborate with others. Part of what makes an office is the technology, the furniture, the lighting, which is important. The other part of a workspace is your relationship and interaction to other people and places; a sense of community.

What does your best work space look like? Are you working there now?