%APN3_PROCEEDINGS_FORM%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% TEMPLATE.TEX -- APN3 (2003) ASP Conference Proceedings template.
%
% Derived from ADASS VIII (98) ASP Conference Proceedings template
% Updated by N. Manset for ADASS IX (99), F. Primini for ADASS 2000,
% D.Bohlender for ADASS 2001, and H. Payne for ADASS XII and LaTeX2e.
%
% Use this template to create your proceedings paper in LaTeX format
% by following the instructions given below.  Much of the input will
% be enclosed by braces (i.e., { }).  The percent sign, "%", denotes
% the start of a comment; text after it will be ignored by LaTeX.  
% You might also notice in some of the examples below the use of "\ "
% after a period; this prevents LaTeX from interpreting the period as
% the end of a sentence and putting extra space after it.  
% 
% You should check your paper by processing it with LaTeX.  For
% details about how to run LaTeX as well as how to print out the User
% Guide, consult the README file.  You should also consult the sample
% LaTeX papers, sample1.tex and sample2.tex, for examples of including
% figures, html links, special symbols, and other advanced features.
%
% If you do not have access to the LaTeX software or a laser printer
% at your site, you can still prepare your paper following the
% instructions in the User Guide.  In such cases, the editors will
% process the file and make any necessary editorial adjustments.
% 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 
\documentclass[11pt,twoside]{article}  % Leave intact
\usepackage{adassconf}
\usepackage{graphics}
\usepackage{indentfirst}

% If you have the old LaTeX 2.09, and not the current LaTeX2e, comment
% out the \documentclass and \usepackage lines above and uncomment
% the following:

%\documentstyle[11pt,twoside,adassconf]{article}

\begin{document}   % Leave intact

%-----------------------------------------------------------------------
%			    Paper ID Code
%-----------------------------------------------------------------------
% Enter the proper paper identification code.  The ID code for your
% paper is the session number associated with your presentation as
% published in the official conference proceedings.  You can           
% find this number locating your abstract in the printed proceedings
% that you received at the meeting or on-line at the conference web
% site; the ID code is the letter/number sequence proceeding the title 
% of your presentation. 
%
% This will not appear in your paper; however, it allows different
% papers in the proceedings to cross-reference each other.  Note that
% you should only have one \paperID, and it should not include a
% trailing period.
%
% EXAMPLE: \paperID{O4-1}
% EXAMPLE: \paperID{P7-7}
%

\paperID{P3-12}
%%%% ID=P3-12

%-----------------------------------------------------------------------
%		            Paper Title 
%-----------------------------------------------------------------------
% Enter the title of the paper.
%
% EXAMPLE: \title{A Breakthrough in Astronomical Software Development}
% 
% If your title is so long as to fill the page header when you print it,
% then please supply a short form as a \titlemark.
%
% EXAMPLE: 
%  \title{Rapid Development for Distributed Computing, with Implications
%         for the Virtual Observatory}
%  \titlemark{Rapid Development for Distributed Computing}
%

\title{VO Enabled Mirage and the IVOA Client Package}
%\titlemark{ }

%-----------------------------------------------------------------------
%		          Authors of Paper
%-----------------------------------------------------------------------
% Enter the authors followed by their affiliations.  The \author and
% \affil commands may appear multiple times as necessary (see example
% below).  List each author by giving the first name or initials first
% followed by the last name.  Authors with the same affiliations
% should grouped together. 
%
% EXAMPLE: \author{Raymond Plante, Doug Roberts, 
%                  R.\ M.\ Crutcher\altaffilmark{1}}
%          \affil{National Center for Supercomputing Applications, 
%                 University of Illinois Urbana-Champaign, Urbana, IL
%                 61801}
%          \author{Tom Troland}
%          \affil{University of Kentucky}
%
%          \altaffiltext{1}{Astronomy Department, UIUC}
%
% In this example, the first three authors, "Plante", "Roberts", and
% "Crutcher" are affiliated with "NCSA".  "Crutcher" has an alternate 
% affiliation with the "Astronomy Department".  The fourth author,
% "Troland", is affiliated with "University of Kentucky"

