\documentclass[twoside]{article}[12pt]

\usepackage{listings}
\usepackage{textcomp}
\usepackage[utf8]{inputenc} 
\usepackage[asterics]{votutorial}

\title { Classifying SEDs of Herbig Ae/Be Stars}
\author {H.~Heinl, M.~Demleitner, D.~Baines, E.~Solano}



\titlepicture{title.png}

\begin {document}
\maketitle

\newpage

\begin {abstract}
Herbig Ae/Be stars are 2-8 solar mass, pre-main-sequence stars (that is,
young objects with typical ages of $<10\,$Myr) of spectral types A or B.
These stars are still embedded in gas-dust envelopes and are sometimes
accompanied by circumstellar disks. They are in the gravitational
contraction stage and approaching the main sequence (i.e. they are not
burning hydrogen in their centre).

Herbig Ae/Be stars show Balmer emission lines in their stellar spectrum
and infrared excess due to circumstellar dust. Sometimes Herbig Ae/Be
stars show significant brightness variability associated to clumps
(protoplanets and planetesimals) in the circumstellar disk.

The SEDs of Herbig Ae/Be stars fall roughly into two groups: Group I
sources have a relatively strong far-IR flux, which is energetically
comparable with the flux in the near-IR showing an almost flat spectral
energy distribution. Group II sources show a similar near-IR excess as
group I sources but their flux falls off strongly towards the far-IR.
These were first classified by Meeus et al (2001, A\&A, 365, 476).
Examples of both groups are seen in the plot above. In this tutorial we
will use VO tools and Vizier to access observed photometric SEDs and
spectra in the near and far infrared of different stellar objects to
compare them and categorise to objects to group one or group two. 

\end{abstract}

\usedsoftware{\SPLAT~Version 3.11, \Topcat~Version 4.5}

\section{Starting out}
For this tutorial we need the VO tools Topcat and Splat-VO. You can find
the most recent versions here: 

TOPCAT: \url{\linkTopcat}

Splat-VO: \url{\linkSPLAT}

\section{SAMP and SSAP}

The Virtual Observatory (VO) is all about interoparability of
astronomocial data. Within the different VO projects, services and
client softwares are developed speaking common languages (protocols)
which faciliates remote access to different data types like tables, images and
spectra.  In this tutorial we will make use of the VO standards Simple
Application Messaging Protocol (SAMP) and Simple Spectral Access
Protocol (SSAP). Don't be afraid, you will almost not notice when we use
either one of them, but will soon see how useful they are, to discover
and access observational data of e.g. the Herbig Ae/Be stars HD100546
and HD163296.

\section {Workflow}

\begin{figure}
\includegraphics[width=0.9\textwidth]{vizier.png}
\caption{The Vizier Photometry Service}
\label{fig:vizier}
\end{figure}

