Next: XAssist: A System for the Automation of X-ray Astrophysics Analysis
Up: Data Analysis Software and Systems
Previous: Synchronous Observations by Ground Based Optical and X-ray Space Born Telescopes
Table of Contents - Subject Index - Author Index - Search - PS reprint - PDF reprint

Zhang, A., Good, J. C., & Berriman, G. B. 2003, in ASP Conf. Ser., Vol. 295 Astronomical Data Analysis Software and Systems XII, eds. H. E. Payne, R. I. Jedrzejewski, & R. N. Hook (San Francisco: ASP), 461

An Interactive Java Plotting Package for Astronomy

A. Zhang, J. C. Good, G. B. Berriman
Infrared Processing and Analysis Center, California Institute of Technology, Pasadena, CA 91125


This paper describes the architecture and functionality of a general purpose two dimensional plotting package for astronomy--QtPlot. It is a modification of an Open Source Java Plotting package, PtPlot, made available by the Ptolemy project at the University of California. QtPlot supports ASCII and XML format. It is in operation at the Infrared Science Archive (IRSA) of the California Institute of Technology, and supports mission services and a key astronomical data fusion toolkit--OASIS.

1. Introduction

The NASA/IPAC Infrared Science Archive (IRSA) has been developing a Java two dimensional plotting package for astronomy. The aim of the project was to develop at modest cost a general package that could be deployed as an applet through the IRSA web page. The package is based on PtPlot, an open source interactive plotting package released by the Ptolemy project at the University of California. This project studies modeling, simulation, and design of concurrent, real-time, embedded systems; see the Ptolemy II Ptplot page. PtPlot is a Java application that supports ASCII, binary and basic eXtended Markup Language (XML) formats, and remote and local file access.

IRSA has extended and adapted PtPlot to provide a rich suite of user-controlled functions for modifying the appearance and attributes of plots, such as symbol, color, plot boundaries, data limits, plot annotations, etc. It supports interactive conversion between logarithmic and linear scales, as well as reversal of axes. This modified package, QtPlot, supports column delimited ASCII format tables (the so-called IPAC table format), but of greater importance is the fact that it supports XML structured for astronomical plot directives, underpinned by the eXtensible Data Format(XDF), a container for transporting scientific data. The XML support also supports plotting by reference to a path to a data file.

QtPlot has been deployed operationally as an applet at IRSA, where it supports interactive plotting of spectra from the Submillimeter Wave Astronomical Satellite (SWAS), and light curves from the American Association of Variable Star Observers (AAVSO). It has also been integrated into the On-Line Archive Science Information Service (OASIS), IRSA's primary data fusion toolkit, for general two dimensional plotting support (e.g., plotting two columns of a table retrieved from a database). It can access local files or remote files, through HTTP protocols, and can be directly called by a web application.

2. Overview of the Functionality in QtPlot

The QtPlot package contains classes, applets, and applications for two dimensional graphical display of data. It can be used as an independent Java package, or it can be called by another Java package which manages passing arguments, controls input parameters, and handles opening or closing plots on the screen. Furthermore, QtPlot can graphically display data on web pages when deployed as a plug-in.

While the plot symbol and color can be changed by clicking on the plot legend, users generally interact with the tool largely through menu-driven control panels, which provide control over the plot appearance and attributes, such as plot labels, plotting ranges, plot symbol and so on. Two of these menu-driven features are of special interest: (1) control of the plot type: linear, logarithmic, or histogram; (2) enable overplotting of additional data, such as additional spectra or light curves.

3. Data Format

Broadly speaking, QtPlot supports two formats: column delimited ASCII tables (IPAC table format), and XML. The IPAC table format is used throughout IRSA to return ASCII data to users and to allow users to upload data files to cross-compare them with IRSA's catalogs. Consequently, QtPlot naturally supports this format.

Of wider interest is XML support. QtPlot utilizes the XDF, which supports transport of multiple n-dimensional tables and file attributes through references in the XML specification. The following is an example of the XML file that describes the display of the brown dwarf 2MASSI J0028394+150141 from Dr. Davy Kirkpatrick's Archive of L Dwarfs.

Figure 1: Rendering of the Spectrum of 2MASSI J0028394+150141; the plot interprets the directives given in the XML.

<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
    <XYPlot name="2MASSI J0028394+150141">
         <title> 2MASSI J0028394+150141 (L4.5 V) </title>
            <scaling> linear </scaling>
            <min>     6300   </min>
            <max>     10200  </max>
            <label>   Wavelength (Angstroms) </label>
            <scaling> linear </scaling>
            <min>     -0.1   </min>
            <max>     4.5    </max>
            <label> Normalized Flux F_lambda (ergs/cm^2) s A) 
      <pointset name="spectrum">
            <type>    XDF    </type>
            <table>   0028p1501_ascii </table>
            <xcolumn> wave   </xcolumn>
            <ycolumn> flux   </ycolumn>
            <color>  black   </color>
            <symbol> none    </symbol>
            <size>   1%      </size>
            <color>  black   </color>
            <style>  solid   </style>
   <XDF name="0028p1501\underline{ }ascii">
      <array name="data table">
         <axis axisId="columns" axisDatatype="real">
            <valueList size="2"/>
         <fieldAxis axisId="rows">
            <field name="wave" >
                  <fixed width="17" precision="11"/>
            <field name="flux" >
               <units><unit>ergs/cm^2) s A</unit></units>
                  <fixed width="11" precision="8">

             6361.90087890625    0.27137709
	     10158.09863281250    1.38749599

4. Conclusions and Future Work

This paper has presented an overview of QtPlot, a general astronomical plotting package that leverages the Open Source application QtPlot. The major upgrade that will be made in an upcoming release will be to support larger data files by swapping data disk rather than loading all the data into memory, as is currently done.


We are grateful to the Ptolemy project for distribution of the PtPlot package.

© Copyright 2003 Astronomical Society of the Pacific, 390 Ashton Avenue, San Francisco, California 94112, USA
Next: XAssist: A System for the Automation of X-ray Astrophysics Analysis
Up: Data Analysis Software and Systems
Previous: Synchronous Observations by Ground Based Optical and X-ray Space Born Telescopes
Table of Contents - Subject Index - Author Index - Search - PS reprint - PDF reprint