Feel superhuman: learning and teaching geocomputing

Diego teaching in Houston in 2018.

Diego teaching in Houston in 2018.

It’s five years since we started teaching Python to geoscientists. To be honest, it might have been premature. At the time, Evan and I were maybe only two years into serious, daily use of Python. But the first class, at the Atlantic Geological Society’s annual meeting in February 2014, was free so the pressure was not too high. And it turns out that only being a step or two ahead of your students can be an advantage. Your ‘expert blind spot’ is partially sighted not completely blind, because you can clearly remember being a noob.

Being a noob is a weird, sometimes very uncomfortable, even scary, feeling for some people. Many of us are used to feeling like experts, at least some of the time. Happy, feeling like a noob is a core competency in programming. Learning new things is a more or less hourly experience for coders. Even a mature language like Python evolves fast enough that it’s hard to keep up. Instead of feeling threatened or exhausted by this, I think the best strategy is to enjoy it. You’ll never be done, there are (way) more questions than answers, and you can learn forever!

One of the bootcamp groups at the Copenhagen hackathon in 2018

One of the bootcamp groups at the Copenhagen hackathon in 2018

This week we’re teaching our 40th course. Last year alone we gave digital superpowers to 325 people, mostly geoscientists, Not all of them learned to code, as such — some people already could, and some found out theydidn’t like it… coding really isn’t for everyone. But I think all of them learned something new about technology, and how it can serve them and their science. I hope all of them look at spreadsheets, and Petrel, and websites differently now. I think most of them want, at some point, to learn more. And everyone is excited about machine learning.

The expanding community of quantitative earth scientists

This year we’ve already spent 50 days teaching, and taught 174 people. Imagine that! I get emotional when I think about what these hundreds of new digital geoscientists and engineers will go and do with their new skills. I get really excited when I see what they are already doing — when they come to hackathons, send us screenshots, or write papers with beautiful figures. If the joy of sharing code and collaborating with peers has also rubbed off on them, there’s no telling where it could lead.

Matt teaching in Aberdeen in October 2018

Matt teaching in Aberdeen in October 2018

The last nine months or so have been an adventure. Teaching is not supposed to be what Agile is about. We’re a consulting company, a technology company. But for now we’re mostly a training company — it’s where we’re needed. And it makes sense... Programming is fundamentally about knowledge sharing. Teaching is about helping, collaborating. It’s perfect for us.

Besides, it’s a privilege and a thrill to meet all these fantastically smart, motivated people and to hear about their projects and their plans. Sometimes I wish it didn’t mean leaving my family in Nova Scotia and flying to Houston and London and Kuala Lumpur and Kalamazoo… but mostly I wish we could do more of it. Especially when we get comments like these:

Given how ‘dry’ programming can be, it was DYNAMIC.”
”Excellent teachers with geoscience background.”
”Great instructors, so so approachable, even for newbies like me.”
”Great course [...] Made me realize what could be done in a short time.”
”My only regret was not taking a class like this sooner.”
”Very positive, feel superhuman.

How many times have you felt superhuman at work recently?

The courses we teach are evolving and expanding in scope. But they all come back to the same thing: growing digital skills in our profession. This is critical because using computers for earth science is really hard. Why? The earth is weird. We’ve spent hundreds of years honing conceptual models, understanding deep time, and figuring out complex spatial relationships.

If data science eats the subsurface without us, we’re all going to get indigestion. Society needs to better understand the earth — for all sorts of reasons — and it’s our duty to build and adopt the most powerful analytical tools available so that we can help.

Learning resources

If you can’t wait to get started, here are some suggestions:

Classroom courses are a big investment in dollars and time, but they can get you a long way really quickly. Our courses are built especially for subsurface scientists and engineers. As far as I know, they are the only ones of their kind. If you think you’d like to take one, talk to us, or look out for a public course. You can find out more or sign up for email alerts here >> https://agilescientific.com/training/

Last thing: I suggest avoiding DataCamp, because of sexual misconduct by an executive, compounded by total inaction, dishonest obfuscation, and basically failing spectacularly. Even their own trainers have boycotted them. Steer clear.

To plot a wavelet

As I mentioned last time, a good starting point for geophysical computing is to write a mathematical function describing a seismic pulse. The IPython Notebook is designed to be used seamlessly with Matplotlib, which is nice because we can throw our function on graph and see if we were right. When you start your own notebook, type

