%% Corrected FO
%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}

% 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{D10}
%%%% ID=D10

%-----------------------------------------------------------------------
%                           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{E3D, The Euro3D Visualization Tool} 
\titlemark{E3D, The Euro3D Visualization Tool} 
%\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{S.F. S\'anchez}
\affil{Astrophysikalisches Institut Potsdam, And der Sternwarte 16, 14482
  Potsdam, Germany }
%\author{ }
%\affil{ }

%-----------------------------------------------------------------------
%                        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{S.F.S\'anchez}
\email{ssanchez@aip.de}

%-----------------------------------------------------------------------
%                     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{Sanchez@S\'anchez, S. F.}
%\aindex{ }     % 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{S\'anchez}

%-----------------------------------------------------------------------
%                       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, astronomy: spectroscopy, spectroscopy: integral field}

%-----------------------------------------------------------------------
%                              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
% Place the text of your abstract here - NO BLANK LINES
  We present the first version of E3D, the Euro3D visualization tool for data
  from integral field spectroscopy. We describe its major characteristics,
  based on the proposed requirements, the current state of the project, and
  some planned future upgrades. We show examples of its use and capabilities.
\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{ }


\section{Introduction}

The Euro3D Research Training Network (RTN) (Walsh \& Roth 2002) was put
forward with the intention to promote integral field spectroscopy (IFS), or
``3D'' spectroscopy, and to help making it a common user technique. In order
to accomplish this, one of the major tasks was identified as the need of
providing standard software tools for the visualization and analysis of
datacubes. These tools should be general enough to be entirely independent of
the origin of data, i.e.\ 3D instrument. Previously, a heterogenous collection
of instrument-specific data formats and software tools (e.g.\ XOASIS),
proprietary software packages and a lack of any standard have hampered a
break-through of this powerful observing method, leaving it merely as an
expert technique with comparatively limited scientific impact. The complexity
of this problem is distribed by Pecontal (2004). %%FO , in this volume.

Recognizing the importance of this problem, a work plan was devised to start
creating a package of tools for the analysis and visualization of IFS data.
Entitled {\it 3D Visualization}, Task~2.2 of this work plan foresees the
development of a programme, which should be capable of reading, writing, and
visualizing reduced data from 3D spectrographs of any kind. We have named this
tool ``{\bf E3D}''. In S\'anchez (2004), we presented the detailed description
of the program. We present here the current status of the project, give a
brief description of the programme as it is now, point out some requirements
which have not yet been met, and explain some problems that were encountered
during the development. We also present some examples with real data, trying
to explore the potential of the tool already at its first stage of
development.

\section{Background}

One of the major problems for the development of a standard visualization tool
is the lack of a standard data format. Every group has developed its own {\it
  3D data format}, both for the spectral and the position information (cubes,
FITS images, FITS tables, MIDAS images, etc...).  In order to overcome this
problem, the RTN has proposed a unified data format, the ``Euro3D Data
Format'' (Kissler-Patig et al. 2004).  Taking into account previous
experience from more than a decade of operating 3D instrumentation in the
visible and the near-infrared, this data format is supposed to cover most
foreseeable requirements of existing and future instruments. The Euro3D
visualization tool was written specifically to make use of this data format.

It was the scope of the network from the very begining to provide a freely
distributed software, that could be installed/used on the largest possible
number of computers. This prevents us from developing the software in any
commercial (e.g., IDL) or non commercial environment (e.g., MIDAS) that could
create a long-term dependence or limit its use. The possibility of
using/adapting a previous existing tool (like DS9, XIMAGE or GIPSY) was
considered. However, the specific requirements of IFS prevented us from
choosing this solution. A major caveat was the requisite of that tools to
handle with regular gridded data, like datacubes, which force us to
interpolate (i.e., alter) the data to visualize them. Due to all these reasons
it was decided to write a stand-alone software in C.

A C-coded library (``LCL'') was developed to handle the input/output of data
on the proposed format (Pecontal-Rousset et al. 2004).  This library allows to
read and write not only Euro3D format files, but also reads/writes single
spectra, monochromatic datacube slices, FITS images, and FITS tables.  We have
tested different graphical libraries (NCARG, PLPLOT, X11 low-level
routines,etc.) and created different prototypes based on these various
libraries. As a result, it was decided to use PGPLOT, mainly due to its
flexibility, portability, and in particular its capability to interact with
Tcl/Tk. The latter property allowed us to implement a scripting capability.


\begin{figure}
%\plotone{spax_ins.eps}
\plotfiddle{D10_1.eps}{4.7cm}{90}{60}{45}{160}{-13}
\caption{Spaxels Inspector. This is the GUI for plotting monochromatic or polychromatic maps. It is possible to select different spaxels, to be displayed subsequently on the Spectral Inspector.}
\label{D10:spax_ins}
\end{figure}



\section{Requirements \& Characteristics }

Decisions upon the specification of E3D were made after extensive discussion
in various RTN meetings. The main requeriments are: (1) Display all the
spectra stored on the file as a single 2D image ({\it stacked spectra}, one
spectrum per row); (2) Display different spatial representations of the data
({\it maps}) from the stacked spectra representation; (3) Select spectra from
the map representation and (4) use of alternative representations, like
pseudo-slits.  It was demanded that E3D were built with a modular philosophy
that allows to integrate different packages on the future.  E3D should be able
to interact with the major astronomical data analysis packages, like
IRAF/PyRAF or IDL. A Shared Memory Server (SHM) was integrated into E3D for
this propose, although its capabilities have not been already fully tested.
Additional communication methods have been developed and tested, based on the
scriptable capabilities of E3D.

\begin{figure}
%\plotfiddle{spax_ins.eps}{4cm}{90}{50}{50}{150}{0}
%\plotone{maps.eps}
\plotfiddle{D10_2.eps}{6.5cm}{0}{55}{48}{-180}{-183}
\caption{{\bf Top-Left:} Polychromatic map INTEGRAL data of HES 1104-185, using the spaxel
  representation. {\bf Top-Right:} Same map including a countour plot of the
  data. {\bf Bottom-Left:} Interpolated representation of the same map,
  using a Spline interpolation routine. The original spaxels pattern is
  overplotted.  {\bf Bottom-Right:} Similar interpolation, without the spaxels
  pattern, and using a Natural Neighbour interpolation routine.}
\label{D10:example}
\end{figure}

E3D comprises a C-coded core, with three main elements: (1) a library, {\tt
  Euro3D.o} containing low-level I/O and plotting functions; (2) {\tt tk\_e3d
}, a Tcl/Tk interpreter, which adds the Euro3D routines to the standard Tcl
ones and (3) a number of stand-alone C-coded tools that help to handle the
Euro3D format. Together with the C-core, we have coded a Tcl/Tk Graphical User
Interface (GUI), that uses the Euro3D-Tcl routines ({\tt tk\_e3d.tcl}). The
GUI comprises three main windows: (1) the Main window or Stacked Spectra
Inspector. It comprises the main Menu with different options to handle
Input/Output and different representations of the data; (2) the Spaxels
Inspector. It comprises a main canvas for plotting monochromatic/polychromatic
datacube slices and (3) the Spectral Inspector. It comprises a main canvas for
plotting the spectra corresponding to spaxels which were selected from any of
the two previous windows. Figure 1 shows a snap-shot of the Spaxels Inspector.
As explained above the GUI has been coded in Tcl/Tk using the Euro3D-Tcl
routines. This is probably the most powerful outcome of the adopted
programming philosophy, since a scripting capability for handling Euro3D data
is included ``for free''. This means that any user can create his/her own
Tcl-coded scripts by making use of the Euro3D-Tcl routines, and run them by
invoking {\tt tk\_e3d }.

E3D actually performs relatively simple routines, like spaxel selection or
image reconstruction. Figure \ref{D10:example} shows an example of four different
representation of the maps. The top-left panel shows a spaxel representation
of a slice cut of INTEGRAL data taken on the gravitational lens HES 1104-185
(G\'omez et al. 2004).  Each spaxel has a radius of 0.27$\arcsec$. The
top-right pannel shows the same representation including a contour plot. For
displaying the contour plot it is needed to interpolate the data, creating a
regular gridded map. Five different interpolation algorithms are already
available on E3D. The two bottom pannels of Fig.\ref{D10:example} show two
examples of these interpolation algorithms, both using a 0.3$\arcsec$/pixel
grid. We have also included different representations of the spectra, both in
a pseudo slit-spectra form (a spatial cut in the datacube, mimicking a
slit-spectrum observation). A number of simple analysis tools has been added
to E3D. Among these tools are the {\tt specarith} and {\tt spaxarith }
routines. Both routines allow one to perform arithmetic operations between
selected spectra and selected polychromatic maps, respectively.

\section{Future work}

We have designed E3D to be a data visualization and data analysis tool. It is
our goal to integrate as many different tasks of the Euro3D software package
as possible into E3D. In the end, this strategy will provide a powerful
analysis/visualization tool. There are a number of bugs still to be fixed,
some of which have been identified. A few basic requirements are still on the
queue.  For example, it has still to be decided how to handle different
wavelength units (for now: Angstroms), and different spatial units (for now:
arcsec).  There is a need for improved zooming capabilities.  We have to think
how to treat the data quality flags, and which are the best and most flexible
defaults.  Different methods of selecting spaxels (area selection) have been
proposed, but they have not been coded.  It is still under discussion how to
handle science tables, and how to plot their contents.

So far, we have tested E3D with data from a variety of instruments : INTEGRAL
(Arribas et al. 1998), OASIS, PMAS (Roth et al. 2000), SAURON, SparsePak
(Bershady et al. 2003), SPIFFI, TIGER, VIMOS, and with different mosaic
patterns (e.g.  S\'anchez et al. 2004). Some memory bugs and overloading
problems have been detected, rendering the program not very efficient for
massive reloads of big frames.  We need further investigations of how to
interact with external packages (IDL, PyTHON, ...), and further tests with the
SHM are needed.

However, given this early stage of development, E3D seems to be a promising
tool, which has already proven to be useful for visualize and help the
analysis of real 3D data.

\acknowledgements

This project is part of the Euro3D RTN on IFS, funded by the European
Commission under contract No.  HPRN-CT-2002-00305. I like to acknowledge S.
Foucaud for his help with python. A.P\'econtal-Rousset, P.  Ferruit and the
entire Lyon group for their advice, help, and their marvelous work on the LCL
library.

%-----------------------------------------------------------------------
%                             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 Arribas S., Carter, D., Cavaller, L., et al., 1998,
   Proc. SPIE, 3355, 821
\reference Bershady, M.A., Andersen D.R., Harker, J., Ramsey, L.W.,
   Verheijen, M.A.W., 2003, PASP, submitted
\reference Pecontal-Rousset, A., Ferruit, P., et al., 2004,
   Euro3D Science Workshop, 21-23 May 2003, IoA, Cambridge, AN, in press.
\reference Pecontal-Rousset, A., 2004, \adassxiii, %%FO this volume,
  \paperref{O5-2}
\reference G\'omez, P., Mediavilla, E.,  S\'anchez, S.F., et al., 2004,
   Euro3D Science Workshop, 21-23 May 2003, IoA, Cambridge, AN, in press.
\reference Kissler-Patig, M., Copin, Y.,  Ferruit, P., P\'econtal-Rousset, A.,
   Roth M.M., 2004, Euro3D Science Workshop, 21-23 May 2003,
      IoA, Cambridge, AN, in press.
\reference Roth, M.M., Bauer, S., Dionies, F., et al.,  2000,
   in Proc. SPIE, Vol. 4008, 277-288
\reference S\'anchez, S.F., 2004, Euro3D Science Workshop, 21-23 May 2003,
   IoA, Cambridge, AN, in press. (astro-ph/0310677)
\reference S\'anchez, S.F., Christensen, L., Becker, T., Kelz, A., Jahnke, K.,
   Benn, C.R., Garc\'\i a-Lorenzo, B., Roth,  M.M., 2004, Euro3D Science
   Workshop, 21-23 May 2003, IoA, Cambridge, AN, in press. (astro-ph/0310293)
\reference Walsh, J.~R.~\& Roth, M.~M., 2002, The Messenger, 109, 54
\end{references}

% Do not place any material after the references section

\end{document}  % Leave intact
