A Brief Introduction to TOPCAT

  • Link to TOPCAT

    Getting ready for TOPCAT

    TOPCAT is a JAVA utility developed under the auspices of the international "Virtual Observatory" concept which enables the manipulation, display and analysis of datasets, specifically astronomical ones. Please refer to the above link for detailed information and downloading instructions. Note that TOPCAT can be installed on Windows, MacOS and Linux platoforms that are also Java-enabled.

    Here, I assume that you have already installed TOPCAT successfully.

    Getting datasets ready for TOPCAT

    Under normal circumstances, I generate files in "CSV" format --- "Comma Separated Variables" --- because that format is simple, well-defined and platform-independent. It is definitely the preferred format. However, it seems that Internet Explorer, which some of you may use as your browser, corrupts the pristine format of these files when it downloads them (totally defeating the whole purpose of having machine-independent files). So, unfortunately, there are different instructions depending on the browser you use.

    A simple example of using TOPCAT

    Below are links to two files containing the different versions (CSV and ASVII) of a catalog of 38,000 stars with measured apparent magnitudes at both B and V band, parallaxes and radial velocities from the Hipparcos satellite catalog which I downloaded from Eric Mamajek's page at URochester. We can use these to make a simple color-magnitude diagram.

  •   CSV Version
  •   ASCII Version

    Download the file following the instructions above. Be sure you know in what directory it is located. Now, let's make the plot shown on the right.

  •   Start TOPCAT. On Windows machines, that means clicking on the file "topcat-full" in the directory where you have downloaded the executable jar file of that name. The TOPCAT window will appear.

  •   Click on "File" (upper left) and then "Load Table". A new "Load New Table" window will appear. Choose the appropriate "Format", either "CSV" or "ASCII"..

  •   Click on "System browser". Find the star data file you download. Click on it so that its name appears under "File name" at the bottom of the "Load Table" menu. On Windows machines, be sure that the bottom file type says "All Files". Click on "Open" and the file should load. It might take some seconds. The file name should appear in the "Table List"..

  •   Left click on "Views" and then "Column Info". A new window will open which lists the Names of each column in the table. Notice what they are.

  •   Back in the main menu, left click on "Graphics" and then on "Plot". A new window will appear. By default, it has plotted column 1 ("StarID") on the X axis and column 2 ("Hip") on the Y axis. What we want however is to plot "BminusV" on the X axis and "AbsMag" on the Y axis. Left click on the downward arrow next to "StarID" and select "BminusV"; then do the same for "AbsMag". This plot should appear.

    Notice that it bears some resemblance to the plot we wanted to make (shown above on the right), but (a) the data points appear are denoted by red symbols not black ones, (b) it seems to have the Y axis scale flipped and (c) the range of X and Y values is not the same. We need to fix those things.

  •   As we will learn, astronomers measure the brightnesses of objects using a system of "magnitudes" that is inverse, that is a larger magnitude means a fainter object. So for our plot, we want to flip the Y axis of the plot. Simple click on the small box next to "Flip" on the row for the Y axis. That looks better!

  •   Next, let's change the color of the data point symbols. On the right, under "Row subsets", there is a small box with a red dot in its center. Click on the red dot. A new "Plot Style Editor" window appears. Left click on the down arrow to the right of the red "Colour" bar. Scroll down and select the black bar. The color of the points will change! You can dismiss this window by clicking on "ok".

  •   To finish the job, we need to reset the range of the X and Y values. At the top of the "Scatter Plot" window, left click on "Plot" and then on "Configure Axes and Title". A new "Axis Configuration" window will appear. You can now give the plot a Title (for example, "Hipparcos Color-Magnitude Diagram") and set the ranges. In this case, set X range from -0.5 to 2.5 and the Y range to -6 to 16 and then click "Apply"; the plot will rescale.

    Notice that some of the points disappear because they lie outside the specified ranges. We'll talk about that later....

  •   As one final step in this example, let's save the plot by exporting a copy to your machine's disk. At the top of the "Scatter Plot" window, left click on "Export" and then "Export as gif" (or other format if you want). A window will open which allows you to specify the file name and directory where it will be saved. When you have specified them, click on "Write gif" and you should now have a copy of the plot you have made. When you open the file, select your browser (or other image display utility) when asked for what program to open it with.

    TOPCAT has many more features, so I invite you to explore its capabilities further. Lots of astronomers use TOPCAT, so you are now in good company!

    Last modified: Wed Jan 7 08:50:12 EST 2015 by martha