Intro to Physical Oceanography
This repository contains course materials for EESC4925. The lecture notes are in the form of interactive Jupyter Notebooks.
View the lecture notes online
The links below will render the notebooks via the nbviewer service, which allows some of the fancy interactive graphics to be viewed online. If you browse directly to the notebooks on github, they may not show up properly. So please use these links.
- 1: Ocean Bathymetry
- 2: Physical Properties of Seawater
- 3: Air-Sea Interaction
- 4: Advection, Diffusion, and Continuity
- Equations of motion
- Hydrostatic and Geostrophic Balance
- Ekman Transport and Pumping
- Vorticity and Sverdrup Balance
- Theory of deep ocean circulation
Run the lecture notes interactively
The best way to get the materials (including homework) is the use git to clone this repository. If you don't have git already on you computer, it is easy to install on all platforms following these instructions.
From the command line, run the command
git clone https://github.com/rabernat/intro_to_physical_oceanography
If you are not a fan of the command line, there are plent of graphical interfaces to git available.
Once you have the repository cloned, you can update it as new lectures come out by running
git pull origin master
If for some reason you can't get git working, the alternative is to use the link to the right to "Download Zip". The disadvantage here is that you will have to re-download every time the repo is updated.
In order to actually execute the code in the notebooks, you need to have the necessary python packages installed. The recommended way to do this is to install the anaconda python distribution together with the conda package management utility. For more depth, you can read my detailed intstructions for installing python.
This repository includes an environment file which you can use to set up your python environment. To install this environment, type the following
cd intro_to_physical_oceanography conda env create -f phys_ocean_env.yml
This will create a new environment called
phys_ocean. To activate this environment, type
source activate phys_ocean
The notebooks can be viewed and run using the jupyter notebook application. To launch the notebook interface, just type
When you are done working with the notebooks, close the notebook app and, if you wish, deactive the environment by typing
A great deal has been written on this subject. My reasons are summarized as follows.
Python is open source. Open source means that the source code is available freely to the public and can be examined, modified, and improved. The alternative to open source is closed, proprietary. Proprietary tools, such as MATLAB, are ultimately controlled by corporations, and those corporations decide what features they will include. I consider software tools as a central part of scientific research---if we want to have transparent, reproducible, scientific results, we should be using open source tools. Nature agrees with me.
Python is free. It does not cost money to use python. If your scientific code is written in MATLAB, it can only be run by others with access to MATLAB. That means people outside the university world (e.g. high school students), in economically disadvantaged communities, or in developing countries will be unable to reproduce and build on your results.
Python is easy to read. This may seem like a superficial point, but it is crucial for effective sharing of code. Even if you are the only one reading your code, python is easy on the eyes.
Python has a great library. The scipy ecosystem provides the tools to do almost anything you can imagine.
Python is constantly evolving. If you find something you can't do with python, chances are someone is working on it. The world is changing: data is exploding, computers architecture is evolving, and new forms of analysis and visualization are being invented. Python is evolving too, and it evolves based on what the community needs. The new tool I am most excited about is xray.
Python is at home on the web. The Jupyter project grew out of the python community and is revolutionizing the way we do science and communicate it with others. With Jupyter, I never have to leave my browser. Nature agrees that this is the future of scientific communication.