Star Charts and Constellations

Karen Reid - University of Toronto

Who can walk outside on a clear night in the countryside, and not look up at the stars. Identifying constellations is one of the first lessons in astronomy and ties together science and mythology. There are numerous applications that present star maps to help stargazers identify the stars and constellations they look at. In this assignment, students use data from published star catalogs to create a star map picture, and draw constellations on the star map. The shapes of the constellations come from the well-know book by H. A. Rey, The Stars: A New Way to See Them. This was one of my favorite books as a kid, and although I never followed up on my original dream to become an astronomer, I spent many hours learning to find constellations in the northern sky.

In addition to using an attractive domain, this assignment is nifty because students manipulate real data. Students find assignments that use real data compelling, because such assignments allow students to see that they are taking steps toward writing "real" programs. The graphical nature of this assignment is also appealing, and yet the underlying data structures and algorithms involved in creating a star map are simple enough for CS1 students to grasp.

Summary Reading several files with regular structure, building map/dictionary data structure, and using a graphics package to plot a picture
Topics
Reading from files, working with real data, map or dictionary data structures, understanding coordinate systems, basic graphic functions to plot lines and shapes.
Audience
Appropriate for CS1 or a later course.
Difficulty
This is an intermediate assignment, taking 1 or 2 weeks for a CS1 student, assuming they have already seen some of the graphics.
Strengths
The assignment uses real data collected from databases built for and used by astronomers. It is fun because it has great visual appeal.
Weaknesses
This was not originally designed as an OO assignment. The Java version requires a lot more scaffolding than the Python version.
Dependencies
Requires a graphics package that allows students to create a picture and draw boxes and lines. Requires that students can read from files.
Variants
I cleaned up the original data quite substantially to remove missing and duplicate data. Students could be pointed at the original data sources. Students could be asked to develop a user interface to highlight different stars, to plot constellations on demand, or to plot stars of greater than a given magnitude.

Assignment Handout

Our CS1 course is taught using Python and uses a locally modified picture library derived from Mark Guzdial's Introduction to computing and programming with Python: A Multimedia Approach. The assignment handout describes the assignment that our CS1 students were asked to complete. There are lots of possible variations.

The assignment was designed for a Python course, so the assignment handout is specific to Python, but a Java solution is available to instructors on request.

Data collection

The biggest challenge in designing this assignment was finding appropriate data sources. Following is a brief description of the data sources and the steps involved to produce the data given to the students.

The star data comes from the VizieR Catalog Service. I used data from two catalogs: IV/22 K5 - SAO - HD - Common Name Cross Index (Smith 1996), and IV/27 HD-DM-GC-HR-HIP-Bayer-Flamsteed Cross Index (Kostjuk, 2002). The first contained names, while the second contained the Harvard Revised number which was used to identify stars that belonged to the various constellations.

To convert the star positions defined by Right Ascension and Declination into x, y, and z coordinates, I used a command-line tool from the WCSTools package called skycoor.

The constellation data was also drawn from two sources. The stellar data comes from a collection of webpages that describe 88 constellations. The stellar data was used to associate star names with the Harvard Revised number in the original data set. The data that defines the lines that make up a constellation picture were taken from a java applet by Chris Dolan. One of the data files provided with the applet (starname_rey.dat) contains the data to draw the constellations as drawn by H.A.Rey, author of The Stars: A New Way to See Them.


Extra info about this assignment: