Want updates? Opt out any time

News
Tuesday
Dec102013

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.figure(figsize=(7,4))
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)
plt.ylim((-1.1,1.1))
plt.xlim((min(t),max(t)))
plt.grid()
plt.show()

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
Thursday
Dec052013

Coding to tell stories

Last week, I was in Calgary on family business, but I took an afternoon to host a 'private beta' for a short course that I am creating for geoscience computing. I invited about twelve familiar faces who would be provide gentle and constuctive feedback. In the end, thirteen geophysicists turned up, seven of whom I hadn't met before. So much for familiarity.

I spent about two and half hours stepping through the basics of the Python programming language, which I consider essential material — getting set up with Python via Enthought Canopy, basic syntax, and so on. In the last hour of the afternoon, I steamed through a number of geoscientific examples to showcase exercises for this would-be course. 

Here are three that went over well. Next week, I'll reveal the code for making these images. I might even have a go at converting some of my teaching materials from IPython Notebook to HTML:

To plot a wavelet

The Ricker wavelet is a simple analytic function that is used throughout seismology. This curvaceous waveform is easily described by a single variable, the dominant frequency of its many contituents frequencies. Every geophysicist and their cat should know how to plot one: 

To make a wedge

Once you can build a wavelet, the next step is to make that wavelet interact with the earth. The convolution of the wavelet with this 3-layer impedance model yields a synthetic seismogram suitable for calibrating seismic signals to subtle stratigraphic geometries. Every interpreter should know how to build a wedge, with site-specific estimates of wavelet shape and impedance contrasts. Wedge models are important in all instances of dipping and truncated layers at or below the limit of seismic resolution. So basically they are useful all of the time. 

To make a 3D viewer

The capacity of Python to create stunning graphical displays with merely a few (thoughtful) lines of code seemed to resonate with people. But make no mistake, it is not easy to wade through the hundreds of function arguments to access this power and richness. It takes practice. It appears to me that practicing and training to search for and then read documentation, is the bridge that carries people from the mundane to the empowered.

This dry-run suggested to me that there are at least two markets for training here. One is a place for showing what's possible — "Here's what we can do, now let’s go and build it". The other, more arduous path is the coaching, support, and resources to motivate students through the hard graft that follows. The former is centered on problem solving, the latter is on problem finding, where the work and creativity and sweat is. 

Would you take this course? What would you want to learn? What problem would you bring to solve?

Tuesday
Dec032013

Which brittleness index?

A few weeks ago I looked at the concept — or concepts — of brittleness. There turned out to be lots of ways of looking at it. We decided to call it a rock behaviour rather than a property. And we determined to look more closely at some different ways to define it. Here they are...

Some brittleness indices

There are lots of 'definitions' of brittleness in the literature. Several of them capture the relationship between compressive and tensile strength, σC and σT respectively. This is potentially useful, because we measure uniaxial compressive strength in the standard triaxial rig tests that have become routine in shale studies... but we don't usually find the tensile strength, because it's much harder to measure. This is unfortunate, because hydraulic fracturing is initially a tensile failure (though reactivation and other failure modes do occur — see Williams-Stroud et al. 2012).

Altindag (2003) gave the following three examples of different brittleness indices. In turn, they are the strength ratio, a sort of relative strength contrast, and the mean strength (his favourite):

This is just the start, once you start digging, you'll find lots of others. Like Hucka & Das's (1974) round-up I wrote about last time, one thing they have in common is that they capture some characteristic of rock failure. That is, they do not rely on implicit rock properties.

Another point to note. Bažant & Kazemi (1990) gave a way to de-scale empirical brittleness measures to account for sample size — not surprisingly, this sort of 'real world adjustment' starts to make things quite complicated. Not so linear after all.

What not to do

The prevailing view among many interpreters is that brittleness is proportional to Young's modulus and/or Poisson's ratio, and/or a linear combination of these. We've reported a couple of times on what Lev Vernik (Marathon) thinks of the prevailing view: we need to question our assumptions about isotropy and linear strain, and computing shale brittleness from elastic properties is not physically meaningful. For one thing, you'll note that elastic moduli don't have anything to do with rock failure.

The Young–Poisson brittleness myth started with Rickman et al. 2008, SPE 115258, who presented a rather ugly representation of a linear relationship (I gather this is how petrophysicists like to write equations). You can see the tightness of the relationship for yourself in the data.

If I understand  the notation, this is the same as writing B = 7.14E – 200ν + 72.9, where E is (static) Young's modulus and ν is (static) Poisson's ratio. It's an empirical relationship, based on the data shown, and is perhaps useful in the Barnett (or wherever the data are from, we aren't told). But, as with any kind of inversion, the onus is on you to check the quality of the calibration in your rocks. 

What's left?

Here's Altindag (2003) again:

Brittleness, defined differently from author to author, is an important mechanical property of rocks, but there is no universally accepted brittleness concept or measurement method...

This leaves us free to worry less about brittleness, whatever it is, and focus on things we really care about, like organic matter content or frackability (not unrelated). The thing is to collect good data, examine it carefully with proper tools (Spotfire, Tableau, R, Python...) and find relationships you can use, and prove, in your rocks.

