Lecture notes of the Environmental Science master unit ENVI5809 - Environmental Simulation Modelling, taught to 2nd semester students at the University of Sydney.

This lecture is tailored for a semester-long class, but these notes might also be of interest to other (envi-)scientists wanting to learn how to query, analyse and visualise scientific dataset. Welcome to you all!


What we will use and why we care?

This unit of study introduces approaches to understand and predict behaviour of natural systems. It covers fundamental concepts, logic, and techniques, and develops skills in application to environmental problems.


Today, simulation modelling and scientific data query techniques are routinely applied by governmental agencies, companies and research organisations to tackle complex environmental problems. It is based on advanced physical models and engineering approaches designed to describe and observe the connections between different components of the Earth system.

We will be using the Great Barrier Reef as our study case and we will be evaluating past, present and future environmental changes across the region and its potential impact using the eReefs Hydrodynamic and BioGeoChemical models.

What is eReefs?

The eReefs research project is a collaboration between the Great Barrier Reef Foundation, CSIRO, the Australian Institute of Marine Science, Bureau of Meteorology, and Queensland Government.

It gives a detailed picture of what is currently happening on the reef and what will likely happen in the future.

Modelling system complexity

eReefs modelling framework spans the catchments, estuaries, reef lagoon and the open ocean. It provides information on physical processes, sediment transport, biogeochemistry and ocean colour. The project addresses enhanced monitoring, data standards, data architecture, operational modelling, reporting and data visualisation.

Importance of Coral reefs

Coral reefs are important for many different reasons aside from containing the most diverse ecosystems on the planet. They:

  • protect coastlines from the damaging effects of wave action and tropical storms

  • provide habitats and shelter for many marine organisms

  • are the source of nitrogen and other essential nutrients for marine food chains

  • assist in carbon and nitrogen fixing

  • help with nutrient recycling.

This is why large numbers of marine species live in reefs. Other reasons why they are so important include:

  • The fishing industry depends on coral reefs because many fish spawn there and juvenile fish spend time there before making their way to the open sea

  • The Great Barrier Reef generates more than1.5 billion dollars every year for the Australian economy, from fishing and tourism

  • The study of coral reefs is important for providing a clear, scientifically-testable record of climatic events over the past million years or so. This includes records of recent major storms and human impacts that are recorded by the changes in coral growth patterns.1

from IPython.display import Audio,Image, YouTubeVideo

Learning outcomes

This class aims at teaching modern programming techniques for (envi-)scientists. After completing the class, attendees will become familiar with a modern and open-source programming language (Python) and will be able to read and write python programs of medium complexity. They will be able to take advantage of existing scientific packages and libraries available in the rich scientific Python ecosystem in order to query and analyse complex environmental dataset.

The targeted audience for this lecture are students at the master level with some previous experience in programming. No prior knowledge of Python is required, but I’ll assume that you are familiar with a similar language (Matlab, IDL, R…) and basic programming structures (loops, functions, conditional blocks…). This is not an introductory course, although we will shortly revisit programming basics in order to learn the python syntax.

The course encompasses the following topics, developed by means of concrete examples and practicals:

  • Introduction to Python for data-science: packages, modules, functions, scripts

  • Real world applications!


My main objective for this course is to get you prepared to learn independently about the more advanced tools you’ll need for the rest of your studies and professional life.

How to use these notes

These notes are written as a companion to the lectures. During class, I will go through the major concepts and techniques for querying, analysing environmental datasets available from observing systems and models, and you can use these notes for independent learning. As a result most of the lectures and practicals will revolve around hands-on exercises and applications.

They are actualised on the go, as this course advances. I am trying to write them in such a way that they are understandable without actually attending the course, but I strongly recommend to participate to both the lectures and the practicals.

The notes are a mix of examples and small exercises for you to try. They are written in Jupyter Notebooks. If you want to run the lecture’s code yourself, you can:

  • run the notebooks online in an interactive window, by clicking on the “Launch Binder” button on the top-right of this page (see).

  • download the jupyter notebooks from the course’s repository and run them on your computer (recommended after you have become more familiar with Jupyter Notebooks2 - see).


The unit will be graded based on three assessments:

  • a mid-term group presentation in which you will frame your project and research questions: 10%

  • an end-term group project evaluate as a team submission: 60%

  • an oral presentation at the end of the semester: 30%

A positive evaluation of each of these elements is mandatory to pass the class!

The oral presentation itself will be graded as a group work (50%) and individual contribution (50%).

Each first 6 weeks there will be series of hand’s on exercises and practicals. These can be worked through alone or in groups. During the following 6 weeks, I will ask one volunteer group to present their results to the rest of the class on the following week.

Getting help

Seeking for information online is necessary and helpful for programmers of any level. I would even argue that the best programmers are the ones who know how to efficiently find information online.

When encountering an issue, the first question you should ask yourself is: “am I the only person likely to be affected by this problem?”. The answer will be no in 99% of the cases. For these, here is a list of recommendations:

  • Stack Overflow is THE place for programming questions. Thanks to community based moderation rules, the good questions are more visible than bad ones, and good answers are rewarded. Take a tour of the site’s principles, and look for similar questions before asking your own one.

  • Learn to ask the right question to your search engine. Naming this the correct way (semantics) is one of the objectives of this lecture, and I hope that in the end you will not only write better code, you will also speak the programming language a little better.

If every other thing fails (i.e the remaining 1% of the cases), then:

  • Ask a friend

  • Ask your professor

  • Ask a question on Stack Overflow. Before doing so, read what a Minimal, Complete, and Verifiable Example is and try to stick to these recommendations.

  • If you think you discovered a bug, than report it to the library directly. Almost all the scientific python packages are hosted on GitHub: the “issues” tab is where to report bugs. Read the excellent Craft Minimal Bug Reports article from Matt Rocklin before doing so.



Why the Great Barrier Reef is dying and why we should care?


Jupyter Notebooks are great and I use them everyday, but they can be a bit confusing for beginners.