ipython notebook --pylab inline

We'll make use of a few functions within NumPy, a workhorse to do the computational heavy-lifting, and Matplotlib, a plotting library.

import numpy as np
import matplotlib.pyplot as plt

Next, we can write some code that defines a function called ricker. It computes a Ricker wavelet for a range of discrete time-values t and dominant frequencies, f:

def ricker(f, length=0.512, dt=0.001):
    t = np.linspace(-length/2, (length-dt)/2, length/dt)
    y = (1.-2.*(np.pi**2)*(f**2)*(t**2))*np.exp(-(np.pi**2)*(f**2)*(t**2))
    return t, y

Here the function needs 3 input parameters; frequency, f, the length of time over which we want it to be defined, and the sample rate of the signal, dt. Calling the function returns two arrays, the time axis t, and the value of the function, y.

To create a 5 Hz Ricker wavelet, assign the value of 5 to the variable f, and pass it into the function like so,

f = 5
t, y = ricker (f)

To plot the result,

plt.plot(t, y)

But with a few more commands, we can improve the cosmetics,

plt.plot( t, y, lw=2, color='black', alpha=0.5)
plt.fill_between(t, y, 0,  y > 0.0, interpolate=False, hold=True, color='blue', alpha = 0.5)
plt.fill_between(t, y, 0, y < 0.0, interpolate=False, hold=True, color='red', alpha = 0.5)

# Axes configuration and settings (optional)
plt.title('%d Hz Ricker wavelet' %f, fontsize = 16 )
plt.xlabel( 'two-way time (s)', fontsize = 14)
plt.ylabel('amplitude', fontsize = 14)

Next up, we'll make this wavelet interact with a model of the earth using some math. Let me know if you get this up and running on your own.

Let's do it

It's short notice, but I'll be in Calgary again early in the new year, and I will be running a one-day version of this new course. To start building your own tools, pick a date and sign up:

Eventbrite - Agile Geocomputing    Eventbrite - Agile Geocomputing

Review: First Steps in Seismic Interpretation

Thomas Martin is a first-year graduate student at Scripps Institution of Oceanography. He got bored of waiting for us to review the seismic interpretation books (we are tectonically slow sometimes) and offered to review some for us. Thank you, Thomas! He's just about to set off on a research cruise to the Canadian Arctic on USCGC Healy to collect CHIRP seismic reflection data and sediment cores.

Herron, D (2012). First Steps in Seismic Interpretation. Geophysical Monograph Series 16. Society of Exploration Geophysicists, Tulsa, OK. Print ISBN 978-156080280-8. Ebook DOI 10.1190/1.9781560802938. List price: USD62. Member price: USD49. Student price: USD39.20

As a graduate student, this book has become quite the resource for me. It gives a good handle on basic seismic properties, and provides a solid introduction. Some of the topics it covers are not typically discussed in a geoscience journal papers that use seismic reflection data (migration comes to mind). The table of contents gives an idea of the breadth:

  1. Introduction
  2. Seismic response
  3. Seismic attributes — including subsections on amplitude, coherence, and inversion
  4. Velocity — sonic logs, well velocity surveys, seismic velocities, anisotropy, and depth conversion
  5. Migration
  6. Resolution
  7. Correlation concepts — horizons and faults, multiples, pitfalls, automatic vs manual picking
  8. Correlation procedures — loop tying, jump correlations, visualization
  9. Data quality and management — keeping track of everything
  10. Other considerations — e.g. 4D seismic, uncertainty and risk, and ergonomics

One of the great things about this book is that it's designed to be light on math, so all levels of geoscientists can pick it up. I have found this book invaluable because it is a great bridge from the 'pure' geophysicist to the seismic interpreter, and can improve the dialogue between these two camps. Chapter 10 is 'leftover' subjects, but it is one of the most helpful in the book as it covers approximations, career development, and a fantastic section on time spent and value added.

The book covers a lot of ground but, with the book coming in at under 200 pages, nothing in detail — this is not meant to be the ultimate text for seismic interpretation. I think the book is a little light for nearly $40 plus shipping, however (student price; the list price is over $60). I would recommend it to graduate students or early career scientists with an interest in seismic data, across the full range of geoscience disciplines. The price for a student is high for a small paperback book under 200 pages, but the content is worth it.