\tutstep[Search and download Photometry Points]
In this first step we will download photometry from Vizier and prepare
the data in Topcat. In a later step we will load this data into
Splat-VO. For now, start Topcat.  Then open a Browser and access the
Vizier Photometry Tool at: \url{http://vizier.u-strasbg.fr/vizier/sed/}.
At \key{Target} enter \entry{HD100546} and at \key{Radius} enter
\entry{1}. After a few seconds the service presents you the plot of the
photometric data points of
HD100546. Below the plot you see a list of catalogues in Vizier that
provide photometry. You can select and deselect whole catalogues or
single data records to be plotted. 

Some of the records contain repeated data, e.g., from 2MASS, SDSS or
WISE. This is due to the possible differences in the cross matches of
the catalogues in Vizier. Play around with the search parameters -- for
instance, change the search radius to $30$~arcsecs. In this tutorial we
assume that you take the result from the search of $1$~arcsec though. 

Now we want to obtain the data from the service and have a look at it.
One way would be to click on \key{download data}, but it is more
convenient to directly transfer the data to your desktop using a VO
protocol called SAMP.  To use it, spot the image of a radio dish right
below the blue \key{submit} button (look at the upper left of
Fig.~\ref{fig:vizier} where to find it).  Click on it once and a button
\key{broadcast} will appear. Click on it, and a window will open that
asks you if you want to accept the SAMP connection. SAMP is used to
exchange data between different VO tools. In this case, your browser
will send the photometric catalogue data to Topcat. Click on \key{Yes}
and change to the Topcat main window. 

\tutstep[Make a table subset]
In Topcat in the \key{table list} you can see the entry \entry{data from
Vizier photometry viewer}.  Topcat also informs you that there are $130$
rows in the table.  A short look at the plot in the browser window
confirms that our table contains some entries multiple times. 

To produce a usable SED, we need to process this dataset a bit, in
particular by filtering out obviously problematic records.  To do that,
go to \menu{Views}\goto \menu{Table Data} to have a look into the data.
Sort by the column \key{\_sed\_filter}.  Our physics suggests we should
pay particular attention to optical and infrared data; hence, select
records for each band from the following surveys (hold the control key
and click on the rows): 2MASS, AKARI, Gaia, HIP, IRAS and WISE. 

Then go to \menu{Subbsets}\goto \menu{Subset from Selected Rows}. You
will be asked to name the subset. Then, click \key{Add subset}. 

\tutstep[Send data to Splat-VO] Our analyis will take place in Splat, so
that's where we need to send the data to; again, we can use SAMP for
that.

Open Splat-VO and then return to Topcat's main window. To make sure only
our cleaned-up dataset is transferred to Splat, on the right side
in \key{Current Table Properties} at \key{Row Subset} select the subset
we defined in the previous step. Then go to \menu{Interop}\goto \menu{Send Table to ...}\goto
\menu{splat}.  

Going back to Splat-VO you will now see the table
containing the photometry, as well as a open plot, which looks nothing like a
SED; that's because Splat could not work out what columns contain the
spectral and flux columns are (that's called an "`interoperability
problem"' in the VO jargon and can count for a bug).

To fix this, go to Splat-VO's main window and on the right
side hit \key{Properties of current spectra}. Under \key{Columns} select
\entry{\_sed\_freq} as \key{Coordinates} and \entry{\_sed\_flux} as
\key{Data}. In the \key{Line type} menu select \entry{point}. Play a
little with the settings to get familiar with the various plot options.

\tutstep[Get infrared spectra] The points we have aren't really enough
to tell apart the two classes of Herbig Ae/Be stars.  So, in this step
we will search for spectra in the near and far infrared. To do that, we
will use a VO standard called Simple Spectral Access Protocol (SSAP)
that lets us search for spectra with all kinds of constraints and pull
whatever we find into Splat-VO. 

So, in the main Splat-VO window, go to \menu{File}\goto \menu{SSAP\_} to open SPLAT's big SSAP
window.  On the left side you find options that are related to the
services, whereas on the right side you can set configurations
concerning the object or position of interest. 

Let's start with the servers. We are interested in spectra in the
infrared, at \key{SSAP Servers} we select the \entry{ISO ESA archive
SSAP service}.  On the right side of the window we now make the settings
for the object.  At \key{Object} enter \entry{HD100546} and then click
{lookup}. This will resolve the object identifier to coordinates.  The
\key{Radius} with 10 arcminutes is a little too big (you'll get false
matches); better set it to 1 arcminute.  Finally, press \key{Send
Query}.

The query results will show up.  You'll see that there's quite a bit of
metadata on each spectrum; this already lets you work out which spectra
might be useful for your analysis.  Unfortunately, at the time of this
writing, not all metadata from the ISO service is in perfect order.  If
in doubt, just have a look at the spectrum itself.

Anyway, the two spectra you want here are the last two spectra in the
list. Press \key{Download Selected} to download the spectra, which may
take a few seconds. Splat downloads them in FITS, but you don't
need to worry about that; thanks to sufficient metadata, Splat can (and
does) automatically plot the spectra.  In this case, it's a good idea to
close these plots after a brief inspection; it's easy to lose yourself
if there are too many windows around.

\tutstep[How not to get lost]
In Splat-VO's main window you will see the stack of spectra. Right now
you should see the table containing the photometric points and two spectra, so keeping the overview here
seems easy. The more data you download, the more difficult it gets to
keep that overview. We suggest that whenever you want to keep a
downloaded spectrum, you give it a more expressive name by changing the
\key{Short name} entry. Do so now for the photometry points from VizieR
and the (two) spectra from ISO.  Below we will open spectra of different
objects, so it is a good idea to also include some indication of the
object name (HD~100546). 


\begin{figure}
\includegraphics[width=0.9\textwidth]{hd100546.png}
\caption{The plot of the SED of HD100546}
\label{fig:hd100546}  % label muss nach caption kommen!
\end{figure}


\tutstep[Unify units]
We will now merge the photometry with the spectra to a SED in a single plot.
For this to work, we need to unify the units in the various pieces of
data. 

To do this, go to \menu{View}\goto \menu{Modify/view spectral
coordinates}. You recognise that the units of the spectra and the
photometry table
are different. Simply select all three entries in the \key{Global
list of spectra} and then below at \key{Coordinate System} select
\key{Wavelength in vacuum} and at \key{units} select \key{Angstrom}.
Then click on \key{Convert} and, then, on \key{Close}. 

The analogous step for the flux axis employs:\menu{View}\goto
\menu{View/Modify data coordinates}.  Again, select the photometry table and the
spectra in the \key{Global list of spectra}. At \key{Units} select
\key{erg/cm\^\ 2/s/Angstrom}. Then click on \key{Convert} and, then, on \key{Close}. 

This little magic trick shows you how easy
many things can become if people use proper standards and clients. (As an aside, when you have to use data without proper metadata, you can
enter the proper units and hit the \key{Set} button in that dialogue).

\tutstep[Plotting]
Finally we can have a look at the SED plot: in the main window of Splat-VO
select the photometry table an the two spectra and click on \menu{View}\goto \menu{Display/add
to plot}. 

Since we are spanning several orders of magnitude and flux, the default
plot is not terribly informative.  The physics here strongly suggests a
log-log plot, so change the scale to logarithmic by checking \key{log}
on both axes. You can add or remove spectra from both within the
plotting window and the main window at the option \key{Views of current
spectra}. This will become handy later.

Fig.~\ref{fig:hd100546} shows the SED for HD100546, taken aside the colours, your SED
should look similar. 

\tutstep[Adding a second object]
As we stated in the abstract, Herbig Ae/Be stars fall into two groups,
so we now will access data of a second object and then compare the
plots. We do this by repeating the steps 1 to 7 for the object
\entry{HD163296}. Note that during the spectra selection process you
select the spectra \key{ISO SWS 01} and \key{ISO PHT40}.

\tutstep[What to do when Splat ignores the log check mark]
When trying to change the scale of the Y Axis to \key{log} you may
notice that Splat sets the check mark but doesn't change the plot. This
is due to a bug in the current version.  If this isn't fixed in your
version of Splat, try a quick workaround.  The root of the problem
is that when there are negative flux values (as in some ISO spectra),
Splat catches the math exception but then does nothing useful (e.g.,
replacing it by a NULL or at least undo the check mark in log).

To still see \emph{something}, select the spectrum in question in the
Splat-VO main windows, then go to \menu{View}\goto \menu{View/modify
spectra values}.  In the opening window, uncheck \key{Read only}, then
click on \menu{operations}\goto \menu{Modify data column}. In the newly
opening window we can apply algebraic expressions to all data values of
the spectra. 

Since with flux calibrated data, negative values only make sense as the
formal result of a (frequentist) error estimate, it doesn't really
matter what we do to them for this analysis.  A very quick hack that
will let you do the log plot is replacing the flux values with absolute
values; you can do that by entering \entry{abs(data)} next to \key{y=}
type (you should get fancier in less qualitative analyses). Then click
\mey{Apply} and \key{Close}.

\begin{figure}
\includegraphics[width=0.9\textwidth]{title.png}
\caption{The SEDs of HD100546 and HD163296, as displayed
by Splat-VO}
\label{fig:twoseds}  % label muss nach caption kommen!
\end{figure}

\tutstep[Plot two objects]
We will now have a look at both objects in the same plot. You can do so
from the Splat-VO main window by adding the SED and spectra of
\entry{HD163296} to the plots of \entry{HD100546}. You could also select
the SED and spectra in the main window and click on \menu{Views}\goto
\menu{Display/add to plot}. The result should look similar to
Fig.~\ref{fig:twoseds}.

If you compare the two objects, you can easily see that \entry{HD100546}
shows an excess in the near and far infrared, which the model says is due
to the existence of dust surrounding the star and emitting in these
bandpasses. Hence \entry{HD~100546} a Herbig Ae/Be star of group I, and
\entry{HD~163296} Herbig Ae/Be star of group II. 

\subsection{Excercise}
Repeat the above steps for \entry{AB Aurigae} and categorise the star
to one of the groups. 


\section{References}

\begin{description}

\item[]Draper, P.W., Castro-Neves, M., Taylor, M.  \url{http://star-www.dur.ac.uk/~pdraper/splat/sun243.htx/sun243.html}

\item[]Dullemond, C.~P. and Dominik, C. and van Boekel, R. and Waters,
R. and van den Ancker, M.\ 2004, IAU Symposium, 221, 389, 2004IAUS.221.389D

\item[]Meeus, G. and Waters, L.~B.~F.~M. and Bouwman, J. and van den
Ancker, M.~E. and Waelkens, C. and Malfait, K. \ 2001, AAP, 365, 476-490,
2001A\&A.365.476M

\item[] Simon, A.-C. and Boch, T.  \url{http://vizier.u-strasbg.fr/vizier/sed/doc/}

\item[]Taylor, M. \url{http://www.star.bris.ac.uk/~mbt/topcat/#docs}

\end{description}


\end{document}
