Tutorial | Easy
Python Bootcamp: Day 1
We all have to start somewhere! Start with this bootcamp if you've never used Python before, and want a crash-course ride through the basics.
We all have to start somewhere! Start with this bootcamp if you've never used Python before, and want a crash-course ride through the basics.
A continuation of the Day 1 Bootcamp, here we use some of the concepts covered before and begin digging into Python as a language. You'll need to download this dataset.
A basic task in astronomy is wavelength calibration -- and a basic coding practice is writing the for-loop, while-loop, and conditional statements. Let's practice! You'll need this dataset.
MUCH has been said on this topic; in fact, it can get (surprisingly) mind-bogglingly advanced. But for now, let's focus on the basics: How does one fit a line (or any polynomial) to some data in Python? And how do we know if our "fit" is any good? You'll need this dataset.
I/O (input/output) refers to the task of getting data (in its various stored means) into our code to do analysis with. Here, we'll be reading in several catalogs from SDSS and combining them to learn something about galaxy scaling relations! Here's The SDSS DR7 Catalog.
MCMC is a powerful tool for many aspects of astronomy. In this tutorial, we'll cover when one might want to use an MCMC, and then setup and run one on some historical ice core data to fit the Earth's Milankovich Cycles! Here's the Ice Core Data File.
In this tutorial, I cover the classic N-body orbit integration problem in detail, showing you how to use classes and a 4th order integrator.
In Part 2, we adjust our RK4 orbital N-body integrator from last tutorial to integrate particles in potentials as well.
In this tutorial we learn some of the statistics underlying MCMC and then write our own sampler using classes!
The easiest way to start plotting things in Python (plt.plot) is just not good enough to make real research grade plots. Here, I'll talk about the first steps you'll want to take in controlling every detail of your figures.
Python is inherently an "object-oriented" language -- often, we don't have to write our codes that way, but it can actually make things better sometimes! Here, I'll attempt to explain why classes are useful, via the example of a data reduction pipeline.
What does all that mean?
You are always free to download, keep, and reference any of the materials posted here for your own personal use.
You are free to modify and/or use any aspect of these materials in your own teaching, as long as you cite this website as a source -- I even have a DOI to make it handy (see below)! You are not allowed to use re-mixed or re-purposed versions of these materials for any commerical purpose. If you make modified versions of these materials available for free, you must do so under the this license.
Feel free to share the textbook / materials with anyone who'd find them useful! I recommend sharing links rather than downloaded versions, as I update things regularly. You are not allowed to sell or otherwise use these materials for any commercial purpose, even with attribution.