Have some bacn

You might have noticed a lot of emails from Canadian companies recently, asking you to confirm that you wish to receive emails from them. This is because a key part of the 2010 anti-spam law comes into effect tomorrow. We haven't sent you anything, becase we have always complied with the spirit of the law.

What is spam?

We all know what spam is, and the Canadian government's definition is plain:

commercial electronic messages [received] without the recipient's consent

And here's a definition of bacn (pronounced 'bacon') from author Jonathon Keats:

Spam by personal request

This seems to contradict the first definition, but the idea is that bacn is better than spam, but still not as good as a personal email. It's commercial email that you asked for. (Aside: according to that same author, bacn from geologists is quakn.)

Email from Agile*

Because we want you to have as much control over your inbox as possible, I have just switched our email subscription service from Feedburner to MailChimp. One of the reasons is MailChimp's excellent and rigorous anti-spam policy enforcement. Their emails make it very clear who an email is from, and how to unsubscribe from them. 

If you receive our blog updates via email, I hope you see them as a service and not a nuisance. If you're unsure about subscribing because you fear receiving promotions and so on — I promise that all you will ever get is our blog posts. It's just a convenient way to read the blog for some people. 

Just to be clear:

  • We will never add you to a mailing list that you didn't expressly subscribe to.
  • We will always give you an easy way to unsubcribe.
  • We will never share your email address or name with anyone else.
  • We will only send you emails that have an obvious Unsubscribe option.

Other ways to read

Here are some other options for subscribing to our RSS feed, which you will find at /journal/rss.xml 

We want you to be able to easily find, read, interact with, and share our content. If there is some other way we can serve you, please let us know

The can of spam image is by Flickr's Clyde Robinson and licensed CC-BY.

Patents are slowing us down

I visited a geoscience consulting company in Houston recently. Various patent awards were proudly commemorated on the walls on little plaques. It's understandable: patents are difficult and expensive to get, and can be valuable to own. But recently I've started to think that patents are one of the big reasons why innovation in our industry happens at a snail's pace, in the words of Paul de Groot in our little book about geophysics. 

Have you ever read a patent? Go and have a read of US Patent 8670288, by Børre Bjerkholt of Schlumberger. I'll wait here.

What are they for?

It is more or less totally unreadable. And Google's rendering, even the garbled math, is much nicer than the USPTO's horror show. Either way, I think it's safe to assume that almost no-one will ever read it. Apart from anything else, it's written in lawyerspeak, and who wants to read that stuff?

