Introduction to scientific programming with python. Basic data types, sequences, input/output, and program control flow structures. Evaluation and plotting of mathematical functions and data. Statistical interpretation of data, and fitting of data to models. Introduction to numerical methods including integration, solutions of ordinary differential equations, and linear algebra. Extensive use of the numpy, matplotlib, and scipy packages.
In this class we will also introduce git to submit the labs and final coding project.
We used to recommend installing anaconda python from Anaconda. but this year we are switching to JupyterLab Desktop. This is a separate app that looks like running jupyter in a browser, but is not using your browwser. It also comes with python embedded, so there is no more need to install python separately.
Installation will outlines in Homework1 in your ELMS page.
Interactive inside a browser or this year (in 2025) the new JupyterLab Desktop See https://github.com/jupyterlab/jupyterlab-desktop.
a nice figure will go here
Interactive in a special GUI, much like MATLAB. Comes with anaconda3. See https://www.spyder-ide.org/
a nice figure will go here
Google colab is another way, using Google's cloud services, to work with jupyter notebooks. See https://colab.research.google.com
a nice figure will go here
Install jupytext:
pip install jupytext
Conversion between a notebook (.ipynb) file to a spyder (.py) file:
jupytext --to ipynb test.py
jupytext --to py test.ipynb
Here are some places to find Open Source codes in Physics and Astronomy
-
Astrophysics Source Code Library (ASCL) : https://ascl.net
-
Journal for Open Source Software (JOSS): https://joss.theoj.org/
-
Zenodo : https://zenodo.org/
Also some self-guided and OS agnostic lessons on:
- Unix shell (even on Windows) : https://swcarpentry.github.io/shell-novice/
- Python : https://swcarpentry.github.io/python-novice-inflammation/
- Git : https://swcarpentry.github.io/git-novice/
The spyder tool we are using has excellent help on python: both syntax and API. But if you want something in parallel:
- Zeal (for Linux)
- Dash (for Mac) - free alternatives are: dasht and devbook
- XXX (for Windows)