Git Product home page Git Product logo

python-for-geoscientists's Introduction

Python for Geoscientists

A notebook-based introduction to python, jupyter notebooks and programming workflows with examples from python packages for the Earth Sciences.

The material is broken down into a number of sections of, approximately, increasing difficulty.

  1. Introduction to python / jupyter
  2. Introduction to version control with git
  3. Getting Started with Numpy / Scipy
  4. Introduction to Matplotlib
  5. Stripy for meshing / mapping the Sphere
  6. Making beautiful and useful maps with Cartopy
  7. Finite Differences with numpy

Description

Python has become a popular language for scientific computing, boasting a rich set of libraries relevant to geoscientists working with data. It has all the friendly features and conveniences you would expect of a modern programming language. The Python programming language offers adaptability and versatility to the types of analyses, modelling, and workflows that geoscientists utilise. The tools and workflows you will explore in this course are presented as Jupyter notebooks and can easily be adapted to your own research.

We are also going to focus on problem-solving approaches to computation - developing a systematic approach to programming, testing, debugging and documentation. We will make use of git for version control which is a tool / strategy that you will definitely find helpful in future. We will do all of our work within the literate programming environment of jupyter notebooks / jupyter lab.

We will introduce/review the 'standard' scientific python toolkits such as numpy, scipy, matplotlib, pandas. We will teach you how to manipulate and transform data in simple ways, plotting, mapping, visualisation, interpolation, gridding, function fitting, and exporting data / images into common, interchangeable data formats such as hdf5 and netcdf, geotiff.

We will learn how to orchestrate common earth science python software applications, seismic data set acquisition and analysis (obspy), meshing and interpolation (stripy). We will learn how to solve very simple differential equations with application to geothermal energy and ground water flow, statistical analysis of data sets.

Dependencies

  • numpy
  • scipy
  • matplotlib
  • cartopy
  • pandas
  • scikit-learn
  • jupyter
  • pygplates
  • gplately

Installation

You can install the all of the above dependencies using conda:

conda install -c conda-forge gplately scikit-learn jupyter

If you don't already have conda installed, we recommend miniforge.

Creating a new conda environment

We recommend creating a new conda environment inside which to install these dependencies. This avoids any potential conflicts in your base Python environment. In the example below we create a new environment called "my-env":

conda create -n my-env
conda activate my-env
conda install -c conda-forge gplately scikit-learn jupyter

my-env needs to be activated whenever you use GPlately: i.e. conda activate my-env.

Docker

Alternatively a Docker image can be sourced from: https://hub.docker.com/repository/docker/nickywright/geo-python/general

Acknowledgements

This coursework was created by a number of collaborators whom we want to acknowledge:

  • Louis Moresi (for the course structure and the majority of the notebooks)
  • Sara Moron (for some updates to the notebooks)
  • Nathanial Butterworth (machine learning and introductionary notebooks)
  • Rohitash Chandra (machine learning and data wrangling)
  • Ben Mather (advanced finite difference notebooks)
  • Nicky Wright (for the docker image)

python-for-geoscientists's People

Contributors

brmather avatar eben4032 avatar saraemp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

mtoqeerpk ciatedj

python-for-geoscientists's Issues

7-LoadingData.ipynb

7-LoadingData.ipynb
Cell 2 should be chemdata=numpy.loadtxt(filename, delimiter=',') not chemdata=np.loadtxt(filename, delimiter=',')

%pylab inline use

A lot of the notebooks use

%pylab inline

I think this is not longer recommended? link

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.