Clearly patents aren't there to inform. So why are they there?

  • To defend against claims of infringement by others? This seems to be one of the main reasons technology companies are doing it.
  • To intimidate others into not trying to innovate or commercialize an innovation? With the possible unintended consequence of forcing competitors to avoid trouble by being more inventive.
  • To say to Wall Street (or whoever), "we mean business"? Patents are valuable: the median per-patent price paid in corporate acquisitions in 2012 was $221k.
  • To formalize the relationship between the inventor (a human, given that only humans have the requisite inventive genius) and the intellectual property owner (usually a corporation, given that it costs about $40k in lawyer's fees to apply for a patent successfully)?
  • Because all the cool kids are doing it? Take a look at that table. You don't want to get left behind do you?

I'm pretty sure most patents in our industry are a waste of money, and an unecessary impediment to innovation in our industry. If this is true then, as you see from the trend in the data, we have something to worry about.

A dangerous euphemism

That phrase, intellectual property, what exactly does that mean? I like what Cory Doctorow — one of Canada's greatest intellects — had to say about intellectual property in 2008:

the phrase "intellectual property" is, at root, a dangerous euphemism that leads us to all sorts of faulty reasoning about knowledge.

He goes on to discuss that intellectual property is another way of saying 'ideas and knowledge', but can those things really be 'property'? They certainly aren't like things that definitely are property: if I steal your Vibroseis truck, you can't use it any more. If I take your knowledge, you still have it... and so do I. If it was useful knowlege, then now it's twice as useful.

This goes some way to explaining why 2 weeks ago, the electric car manufacturer Telsa relinquished its right to sue patent infringers. The irrepressible Elon Musk explained::

Yesterday [11 June], there was a wall of Tesla patents in the lobby of our Palo Alto headquarters. That is no longer the case. They have been removed, in the spirit of the open source movement, for the advancement of electric vehicle technology.

This is bold, but smart — Tesla knows that its best chance of dominating a large electric vehicle industry depends on there being a large electric vehicle industry. And they've just made that about 10 times more likely.

What will we choose?

I think one of the greatest questions facing our industry, and our profession, is: How can we give ourselves the best chance of maintaining the ability to find and extract petroleum in a smart, safe, ethical way, for as long as humanity needs it? By seeking to stop others from applying a slightly new velocity model building algorithm? By locking up over 2000 other possibly game-changing ideas a year? Will society thank us for that?

Cross sections into seismic sections

We've added to the core functionality of modelr. Instead of creating an arbitrarily shaped wedge (which is plenty useful in its own right), users can now create a synthetic seismogram out of any geology they can think of, or extract from their data.

Turn a geologic-section into an earth model

We implemented a color picker within an image processing scheme, so that each unique colour gets mapped to an editable rock type. Users can create and manage their own rock property catalog, and save models as templates to share and re-use. You can use as many or as few colours as you like, and you'll never run out of rocks.

To give an example, let's use the stratigraphic diagram that Bruce Hart used in making synthetic seismic forward models in his recent Whither seismic stratigraphy article. There are 7 unique colours, so we can generate an earth model by assigning a rock to each of the colours in the image.

If you can imagine it, you can draw it. If you can draw it, you can model it.

Modeling as an interactive experience

We've exposed parameters in the interface and so you can interact with the multidimensional seismic data space. Why is this important? Well, modeling shouldn't be a one-shot deal. It's an iterative process. A feedback cycle where you turn knobs, pull levers, and learn about the behaviour of a physical system; in this case it is the interplay between geologic units and seismic waves. 

A model isn't just a single image, but a swath of possibilities teased out by varying a multitude of inputs. With modelr, the seismic experiment can be manipulated, so that the gamut of geologic variability can be explored. That process is how we train our ability to see geology in seismic.

Hart's paper doesn't specifically mention the rock properties used, so it's difficult to match amplitudes, but you can see here how modelr stands up next to Hart's images for high (75 Hz) and low (25 Hz) frequency Ricker wavelets.

There are some cosmetic differences too... I've used fewer wiggle traces to make it easier to see the seismic waveforms. And I think Bruce forgot the blue strata on his 25 Hz model. But I like this display, with the earth model in the background, and the wiggle traces on top — geology and seismic blended in the same graphical space, as they are in the real world, albeit briefly.


Subscribe to the email list to stay in the loop with modelr news, or sign-up at modelr.io and get started today.

This will add you to the email list for the modeling tool. We never share user details with anyone. You can unsubscribe any time.

Seismic models: Hart, BS (2013). Whither seismic stratigraphy? Interpretation, volume 1 (1). The image is copyright of SEG and AAPG.

Slicing seismic arrays

Scientific computing is largely made up of doing linear algebra on matrices, and then visualizing those matrices for their patterns and signals. It's a fundamental concept, and there is no better example than a 3D seismic volume.

Seeing in geoscience, literally

Digital seismic data is nothing but an array of numbers, decorated with header information, sorted and processed along different dimensions depending on the application.

In Python, you can index into any sequence, whether it be a string, list, or array of numbers. For example, we can index into the fourth character (counting from 0) of the word 'geoscience' to select the letter 's':

>>> word = 'geosciences'
>>> word[3]
's'

Or, we can slice the string with the syntax word[start:end:step] to produce a sub-sequence of characters. Note also how we can index backwards with negative numbers, or skip indices to use defaults:

>>> word[3:-1]  # From the 4th character to the penultimate character.
'science'
>>> word[3::2]  # Every other character from the 4th to the end.
'sine'

Seismic data is a matrix

In exactly the same way, we index into a multi-dimensional array in order to select a subset of elements. Slicing and indexing is a cinch using the numerical library NumPy for crunching numbers. Let's look at an example... if data is a 3D array of seismic amplitudes:

timeslice = data[:,:,122] # The 122nd element from the third dimension.
inline = data[30,:,:]     # The 30th element from the first dimension.
crossline = data[:,60,:]  # The 60th element from the second dimension.

Here we have sliced all of the inlines and crosslines at a specific travel time index, to yield a time slice (left). We have sliced all the crossline traces along an inline (middle), and we have sliced the inline traces along a single crossline (right). There's no reason for the slices to remain orthogonal however, and we could, if we wished, index through the multi-dimensional array and extract an arbitrary combination of all three.

Questions involving well logs (a 1D matrix), cross sections (2D), and geomodels (3D) can all be addressed with the rigours of linear algebra and digital signal processing. An essential step in working with your data is treating it as arrays.

View the notebook for this example, or get the get the notebook from GitHub and play with around with the code.

Sign up!

If you want to practise slicing your data into bits, and other power tools you can make, the Agile Geocomputing course will be running twice in the UK this summer. Click one of the buttons below to buy a seat.

Eventbrite - Agile Geocomputing, Aberdeen

Eventbrite - Agile Geocomputing, London

More locations in North America for the fall. If you would like us to bring the course to your organization, get in touch.

Great geophysicists #11: Thomas Young

Painting of Young by Sir Thomas LawrenceThomas Young was a British scientist, one of the great polymaths of the early 19th century, and one of the greatest scientists. One author has called him 'the last man who knew everything'¹. He was born in Somerset, England, on 13 June 1773, and died in London on 10 May 1829, at the age of only 55. 

Like his contemporary Joseph Fourier, Young was an early Egyptologist. With Jean-François Champollion he is credited with deciphering the Rosetta Stone, a famous lump of granodiorite. This is not very surprising considering that at the age of 14, Young knew Greek, Latin, French, Italian, Hebrew, Chaldean, Syriac, Samaritan, Arabic, Persian, Turkish and Amharic. And English, presumably. 

But we don't include Young in our list because of hieroglyphics. Nor  because he proved, by demonstrating diffraction and interference, that light is a wave — and a transverse wave at that. Nor because he wasn't a demented sociopath like Newton. No, he's here because of his modulus

Elasticity is the most fundamental principle of material science. First explored by Hooke, but largely ignored by the mathematically inclined French theorists of the day, Young took the next important steps in this more practical domain. Using an empirical approach, he discovered that when a body is put under pressure, the amount of deformation it experiences is proportional to a constant for that particular material — what we now call Young's modulus, or E:

This well-known quantity is one of the stars of the new geophysical pursuit of predicting brittleness from seismic data, and a renewed interested in geomechanics in general. We know that Young's modulus on its own is not enough information, because the mechanics of failure (as opposed to deformation) are highly nonlinear, but Young's disciplined approach to scientific understanding is the best model for figuring it out. 

Sources and bibliography

Footnote

¹ Thomas Young wrote a lot of entries in the 1818 edition of Encyclopædia Britannica, including pieces on bridges, colour, double refraction, Egypt, friction, hieroglyphics, hydraulics, languages, ships, sound, tides, and waves. Considering that lots of Wikipedia is from the out-of-copyright Encyclopædia Britannica 11th ed. (1911), I wonder if some of Wikipedia was written by the great polymath? I hope so.

The nonlinear ear

Hearing, audition, or audioception, is one of the Famous Five of our twenty or so senses. Indeed, it is the most powerful sense, having about 100 dB of dynamic range, compared to about 90 dB for vision. Like vision, hearing — which is to say, the ear–brain system — has a nonlinear response to stimuli. This means that increasing the stimulus by, say, 10%, does not necessarily increase the response by 10%. Instead, it depends on the power and bandwidth of the signal, and on the response of the system itself.

What difference does it make if hearing is nonlinear? Well, nonlinear perception produces some interesting effects. Some of them are especially interesting to us because hearing is analogous to the detection of seismic signals — which are just very low frequency sounds, after all.

Stochastic resonance (Zeng et al, 2000)

One of the most unintuitive properties of nonlinear detection systems is that, under some circumstances, most importantly in the presence of a detection threshold, adding noise increases the signal-to-noise ratio.

I'll just let you read that last sentence again.

Add noise to increase S:N? It might seem bizarre, and downright wrong, but it's actually a fairly simple idea. If a signal is below the detection threshold, then adding a small Goldilocks amount of noise can make the signal 'peep' above the threshold, allowing it to be detected. Like this:

I have long wondered what sort of nonlinear detection system in geophysics might benefit from a small amount of noise. It also occurs to me that signal reconstruction methods like compressive sensing might help estimate that 'hidden' signal from the few semi-random samples that peep above the threshold. If you know of experiments in this, I'd love to hear about it.

Better than Heisenberg (Oppenheim & Magnasco, 2012)

Denis Gabor realized in 1946 that Heisenberg's uncertainty principle also applies to linear measures of a signal's time and frequency. That is, methods like the short-time Fourier transform (STFT) cannot provide the time and the frequency of a signal with arbitrary precision. Mathematically, the product of the uncertainties has some minimum, sometimes called the Fourier limit of the time–bandwidth product.

So far so good. But it turns out our hearing doesn't work like this. It turns out we can do better — about ten times better.

Oppenheim & Magnasco (2012) asked subjects to discriminate the timing and pitch of short sound pulses, overlapping in time and/or frequency. Most people were able to localize the pulses, especially in time, better than the Fourier limit. Unsurprisingly, musicians were especially sensitive, improving on the STFT by a factor of about 10. While seismic signals are not anything like pure tones, it's clear that human hearing does better than one of our workhorse algorithms.

Isolating weak signals (Gomez et al, 2014)

One of the most remarkable characteristics of biological systems is adaptation. It seems likely that the time–frequency localization ability most of us have is a long-term adaption. But it turns out our hearing system can also rapidly adapt itself to tune in to specific types of sound.

Listening to a voice in a noisy crowd, or a particular instrument in an orchestra, is often surprisingly easy. A group at the University of Zurich has figured out part of how we do this. Surprisingly, it's not high-level processing in the auditory cortex. It's not in the brain at all; it's in the ear itself.

That hearing is an active process was known. But the team modeled the cochlea (right, purple) with a feature called Hopf bifurcation, which helps describe certain types of nonlinear oscillator. They established a mechanism for the way the inner ear's tiny mechanoreceptive hairs engage in active sensing.

What does all this mean for geophysics?

I have yet to hear of any biomimetic geophysical research, but it's hard to believe that there are no leads here for us. Are there applications for stochastic resonance in acquisition systems? We strive to make receivers with linear responses, but maybe we shouldn't! Could our hearing do a better job of time-frequency localization than any spectral decomposition scheme? Could turning seismic into music help us detect weak signals in the geological noise?

All very intriguing, but of course no detection system is perfect... you can fool your ears too!

References

Zeng FG, Fu Q, Morse R (2000). Human hearing enhanced by noise. Brain Research 869, 251–255.

Oppenheim, J, and M Magnasco (2013). Human time-frequency acuity beats the Fourier uncertainty principle. Physical Review Letters. DOI 10.1103/PhysRevLett.110.044301 and in the arXiv.

Gomez, F, V Saase, N Buchheim, and R Stoop (2014). How the ear tunes in to sounds: A physics approach. Physics Review Applied 1, 014003. DOI 10.1103/PhysRevApplied.1.014003.

The stochastic resonance figure is original, inspired by Simonotto et al (1997), Physical Review Letters 78 (6). The figure from Oppenheim & Magnasco is copyright of the authors. The ear image is licensed CC-BY by Bruce Blaus

Saving time with code

A year or so ago I wrote that...

...every team should have a coder. Not to build software, not exactly. But to help build quick, thin solutions to everyday problems — in a smart way. Developers are special people. They are good at solving problems in flexible, reusable, scalable ways.

Since writing that, I've written more code than ever. I'm not ready to say that my starry-eyed vision of a perfect world of techs-cum-coders, but now I see that the path to nimble teams is probably paved with long cycle times, and never-ending iterations of fixing bugs and writing documentation.

So potentially we replace the time saved, three times over, with a tool that now needs documenting, maintaining, and enhancing. This may not be a problem if it scales to lots of users with the same problem, but of course having lots of users just adds to the maintaining. And if you want to get paid, you can add 'selling' and 'marketing' to the list. Pfff, it's a wonder anybody ever makes anthing!

At least xkcd has some advice on how long we should spend on this sort of thing...

All of the comics in this post were drawn by and are copyright of the nonpareil of geek cartoonery, Randall Munroe, aka xkcd. You should subscribe to his comics and his What If series. All his work is licensed under the terms of Creative Commons Attribution Noncommercial.