About StarMap

[ Back to the map ]

How it works

I obtained the HYG Database compiled by David Nash for the star data. From his site:

The database is a subset of the data in three major catalogs: the Hipparcos Catalog,the Yale Bright Star Catalog (5th Edition), and the Gliese Catalog of Nearby Stars (3rd Edition). Each of these catalogs contains information useful to amateur astronomers:

The name of the database comes from the three catalogs comprising its data: Hipparcos, Yale, and Gliese.

This database contains all known stars that are either within 50 parsecs (160 light years) of the Sun or brighter than magnitude +9.0 (87476 stars).

I then imported this comma-separated database into a MySQL table using LOAD DATA LOCAL INFILE 'hygfull.csv' INTO TABLE tblHYG FIELDS TERMINATED BY ','. Then I wrote a small Perl script to convert the equatorial coordinates and distance data into Galactic coordinates using the formulas at Winchell Chung's Project Rho site, and then insert those into a second table.

Finally, I created a third table to store the fictional Star Trek names for selected stars. For some stars, this was easy. Vulcan, for example, is agreed to be in the 40 Eridani star system. Others, like Romulus, have not been explicitly matched to a real star. In these cases, I set the Z zoom to a large number (to include stars within a wide range of Z coordinates) and looked for a star very close to the position plotted in Geoffrey Mandel's Star Charts. With Romulus and Romii, I was lucky; there are two stars right where they are supposed to be.

Thanks to Jörg for identifying nearly 100 (the majority) of the Trek stars I have in the database.

Coordinate system

Two sets of coordinates are stored for each star in the database. The equatorial (2000.0) coordinates, which you can view by selecting a star, and the Galactic Cartesian coordinates. The equatorial coordinates determine the two-dimensional location of a star in the sky. Select Romulus, for example, and find its location in a star atlas, and you will see that it is a dim star in the constellation Virgo. You'll need binoculars or a telescope to actually see it.

The Galactic coordinates place the star in three-dimensional space. (0,0,0) is our Sun's coordinates. The X axis points toward the Galactic center, about 25,000 light years away or (25000,0,0). The Y axis points toward 90 degrees Galactic longitude, in the direction of the constellation Cygnus. And the Z axis points "up" out of the Galactic plane, toward Coma Berenices.

This might be a little confusing, since I have oriented the maps so that the positive X axis is "up" on the screen, and the positive Y axis is left. This is just because I'm used to seeing galactic star maps with this orientation, and this is how the maps are displayed in the book Star Charts. Just keep this in mind. The Z axis points out of the screen toward you.

Selecting stars

You can choose a specific star from the drop-down menu at the top of the screen. It will list only the stars visible on the current map. After selecting a star, it will have a blue box around it on the map and details will be displayed below the map. If you check the "center on selection" box, the map will also be moved so that the selected star is in the middle.

Source code

Source code and database dumps are now available for download here! To import the dump into a MySQL database, use the following commands:
tar xvf stardata.tar.gz
mysql -p stars < stars-alldata.sql

There is a second dump included (stars-tableonly.sql) that only contains the database structure, with no data, in case you want to try importing the CSV file yourself as described above.


Creative Commons License

This work is licensed under a Creative Commons License. In general, you're free to use this program for any personal use, so long as proper credit is given for the program and database when it's used in a derivative work (e.g., your own Web site, or a program that uses the database), and you get my permission before including the program in any commercial product or service.

David Nash compiled the original database that this program uses.

About the author

Jed Whitten is a programmer/web developer for UC Davis. You can email him at jed@whitten.org.