This repo contains labs, homework assignments and a couple of notebook-based lectures for the Spring 2017 ASTR 200 ("Practical Astronomy") course at Amherst College. Please contact Kate Follette at [email protected] with any questions.
These materials may be reproduced for educational purposes only. Many of the contents were adapted from publicly-available Python course materials developed by other instructors, in which case there are links at the top of the lab notebooks pointing to the original materials.
Contents of the Labs are as follows (also in labcontents.txt in Lab folder):
- Jupyter
- Jupyter Intro
- Jupyter cautions
- Using Jupyter as a calculator
- Variables
- Arrays
- Defining arrays
- Array manipulation
- Multidimensional arrays
- Array attributes
- Python Functions
- Basic functions
- Modules and importing
- Optional and default arguments
- Conditional Statements and Control Flow
- The if statement and comparison operators
- Iteration
- Exception handling
- The Astropy Units Package
- Basic Units
- Composite Units
- Quantity Objects
- Pysical Constants
- Sidebar - Attributes
- Quantity Attributes
- Combining Quantities
- Converting Units
- Decomposing Units
- Integration with Numpy ufuncs
- Known issues
- Defining new units
- Typesetting with LaTeX
- Equations
- Special Symbols
- Superscripts and Subscripts
- Fractions
- Other Math Symbols
- User-specified Input
- More about manipulating strings
- Special Characters
- Concatenating Strings
- Multiple Concatenations
- Comparing Strings
- More about conditionals
- One-line Conditionals
- While and Iteration
- Break Statements
- Writing and Reading Files with Magic Commands
- Python Return Statements
- Functions Without Returns
- Return Statements as Code Breaks
- Return Statements for Assigned Output
- Basic Python Plotting
- Tuples
- Defining Tuples
- Indexing Tuples
- Tuple Modification
- Lists
- Defining Lists
- Indexing Lists
- Extending and Appending Lists
- Searching, Sorting and Counting Lists
- Exploring List Methods
- Iterating over lists
- The range function
- Creating lists on the fly
- Sets
- Dictionaries
- Defining Disctionaries
- Dictionary Keys
- Astropy Tables
- Constructing Tables
- Displaying Tables in Notebook
- Indexing Tables
- Modifying Tables
- Converting Tables to Numpy
- Masking Tables
- High-level Table Operations
- Reading and Writing Tabular Data
- Pandas
- Plotting 2D Data
- Generating 2D data
- Contour plots
- Raster, or "heatmap", plots
- Multipanel Plots
- Background Information
- Intro to the Second Half of the Class
- Intro to Dataset 1: The Quantitative Reasoning for College Science Assessment
- Investigating Tabular Data with Pandas
- Reading in and Cleaning Data
- The
describe()
Method - Computing Descriptive Statistics
- Creating Statistical Graphics
- Selecting a Subset of Data
- Testing Differences Between Datasets
- Computing Confidence Intervals
- Visualizing Differences with Overlapping Plots
- Data Investigation 1 - Week 2 Instructions
- Introduction to the Exoplanet Database
- Adding a Third Dimension to Scatterplots
- Computing Correlation Coefficients
- Data Investigation 2 - Week 2 Instructions
- Introduction to the Variable Star Database
- Exercises
- Data Investigation 3 - Week 2 Instructions