\author{Samuel Carliles\altaffilmark{1}, Tin Kam Ho\altaffilmark{2}, William O'Mullane\altaffilmark{1}}
\altaffiltext{1}{Johns Hopkins University, Baltimore, Maryland}
\altaffiltext{2}{Bell Laboratories, Lucent Technologies, Murray Hill, New Jersey}
\setcounter{footnote}{2}

%-----------------------------------------------------------------------
%			 Contact Information
%-----------------------------------------------------------------------
% This information will not appear in the paper but will be used by
% the editors in case you need to be contacted concerning your
% submission.  Enter your name as the contact along with your email
% address.
% 
% EXAMPLE:  \contact{Dennis Crabtree}
%           \email{crabtree@cfht.hawaii.edu}
%

\contact{Samuel Carliles}
\email{carliles@pha.jhu.edu}

%-----------------------------------------------------------------------
%		      Author Index Specification
%-----------------------------------------------------------------------
% Specify how each author name should appear in the author index.  The 
% \paindex{ } should be used to indicate the primary author, and the
% \aindex for all other co-authors.  You MUST use the following
% syntax: 
%
% SYNTAX:  \aindex{Lastname, F. M.}
% 
% where F is the first initial and M is the second initial (if
% used).  This guarantees that authors that appear in multiple papers
% will appear only once in the author index.  
%
% EXAMPLE: \paindex{Crabtree, D.}
%          \aindex{Manset, N.}        
%          \aindex{Veillet, C.}        
%
% NOTE: this information is also used to build the author list that
% appears in the table of contents.  Authors will be listed in the order
% of the \paindex and \aindex commmands.
%

\paindex{Carliles, S.}
\aindex{Ho, T. K.}     % Remove this line if there is only one author
\aindex{OMullane@O'Mullane, W.}     % Remove this line if there is only one author

%-----------------------------------------------------------------------
%		      Author list for page header	
%-----------------------------------------------------------------------
% Please supply a list of author last names for the page header. in
% one of these formats:
%
% EXAMPLES:
% \authormark{Lastname}
% \authormark{Lastname1 \& Lastname2}
% \authormark{Lastname1, Lastname2, ... \& LastnameN}
% \authormark{Lastname et al.}
%
% Use the "et al." form in the case of seven or more authors, or if
% the preferred form is too long to fit in the header.

\authormark{Carliles, Ho \& O'Mullane}

%-----------------------------------------------------------------------
%			Subject Index keywords
%-----------------------------------------------------------------------
% Enter a comma separated list of up to 6 keywords describing your
% paper.  These will NOT be printed as part of your paper; however,
% they will be used to generate the subject index for the proceedings.
% There is no standard list; however, you can consult the indices
% for past proceedings (http://adass.org/adass/proceedings/).
%
% EXAMPLE:  \keywords{visualization, astronomy: radio, parallel
%                     computing, AIPS++, Galactic Center}
%
% In this example, the author noticed that "radio astronomy" appeared
% in the ADASS VII Index as "astronomy" being the major keyword and
% "radio" as the minor keyword.  The colon is used to introduce another
% level into the index.

\keywords{visualization, Virtual Observatory: table, Mirage, Virtual Observatory: enabled mirage,
  IVOA client package, Java}

%-----------------------------------------------------------------------
%			       Abstract
%-----------------------------------------------------------------------
% Type abstract in the space below.  Consult the User Guide and Latex
% Information file for a list of supported macros (e.g. for typesetting 
% special symbols). Do not leave a blank line between \begin{abstract} 
% and the start of your text.

\begin{abstract}          % Leave intact
Astronomers commonly analyze astronomical data by imposing different
views on the data, frequently viewing it in image form or as
multi-dimensional plots. The ability to correlate the data in these views
in order to see manifestations of patterns across views would be a
powerful tool. The Mirage data visualization application offers this
functionality. In order to increase the value of this tool to
astronomers, we have added two features to Mirage, namely a module for
viewing FITS images, and the ability to load VOTable data. During the
process of adding the VOTable functionality to Mirage, we also developed
a separate Java package, called the IVOA Client Package, which can be
integrated easily into any other Java application to provide the ability
to load VOTable data via Cone search queries submitted to any Cone
services published in a Registry, or by a direct SDSS CAS query.  We
describe briefly the IVOA Client Package, the usage of VO Enabled Mirage,
and the process of writing a data view module which can be incorporated
into Mirage.  We also briefly describe the process of programming a FITS
viewer in Java using JSky.
\end{abstract}

%-----------------------------------------------------------------------
%			      Main Body
%-----------------------------------------------------------------------
% Place the text for the main body of the paper here.  You should use
% the \section command to label the various sections; use of
% \subsection is optional.  Significant words in section titles should
% be capitalized.  Sections and subsections will be numbered
% automatically. 
%
% EXAMPLE:  \section{Introduction}
%           ...
%           \subsection{Our View of the World}
%           ...
%           \section{A New Approach}
%
% It is recommended that you look at the sample papers, sample1.tex
% and sample2.tex, for examples for formatting references, footnotes,
% figures, equations, html links, lists, and other special features.  

\section{Introduction}
We describe the IVOA Client Package, a Java package which offers
high-level VO functionality to any Java application.  We then describe VO
Enabled Mirage, an extended version of
\htmladdnormallinkfoot{Mirage}{http://cm.bell-labs.com/who/tkh/mirage/index.html} (Ho 2003),
which offers easy retrieval and analysis of VOTable data, and correlation
with FITS image data.  We also describe the process of integrating a new
data view module with Mirage, using the example of the
\texttt{TwoDPictorialDisplayMode} module, which allows viewing of FITS
images, and which includes some common astronomical image manipulation
functionality, using components from
\htmladdnormallinkfoot{JSky}{http://archive.eso.org/JSky/} for some
operations.

\section{The IVOA Client Package}
\htmladdnormallinkfoot{The IVOA Client Package}{http://skyservice.pha.jhu.edu/develop/vo/ivoa/},
used by VO Enabled Mirage, can be integrated easily into any Java
application, enabling retrieval of VO data.
\htmladdnormallinkfoot{VOTable}{http://www.us-vo.org/VOTable/index.html}
parsing is based on
\htmladdnormallinkfoot{SAVOT}{http://simbad.u-strasbg.fr/public/cdsjava.gml}
or optionally on
\htmladdnormallinkfoot{JAVOT}{http://www.us-vo.org/VOTable/JAVOT/}.  The
IVOA Client Package is composed of three main components: a search panel
which provides a user interface to VO Cone/SIAP and SDSS CAS searches, a
common interface, called \texttt{ivoa.VOTWrap}, for accessing VOTable
data from SAVOT and JAVOT interchangeably without requiring different
application code, and a Task Manager which gives user control over
indeterminate-length operations.

The \texttt{VOTWrap} implementation supports access to table data in
VOTables.  Support for other features of VOTables may be implemented as
needed.  The motivation behind interchanging SAVOT and JAVOT is that they
behave slightly differently, and the optimal choice depends on the
situation.  SAVOT is a very tolerant parser which will frequently parse
non-compliant VOTables, but it doesn't propagate exceptions up to
application code, so graceful exception-handling with SAVOT is not
possible.  JAVOT does propagate exceptions to the calling application,
but it is very strict about standards compliance.  In particular, we
discovered that JAVOT will not parse VOTable data if the VOTable refers
to its Schema definition and for some reason the definition is
inaccessible (for instance, due to server outage.)  There does not appear
to be any way to relax this behavior.

The Task Manager has been designed to handle any kind of task that can be
programmed, with the currently implemented tasks tending to be of the
data-retrieval variety.  The \texttt{ivoa.Task} class can be extended
easily to provide whatever functionality is necessary.

\section{VO Enabled Mirage}
\htmladdnormallinkfoot{VO Enabled Mirage}{http://skyservice.pha.jhu.edu/develop/vo/mirage/}
has all the features of ``classic'' Mirage including multiple data views
and clustering algorithms, with the additional feature of being able to
load VOTable data and perform VO Cone/SIAP and SDSS CAS searches.  It
also includes an astronomical imaging module which loads FITS images
using JSky classes, and allows image manipulation operations common in
many astronomical imaging applications.

\subsection{Using VO Enabled Mirage}
Data files, including VOTable files, may be loaded into VO Enabled Mirage
from the \texttt{Console $\rightarrow$ New Dataset} menu item just as in
classic Mirage.  VOTables may also be loaded directly from Cone and
SDSS CAS searches using the
\texttt{Console $\rightarrow$ New Dataset from VO Source} menu item.
Once a dataset is loaded, the astronomical imaging module can be opened
by dragging the M51 icon (\scalebox{0.5}{\includegraphics{P3-12_f1.eps}})
into any data view panel as in classic Mirage.

\subsection{Adding VOTable Functionality}
Mirage is implemented as a command interpreter with a programmatic
interface which can be called by user interface code.  The user interface
to classic Mirage instantiates a different Mirage interpreter for each
dataset.  VO functionality was added to Mirage by extending the original
user interface.  Data loading commands generated by the user interface
are intercepted and converted from VOTable to Mirage's native data format
if necessary.  Then adding a menu option to invoke the IVOA Client search
panel was possible using the normal Java Swing API.  The code for
converting VOTable data to Mirage native data was written using the
\texttt{VOTWrap} SAVOT/JAVOT wrapper interface from the IVOA Client
Package which allows generic access to field information, some of which
must go at the beginning of Mirage's file format.  Then data is written
out one record per line with space-delimited fields.

\subsection{Adding a Data View Module}
\subsubsection{The \texttt{ActivePanel} Interface}
\paragraph{}
The \texttt{mirage.MirageGraphics.ActivePanel} interface can be
implemented by any module that one wishes to integrate with Mirage.  This
interface is still under development, and the semantic intepretation of
these methods is still not clearly defined.  The interpretation used to
implement the
\texttt{TwoDPictorialDisplayMode} module is offered here.  Implementing
classes must provide concrete implementations of the methods listed
below.  The \texttt{mirage.MirageData.Entry} class encapsulates a row of
data, and is used in many of these methods.  Each \texttt{Entry} also has
a \texttt{Color} associated with it, which may be assigned by the user.

\begin{itemize}
\item[] \texttt{public Vector getSelected():} This should return a
  \texttt{Vector} containing instances of \texttt{Entry} representing the
  rows currently selected.
\item[] \texttt{public void clearSelected():} This tells the module to
  de\-select any currently selected \texttt{Entry}s.
\item[] \texttt{public void transferDropTarget(DropTarget dropTarget):}
  This\\ should invoke \texttt{setDropTarget(dropTarget)} on any
  \texttt{Component}s in the module so that the module can be overwritten
  by another module selected by the user.
\item[] \texttt{public void colorDataEntry(Vector entry):} This tells the
  module to color the display of \texttt{Entry}s in \texttt{entry} as
  appropriate for the view.
\item[] \texttt{public void highlightDataEntry(Vector entry):} This tells
  the module to highlight the \texttt{Entry}s in \texttt{entry}
  as appropriate for the view.
\item[] \texttt{public void clearColors():} This tells the module to
  show all \texttt{Entry}s in the default \texttt{Color} for multi-color
  display.
\item[] \texttt{public void clearHighlights():} This tells the module to
  show all \texttt{Entry}s in the default \texttt{Color} for monochrome
  display.
\item[] \texttt{public void changeToMonochrome():} This tells the module
  to show selected \texttt{Entry}s in the monochrome highlighted
  \texttt{Color}.
\item[] \texttt{public void changeToColor():} This tells the module to
  show selected \texttt{Entry}s using their associated \texttt{Color}s.
\item[] \texttt{public void alternateVariables(int mode, int row,
  int col,\\ int idxCell, int nCells):}  This method informs the module
  of its position within a matrix of similar modules.  The module can
  alter its appearance accordingly (e.g. select a different variable for
  display).  For image data the display dimensions are fixed, so in
  \texttt{TwoDPictorialDisplayMode} it is implemented as a no-op.
\end{itemize}

To load a new module into Mirage, add a line reading
\begin{center}
\texttt{externalpanel \textit{classname} \textit{iconimage}}
\end{center}
to the \texttt{Property.dat} file that comes with Mirage, where
\texttt{\textit{classname}} is the fully qualified name of the class for
the module to be loaded, and \texttt{\textit{iconimage}} is a path
sufficiently specific that the icon image file can be loaded as a
resource at runtime by the Java Virtual Machine.

\subsubsection{The \texttt{TwoDPictorialDisplayMode} Data View Module}
\paragraph{}
The \texttt{TwoDPictorialDisplayMode} in VO Enabled Mirage allows the
user to load FITS images, apply user-selected cut levels, apply
colormaps, and adjust brightness and contrast with SAO DS9-style
controls.  Also, being a Mirage \texttt{ActivePanel} class, it responds
to Mirage broadcast messages, and can itself broadcast messages to other
Mirage modules.  Much of the implementation uses classes and code from
JSky, which provides an easy way to load FITS images and use them within
the Java Advanced Imaging API (JAI) framework, as well as many image
processing operations and support for WCS to image (and reverse)
coordinate transforms.  Some problems were encountered using JSky.
Mapping from an arbitrary FITS image data type to a type associated with
Java \texttt{RenderedImage}s is not entirely predictable.  The
implementation of certain image processing functions had to be copied
verbatim due to a very tight coupling between the model classes and the
view/controller classes.

The \texttt{TwoDPictorialDisplayMode} image processing classes are
implemented as a class hierarchy with each extension adding processing
functionality to its superclass.  The intention was to encapsulate the
image processing functionality in the image itself to make it easy to
integrate into any Java graphical component.  However, this design
resulted in slow performance as well as difficult maintenance and
extensibility.  We are currently redesigning it with the goal of
improving each of these aspects.

\acknowledgements We would like to thank Allan Brighton for his advice on
using JSky in the implementation of the \texttt{TwoDPictorialDisplayMode}
module.

%-----------------------------------------------------------------------
%			      References
%-----------------------------------------------------------------------
% List your references below within the reference environment
% (i.e. between the \begin{references} and \end{references} tags).
% Each new reference should begin with a \reference command which sets
% up the proper indentation.  Observe the following order when listing
% bibliographical information for each reference:  author name(s),
% publication year, journal name, volume, and page number for
% articles.  Note that many journal names are available as macros; see
% the User Guide listing "macro-ized" journals.   
%
% EXAMPLE:  \reference Hagiwara, K., \& Zeppenfeld, D.\  1986, 
%                Nucl.Phys., 274, 1
%           \reference H\'enon, M.\  1961, Ann.d'Ap., 24, 369
%           \reference King, I.\ R.\  1966, \aj, 71, 276
%           \reference King, I.\ R.\  1975, in Dynamics of Stellar 
%                Systems, ed.\ A.\ Hayli (Dordrecht: Reidel), 99
%           \reference Tody, D.\  1998, \adassvii, 146
%           \reference Zacharias, N.\ \& Zacharias, M.\ 2003,
%                \adassxii, \paperref{P7.6}
% 
% Note the following tricks used in the example above:
%
%   o  \& is used to format an ampersand symbol (&).
%   o  \'e puts an accent agu over the letter e.  See the User Guide
%      and the sample files for details on formatting special
%      characters.  
%   o  "\ " after a period prevents LaTeX from interpreting the period 
%      as an end of a sentence.
%   o  \aj is a macro that expands to "Astron. J."  See the User Guide
%      for a full list of journal macros
%   o  \adassvii is a macro that expands to the full title, editor,
%      and publishing information for the ADASS VII conference
%      proceedings.  Such macros are defined for ADASS conferences I
%      through XI.
%   o  When referencing a paper in the current volume, use the
%      \adassxii and \paperref macros.  The argument to \paperref is
%      the paper ID code for the paper you are referencing.  See the 
%      note in the "Paper ID Code" section above for details on how to 
%      determine the paper ID code for the paper you reference.  
%
\begin{references}
\reference Ho, T.K.\ 2003, \adassxii, \adassref{xii:O6-2}{339}
\end{references}

% Do not place any material after the references section

\end{document}  % Leave intact
