Python for Geophysicists
Registration | General Course Information
This course follows the structure of our popular Python for Scientists and Engineers course, but all materials are targeted towards geophysicists and petrophysicists who would like to use Python in their day-to-day work. The course material handles the use of Python for geomechanics, engineering, and modeling. Specific exercises include reading well logs into NumPy arrays and doing calculations on them, writing a module to calculate bulk density from P-wave velocity working with well logs, identifying areas of bad data in well logs, and selecting a horizon from a seismic cube.
Target Audience
Programming experience in some language (C, VB, Fortran, Matlab) is expected. Experience with C, C++, and/or Fortran is useful for some topics. Object oriented programming skills are not necessary but will be helpful. Knowledge of calculus, statistics, signal and image processing, optimization, are all valuable but not absolutely required.
Course Topics
Day 1
8:30 am to 5:00 pm
Python
The first day is devoted to understanding how to think in Python. We start by demonstrating the IPython interactive environment and how it can be used for rapid application development. The pace of this day is determined by previous exposure to Python. Even experienced Python programmers report learning new ideas from the experts that teach this course.
- Data-types (strings, lists, dictionaries, files)
- Syntax and language structure
- Creating and importing modules
- Reading and writing files
- Overview of the standard library
- Introduction to object oriented programming
Day 2
8:30 am to 5:00 pm
NumPy
On the second day, the NumPy extension module to Python is exposed as a tool for rapidly manipulating and processing large data-sets.
- Basic operations and manipulations on N-dimensional arrays
- Understanding the N-dimensional data structure
- Using vectorization to process arrays with implicit loops
- Understanding slicing and broadcasting
- Dealing with large data-sets
- Working with "structured" arrays
- Reading and writing data
- Reading well logs into NumPy arrays and doing calculations on them
- Writing a module to calculate bulk density from P-wave velocity
Day 3
8:30 am to 5:00 pm