If you liked this review please leave an encouraging comment for Thomas.

First class in India

I wrote this post yesterday morning, sitting in the Indira Ghandi International Airport in Delhi, India.

Where am I?

I'm in India. Some quick facts:

I met some of these recent graduates last week, in an experimental corporate training course. Cairn India has been running a presentation skills course for several years, provided by a local trainer called Yadhav Mehra. Yadhav is a demure, soft-spoken man, right up until he stands up in front of his students. Then he becomes a versatile actor and spontaneous stand-up, swerving with the confidence of a Delhi cab driver between poignant personal stories and hilarious what-not-to-do impressions. I’ve been on the receiving end of plenty of courses before, but Yadhav really made me see ‘training’ as a profession in itself, with skills and standards of its own. I am grateful for that.

How did I end up here?

Serendipity is a wonderful thing. Last fall, Susan Eaton—whom I’d met in the pub after teaching for the first time—wrote a nice piece about my then-new writing course. One of my long-lost PhD supervisors, Stuart Burley, read this article in his office at Cairn India in Delhi, and it triggered a thought. He had Yadhav, a pro trainer, helping his super-bright geoscience and engineering grads with their presentation skills, but they also needed coaching in writing. 

Their education provides them with...

the traditional written communication vernacular employed in the physical sciences, in which exposition is lengthily embellished with extraneous verbiage, and the passivum, or passive voice in its not uncommon appellation, is unfailingly and rigorously exercised.

You get my point. Stuart’s thought was: let’s do combine the two courses!

What happened?

The great thing about Stuart is that, along with breadth of experience and penetrating geological insight, he’s practical—he gets stuff done. (Like almost everything else in my dim-witted student days, I didn’t appreciate how valuable this was at the time.) So the three of us planned a 3-day course that combined my day's worth of writing coaching with Yadhav's two-day presentation course. Yadhav brought some didactic rigour, and I brought some technical depth. Like all collectable first edition, it had some rough edges, but it went beautifully. Students wrote an extended abstract for a conference paper on Tuesday, then presented their paper on Thursday—they made a great effort, and all did brilliantly.

I hope we run the course again—I'd love to see it reach its full potential. 

In the meantime, if you're interested in exploring ways to get more people in your organization writing a little better, or a little more often, do get in touch! You can find out more here. 

Rotten writing's rubbish, right?

Marked-up copy — effective copy editing is a useful skill for all scientists that writeI love teaching. I get a buzz from it. I don't know that I'm great at it, but I want to be great. As a student, I think I was quite reflective—both of my parents were teachers—and one of the great things about teaching is that you finally get to put your money where your mouth is. Every time you berated a teacher's boringness (behind their backs, obviously), or whined about how pointless an essay or lab exercise was (to your buddies), is now held up as a vivid and uncomfortable challenge. 

So late last year I got in touch with the Canadian Society of Petroleum Geologists (CSPG) and the US Society of Exploration Geophysicists (SEG) and offered a one-day short course. They both said they'd been wanting to offer something like it and, if enough people sign up for it, the course will run at least twice this year:

My worry is this: writing is like driving—most people think they're pretty good at it. But my course isn't just about style, it's also about tools, publishing, and getting things done. My two goals for the day are:

Get more people writing. Especially people from industry, who often excuse themselves from the global scientific community. 'I don't have the time' or 'My work's not interesting enough' are the things I hear. And maybe I'm a shallow, superficial kind of person, but I'm not so worried about high-brow, highly specialized, technical writing. There's plenty of that. I just want to see more grass-roots experience, stories, tutorials, field trip reports, how-to's, and what-I-did-at-the-weekend's. More community, in less traditional media.

Get people thinking about good style. Style has two aspects: the qualitative (what we might call interestingness) and the quantitative (correctness).  I don't claim to be the world's greatest writer myself, but I know what gets me good feedback in my work, and I have an eye for detail (did you notice the extra space back there? I did). I think there are two insidious notions out there about writing: science is serious business, and 'nit-picky' detail is not all that important. Both of these notions are nonsense.

If you were to take a writing skills course like this, what would you want to do or see? If you've done a course like this before and loved it (or not!), what can I learn from it? 

Apologies to Jon Agee for the title; his poem Rotten Writing, in his book Orangutan Tongs was the inspiration.