References

Altindag, R (2003). Correlation of specific energy with rock brittleness concepts on rock cutting. The Journal of The South African Institute of Mining and Metallurgy. April 2003, p 163ff. Available online.

Hucka V, B Das (1974). Brittleness determination of rocks by different methods. Int J Rock Mech Min Sci Geomech Abstr 10 (11), 389–92. DOI:10.1016/0148-9062(74)91109-7.

Rickman, R, M Mullen, E Petre, B Grieser, and D Kundert (2008). A practical use of shale petrophysics for stimulation design optimization: all shale plays are not clones of the Barnett Shale. SPE 115258, DOI: 10.2118/115258-MS.

Williams-Stroud, S, W Barker, and K Smith (2012). Induced hydraulic fractures or reactivated natural fractures? Modeling the response of natural fracture networks to stimulation treatments. American Rock Mechanics Association 12–667. Available online.

Thursday
Nov282013

Plant a seed for science and tech

Cruising around the web last weekend looking for geosciencey Christmas presents, coupled with having 3 kids (aged 9, 5, and 3) to entertain and educate, I just realized I have a long list of awesome toys to share. Well, I say toys, but these amazing things are almost in a class of their own...

Bigshot camera

A full kit for a child to build his or her own camera, and it's only $89. Probably best suited to those aged 7 up to about 12. Features:

  • comes with everything you need, including a screwdriver,
  • a crank instead of a battery,
  • multiple lenses including anaglyphic 3D,
  • a set of online tutorials about the components and how they work — enlightening!

LittleBits

Epic. For kids (and others) that aren't quite ready for a soldering iron, these magentic blocks just work. There are blocks for power, for input (like this pressure sensor), and for output. They can, and should, be combined with each other and anything else (Lego, Meccano, straws, dinosaurs) for maximum effect. Wonderful.

Anything at all from SparkFun

... and there's Adafruit too. I know we had Tandy or RadioShack or whatever in the early 1980s, but we didn't have the Internet. So life was, you know, hard. No longer. Everything at SparkFun is affordable, well-designed, well-documented, and—well—fun. I mean, who wouldn't want to build their own Simon Says

And this is just a fraction of what's out there... Lego MINDSTORMS for the bigger kids, GoldieBlox for smaller kids, Raspberry Pi for the teens. I get very excited when I think about what this means for the future of invention, creativity, and applied science. 

Even more exciting, it's us grown-ups that get to help them explore all this fun. Where will you start?

Monday
Nov252013

All you want for Christmas

It's that time again! If you're tired of giving the same old rocks to the same old geologists, I've got some fresh ideas for you.

Stuff

  • My wife came back from town recently with this spectacular soap, from Soap Rocks. I mean, just look at it. It's even better in real life.
  • You just can't go wrong with a beautiful hammer, like this limited edition Estwing. Don't forget safety glasses!
  • Or go miniature, with these tiny (Canadian!) hammers in gold ($859) or silver ($249). Steepish prices, but these aren't exactly mainstream.
  • More jewellery: geode earrings. Hopefully not too massive.

Tees

It's the obligatory t-shirt collection! Here are some that jumped out at me — and one of them is even a bit geophysical. Available from (left to right) Threadless (here's another fun one), Etsy, and Metropark.

Books... and non-books

  • There are loads of books in our reading list — some of them are essential, and some are totally workable as gifts.
  • It would be remiss of me not to mention our own new book, 52 Things You Should Know About Geology — perfect (I think, but I would say that) for students and professionals alike, especially those in applied/industrial geoscience.
  • I'm a big fan of Edward Tufte's beautiful books about data visualization, and they are now available in paperback. All four books for $100 is truly a bargain.
  • It's not a book exactly, but I do like this minerals poster. Although less useful, this arty version is even prettier... and this cushion is verging on spectacular. 

Goggle box

Tired of reading about geology after cranking through papers or dissertations all day? TV has rocks too! There's Iain Stewart's various series (right — Earth, 2009, and How To Grow A Planet, 2011) for some quality BBC programming. If you're in Canada, you might prefer CBC's Geologic Journey, 2011 — inexplicably hosted by a non-geologist. The Discovery Channel made Inside Planet Earth, 2009 but I've never liked their stuff. some of this stuff might even be on Netflix... 

Kids' stuff

Kids like geology too. A Rock Is Lively manages to be beautiful and informative, Rocks: Hard, Soft, Smooth, and Rough focuses on the science, and If Rocks Could Sing is just cute. If it's toys you're after, you can start them young with this wooden stacking volcano, or you could go for this epic Lego globe... (not for the half-hearted: it will require you to load the Digital Designer file and order a large number of bricks).

Still stuck? Try my Christmas post from last year, or the year before, or the year before that. I highly recommend Evelyn Mervine's posts too — loads more ideas there.

The T-shirt and book cover images are copyright of their respective owners and assumed to be fair use. The soap picture is licensed CC-BY.

Page 1 ... 5 6 7 8 9 ... 76 Next 5 Entries »