This lesson is in the early stages of development (Alpha version)

Python for Atmosphere and Ocean Scientists: Setup

Data

In preparation for these lessons, you will need to download the following two Python scripts and four netCDF files and place them in a new folder/directory:

  1. Make a new folder in your Desktop called data-carpentry.
  2. Download script_template.py and plot_precipitation_climatology.py and move them into that folder.
  3. Make a new folder in your data_carpentry folder called data. Download the following files and place them in that folder:

Software installation

In order to complete the lessons, you will need access to the following:

If you don’t already have these installed, please follow The Carpentries software installation instructions. You do not need to install R, SQL or any of the additional software listed at that site.

Troubeshooting

If you have any trouble with software installation, The Carpentries maintain a list of common issues on their Configuration Problems and Solutions wiki page.

Depending on time and wifi constraints, your workshop instructor may also ask that you install the python packages introduced in the first lesson ahead of time. You can do this via the command line or by using the Anaconda Navigator:

Installation of python packages: via the command line

(Windows users may need to open the Anaconda Prompt program and run conda init bash to make conda available at the Bash Shell.)

The first step is to add the conda-forge channel:

$ conda config --add channels conda-forge

You can then install the packages in the base conda environment (recommended if you’re new to using Anaconda):

$ conda install jupyter xarray netCDF4 cartopy cmocean cmdline_provenance

OR you can create a new environment called pyaos-lesson and install the packages there:

$ conda create -n pyaos-lesson jupyter xarray netCDF4 cartopy cmocean cmdline_provenance

You can activate this new environment as follows:

$ conda activate pyaos-lesson

(Or source activate pyaos-lesson if that doesn’t work.)

Type conda deactivate to exit that environment.

Installation of python packages: via the Anaconda Navigator

Once you’ve opened the Anaconda Navigator program (which can be found at the Windows start menu), head to the “Environments” tab.

You can install the packages into the “base” environment (recommended if you’re new to Anaconda) OR create a new environment called pyaos-lesson by clicking the “create” button at the bottom of the environment list before doing the following:

Step 1: Add the conda-forge channel. Anaconda Navigator add conda-forge

Step 2: Install the jupyter, xarray, netCDF4, cartopy, cmocean and cmdline_provenance packages one-by-one (click “apply” to install once selected) Anaconda Navigator install xarray

Software check

To check that everything is installed correctly, follow the instructions below.

Bash Shell

Git

Anaconda