Friday, December 31, 2010

Fun with the Bright Star Catalog


In addition to teaching introductory physics courses (both conceptual and technical), I have the privilege of teaching conceptual astronomy. One of the topics that arises early in the course is the Celestial Sphere, which provides a simple framework for describing the motions of objects through the heavens.  In order to represent the heavens somewhat accurately, I needed a source of data describing the positions of the stars.  The Bright Star Catalog (BSC) came to my rescue!

The BSC is essentially a directory listing of the visible stars in our sky.  It can be found on the internet in a number of places, such as the Smithsonian Astrophysical Observatory Telescope Data Center and the Centre de DonnĂ©es astronomiques de Strasbourg.

There is quite a bit of information for each star in the BSC, most importantly each star's coordinates (right ascension and declination), visual magnitude (apparent brightness) and parallax angle (a measure of distance).  The BSC data file has some handy documentation which describes how the ASCII data file is set up.  With the help of a quick and dirty spreadsheet and some text file editing, the desired subset of data was converted  into something more easily digested by POV-Ray. For convenience, the final data file was sorted by the visual magnitude of the stars, to make it easier to plot only the brightest of stars.

I also wanted to include constellation lines in the visual depiction of the sky.  After a bit of internet sleuthing I found Starchart, an open source sky charting program, which also used the BSC and had a similar data file for constellations.  A little spreadsheet magic and final editing yielded a constellation data file for use with the BSC.

POV-Ray uses its own scene description language in which objects are easily described via geometric primitives and Constructive Solid Geometry.   In my animations, I simply place a sphere at a set distance from the center of the scene (or a distance inversely scaled by the star's parallax angle) at a location determined by the star's right ascension and declination.  The size and brightness of the sphere is determined by the star's apparent magnitude.  Constellation lines are created by placing cylinders which go from specified point to specified point on the celestial sphere, as determined from Starchart's constellation data file. The complete set of source files for the image at the top of this page can be found in this zip file.

On of the first animations I made using this data was a portrayal of the Celestial Sphere, illustrating how the rotation of this imaginary sphere gave a mechanical description of the apparent daily motion of the objects in the heavens:

To reinforce the observational evidence at the time of Galileo against a heliocentric cosmos, I created an animation to show how the constellations would distort over the course of a year if the Earth actually moved:



Of course we now know that the choices faced at the time was that either the Earth does not move or the stars are very, very far away compared to the Earth-Sun distance.  The second case is what we actually have, which makes the measurement of any apparent shift in the position of stars impossible without a very good telescope.

Using the parallax data in the BSC, I created an animation the shows (with great exaggeration) the shift in the positions of stars due to Earth's motion: 

The BSC data was also used in an animation which illustrated how the apparent daily motion of the stars was created by the rotation of the earth:

Stellar backgrounds were required for animations on the Horizon System:

the Equatorial System:

and the reasons for the seasons:

In a similar project, I've also managed to use data on the asteroids in our solar system to create a 3-D map of the asteroid locations: 

but I should note there are several more detailed animated maps on szyzyg's youtube channel.

While many of these visual demonstrations can be done with wonderful programs such as Stellarium, Celestia and others, I've found it easier in a live classroom setting to have a canned animation for many situations to eliminate some of the set up and configuration (not to mention IST administration requests) of additional programs.

Tuesday, January 15, 2008

Getting Started With POV-Ray

All the animations that I've developed have been created with the 3-D ray tracing program POV-Ray.

One of the best ways to learn about using POV-Ray is the documentation that comes along with the program. That documentation is also available online and in particular there is an excellent section on getting started.

Friedrich A. Lohmueller has a wonderful selection of descriptions, samples and examples for POV-Ray. In particular, his animation tutorial will certainly help the beginner get started.

Mike Williams has a number of galleries and tutorials. I continually refer to his Isosurface Tutorial when working with isosurfaces or using functions as texture maps.

Christoph Hormann has useful examples, tutorials, tools and include files relating to ray tracing in general, POV-Ray in particular as well as POV-Ray's unofficial enhancement, MegaPOV.

Finally, a sample POV-Ray file for a very simple animation to illustrate the essentials for creating a simple animation. Below is the source for the file simple.pov:
#include "colors.inc"    //this lets us use common color names
#include "finish.inc" //use some generic finishes

background{Gray} // set the color of the background

camera {
location <0,> //location in POV-Ray vector notation
look_at <0,0,0> //where the camera is pointed
}

light_source {
<-20, 40, -20> // light's position
color rgb <1,1,1> // light's color specified as a rgb "vector"
}

//hang a pendulum from the origin
union{ // it is a combo object, CSG fun

cylinder{<0,0,0>,<0,-4,0>,.1 // sphere start,end, radius
pigment{Blue}
finish{Shiny}
}

sphere{<0,-4,0>,.5 // sphere center, radius
pigment{Red}
finish{Dull}
}

rotate z*30 // the vertical tilt of the pendulum
rotate y*clock*360 // swing it around in a horizontal circle
// DYNAMIC with clock variable
translate y*2 // lift it back into center of view

}
which is run with the following ini file simple.ini
; POV-Ray animation ini file    ala Lohmueller 
Antialias=on

Antialias_Threshold=0.2

Antialias_Depth=3

Input_File_Name=simple.pov

Initial_Frame=1

Final_Frame=30
Initial_Clock=0

Final_Clock=1
Cyclic_Animation=on

Pause_when_Done=off

and then sewn together using virtualdub to produce this animation:


A simple version of the conical pendulum.

Sunday, January 6, 2008

An Introduction

This blog is an experiment. Actually, an experiment about an experiment. It is an outgrowth of an informal project that grew in response to the encouragement of friends, colleagues and students. I have no idea what the response may be or who might make up my audience, so I'm sure the blog will evolve in response to whatever feedback I get.

This blog is about computer animations, their creation and use in the classroom. It will also cover many technical aspects of the process by which the animations are created, so that even if no one else reads it, I can use it as a technical diary. This blog will also be in part about what I find satisfying about the creative process that goes into making a short animation.

I teach introductory physics and astronomy, and as such I am very aware of the need for visual aids for my students. Since many of the topics are dynamic, it seemed obvious even very early on in my teaching career that dynamic visual aids would be an asset. I few years ago, I discovered a wonder 3D graphics program called POV-Ray, when used with VirtualDub, that opened a whole a wide door to the creation of 3D animations for use in the classroom.

One of the first animations I created dealt with a problem scenario that students faced in mechanics when dealing with circular motion. A diagram in the text is a static figure, and the students would look at the figure and mentally toss out the fact that the object was actually moving in a circle and hence accelerating. The conical pendulum (a mass suspended from a string swung in a horizontal circle) is a great example. To help the students see what was going on, I created the following animation: (original animation here)



In the classroom, I use looping mode when playing the animation so that it cycles over and over. The students can see the dynamics of the scenario while we discuss the physics. I can pause the animation at the particular frame where the animation matches the static diagram from the text.

While the advance in curricular materials may have been incremental for my students, it was revolutionary to me. Over the last few years I've created about 200 short animations on a variety of topics. I have received pretty good reception of the project from friends and colleagues at my local institution as well as regional and national meetings of the AAPT. I also continue to find the creative process itself very satisfying.

I' ll wrap this up here. My next post will be a survey of what I think are the most important and useful tools and tutorials for those similarly inclined to get started.