Repository for EV333 Atmospheric Dynamics at Colorado College.
We will go over all of the instructions below during the first week of class.
Anaconda is a distribution of the Python programming language that simplifies package management. It is very popular for data science. Miniconda is a small version of Anaconda that includes the conda package manager, Python, and a few packages. Conda will help you easily install and manage Python packages and environments.
You will install miniconda and Python on your personal computer for this class. You will need to download the installer for your platform (macOS or Windows). The following steps 2-6 will be the same for both operating systems.
Important note if you have a Mac: You will need to check which processor you have (Intel or Apple M1). To do this, click on the Apple icon in the upper left corner of your screen and go to About this Mac.
- Go to the Miniconda installation webpage: https://docs.conda.io/projects/miniconda/en/latest/
- Click the installer that is approproate for your platform (see image below): Windows (red), macOS Intel (orange), macOS M1 (purple). This will start the download.
- Once downloaded, run the installer. Then follow the prompts to complete the installation. You will need to agree to the license agreement and select the destination for the installation. For the desintation, choose the default path that populates automatically.
For Windows:
4a. When prompted to Select Installation Type select the Just Me (recommended) option.
4b. When prompted to Choose Install Location, use the default location that is provided.
4c. For the Advanced Installation Options, check the boxes in the image below:
- Click Install. The installation may take some time.
- Once the installation is complete click Next and then Finish.
- To verify that conda is installed correctly, open a command prompt and type
conda
. If this command displays output this indicates that your conda installation is complete.
Additional documentation for creating an environment with commands
- Open the terminal (Mac) or command prompt (Windows).
- To create an environment called Atmo_EV333 for this course with a specific version of Python (here Python 3.11) and some of the Python packages you will need for this course, copy and paste the following line:
conda create --name Atmo_EV333 python=3.11 numpy xarray matplotlib cartopy scipy
- When conda asks you to proceed, type
y
:
proceed ([y]/n)?
This creates the Atmo_EV333 environment. The following Python packages are installed: NumPy, Matplotlib, Cartopy, and SciPy.
In the terminal (Mac) or Command Prompt (Windows)
conda activate Atmo_EV333
To check which version of Python you have for this environment:
python --version
You should have Python 3.11.
To view your list of environments:
conda env list
Your system may look something similar to this. An *
indicates the active environment:
# conda environments:
#
base /Users/alawman/miniconda3
Atmo_EV333 * /Users/alawman/miniconda3/envs/Atmo_EV333
We will use Jupyter Notebook for all lab assignments that involve coding. Jupyter Notebook is an open-source application that allows users to create interactive documents that can contain live code, equations, visualizations, and narrative text. Notebooks will contain blocks of text and executable Python code. Notebooks have the file extension .ipynb
.
To install Jupyter Notebook:
- Ensure that you are in your Atmo_EV333 environment (see Step 3 above)
- In the terminal (Mac) or Command Prompt (Windows):
conda install -c conda-forge notebook
- cmocean: color palettes for maps
conda install -c conda-forge cmocean
When asked if you want to proceed, type y
:
proceed ([y]/n)?
- Install NetCDF4
pip install netCDF4
Check that all of the packages were successfully installed:
conda list
-
Create a new folder (directory) for EV333. For example a directory called
EV333_AtmosphericDynamics
in your Documents folder or wherever you store your course materials. -
Navigate to this directory from the command line. You will specify the full path to the directory. The command may look something like this (on a Mac), but the path will be for your personal computer:
cd /Users/alawman/Documents/Python/EV333_AtmosphericDynamics
cd
means change directory. The command pwd
will print your current working directory. The command ls
(MacOS/Linux) or dir
(Windows) will list all the files and directories in the working directory.
-
Download the Notebook
EV333_Test_Required_Packages.ipynb
from this GitHub repository and transfer it to yourEV333_AtmosphericDynamics
directory. -
Navigate to your
EV333_AtmosphericDynamics
directory from the command line. Then launch Jupyter Notebook by entering following in the terminal:
jupyter notebook
This will launch a new tab in your browser.
- Open the Notebook:
EV333_Test_Required_Packages.ipynb
- Run the first cell by clicking the play button. This will check if NumPy, Xarray, Matplotlib, Cartopy SciPy, cmocean, and the NetCDF4 packages are successfully installed. If you receive an
N
for any package, double check that you installed the package in your Atmo_EV333 environment. AY
for everything means you're ready to go!
- Write down the steps and commands you need to launch Jupyter Notebook (additional instructions will be provided in class).
- Shut down Jupyter Notebook
- Quit your terminal (Mac) or command prompt (Windows)
- Download the Lab0 Notebook & data file from GitHub and save them to your
EV333_AtmosphericDynamics
directory. - Launch the Lab0 Jupyter Notebook using only your reference guide. Revise your instructions if needed.