This is the second of three Lessons from the course Programming for Astronomy and Astrophysics. This Lesson follows on from Lesson 1: Basic Python and covers more advanced topics such as programming style, errors and debugging, defensive programming (preventing errors) and how to check and optimize the speed of your programs. We will also look in-depth at at Numpy arrays and using Numpy and Scipy functions. We will end by looking at some of the Astropy sub-packages for working with astronomical calculations and data.
Prerequisites
You need to understand the concepts of files and directories and how to start a Python interpreter before tackling this lesson. This lesson sometimes references Jupyter Notebook although in practice you can use any Python interpreter (for iPython ` ‘magic commands’ you will need to use a Notebook or a suitable interpreter such as iPython).
The commands in this lesson pertain to Python 3.
Getting Started
To get started, follow the directions on the “Setup” page to download data and install a Python interpreter.