
\documentclass[12pt]{article}

\usepackage{listings}
\usepackage{textcomp}
\usepackage[utf8]{inputenc} 
\usepackage[gavo]{votutorial}
\usepackage[width=14cm,height=21cm]{geometry}

\lstset{style=daiquiri, language=SQL}


\title {Explore the Pleiades with TOPCAT and Aladin}
\author {Markus Demleitner and Hendrik Heinl}

\titlepicture{../res/cmds.png}

\begin {document}
\maketitle

\begin {abstract}
As stars in open star clusters are formed from the same matter at the
same time and have only a small velocity dispersion, it is relatively
easy to identify them from the background stars.  In this tutorial, we
will identify the members of the Pleiades kinematically and get an idea
of our success by examining a color-magnitude diagram using TOPCAT,
Aladin, and a few VO services.
\end{abstract}

\usedsoftware {\Topcat\  Version 4.9, \Aladin\  Version 12.0}

\section{Starting out}
In this tutorial we use TOPCAT for data access and plotting and Aladin
for image access. If you do not have both installed on your machine
already, install them using the following links:

Aladin: \url{\linkAladin}

TOPCAT: \url{\linkTopcat}

\section{Accessing Gaia data and plotting}
\tutstep[Getting candidate members from Gaia] To obtain a data set we need
to find a catalog providing proper motions, positions and color filter
bands. These days of course a good choice for this is the Gaia catalog, from which we will
download a subset of objects in the region of the Pleiades. 

For generic searches of the type ``objects within $x$ degrees of a position
on the sky'', the VO cone search protocol is straightforward.  To use
it, in TOPCAT
click on \menu{VO}\goto \menu{Cone Search}. In the Cone Search window
enter \entry{gaia dr3} as \key{Keywords} and click on \menu{Find Services}.
This will perform a search over the VO registry for this keyword and the
results will show up in the field below. 

There are multiple instances of Gaia in the VO. Have a look in the service metadata window and see that next to different services providing full catalogues of different Gaia data releases, you also find services from Vizier. In principle you could use any of the services providing Gaia DR3 data and they should return the same result. In this tutorial we selected the on with the short name \entry{DR3 lite Cone} -- just do a lift click.
In the field \key{Object Name} enter \entry{Pleiades}
and then click on \menu{Resolve} right of it to determine the position
around which to search (name resolution uses Sesame, a service of CDS)
The full Pleiades cluster has a large coverage on the sky.  To dodge
some problems we might run into with resource limits on the service side, 
we will settle for the cluster core for now and use a \key{Radius} of
\entry{1.5} degrees.
With \menu{OK}, submit the query to the Cone Search service. After
a few seconds, TOPCAT has loaded a few 10s of thousands of stars.

% TODO: if this is supposed to work as a TOPCAT teaser, say something
% about metadata inspection here.

\tutstep[Plotting proper motions] The data set we obtained from the last
step will not only contain members of the Pleiades, but also other
objects.  To define a subset with good candidates of members of the
Pleiades, let us exploit the fact that all members of an open clusters
share their proper motion (with a fairly small velocity dispersion) .
This would be evident as an overdensity in a plot of the proper motion
components.

Go to \menu{Graphics}\goto \menu{Plane Plot}. 
The plot controls are in the bottom part of the plotting window.
As \key{X axis}, choose \entry{pmra}, as \key{Y axis} 
choose \entry{pmdec}. Zoom into the center for the point cloud a bit
(e.g., by using your mouse wheel). You should fairly soon see an
overdensity centered somewhere around \key{0.5 e-5, -1.5e-5} $\deg/{\rm
yr}$.

\tutstep[Plotting and drawing a subset] This fairly certainly
correspondes to the Pleiades.  TOPCAT has the notion of \emph{subset}s,
i.e., parts of whole datasets defined in various ways.  One way to
define such a subset is by freehand selection, which is appropriate
here.

To define a subset in this way, use \menu{Subsets}\goto \menu{Draw Subset
region}. Now draw a region around the overdensity in PM space.
When finished with that, go to \menu{Subsets}\goto \menu{Finish
Drawing region}. In the window popping up in response, in \key{New Subset Name}
enter something like ``Pleiades candidates'' (it doesn't really matter), 
and click on
\menu{Add Subset}. You will now see the subset in a different colour on
the plot than the other objects. 

In each plot of this dataset, you can now restrict display to only this
subset in the \menu{Subsets} tab in the lower part of the plot window.
For this plot, that is somewhat pointless, but wait on.

\tutstep[Defining a colour]  A plot in which the subset makes a lot of
sense is a colour-magnitude diagram (CMD), where a colour, as is custom in
astronomy, simply is the difference
of magnitudes in two different bands. 

There are several different ways you can introduce such colors (or other
derived quantities) into TOPCAT tables.
One is giving them directly in the plotting window.  So, go
back to the tab \menu{Position} and as \key{X:} axis enter
\entry{phot\_g\_mean\_mag-phot\_rp\_mean\_mag} and as \key{Y:} axis enter
\entry{phot\_g\_mean\_mag}. Eventually click on \menu{Axies}
and tick \entry{Y-flip}, because we are plotting magnitudes. Again go to the subsets tab in your plot and compare the
CMDs of the whole dataset and of your Pleiades subset.

\tutstep[Adding columns] Sometimes derived quantities like colours 
can be reused in several places.  In that case, you will want to 
add a column containing the
results of an algebraic expression. To do that, in TOPCAT's
main window go to \menu{views}\goto \menu{Columns info}. In the new
window we click on \menu{Columns}\goto \menu{New Synthetic Column}.
Here you can enter the parameters of our new column. 

As an example, create a column called \entry{g/rp}, defined by the
\key{Expression} \entry{phot\_g\_mean\_mag-phot\_rp\_mean\_mag}. 
With \key{Index}, control where the new column shall appear; use 3 here
to follow this example.
Click on \menu{OK} to add the new column to the
data. Return to TOPCAT's main window and go to \menu{Views}\goto
\menu{Table data} to have a look at the data. In the third position you
now can see the newly added column. Don't be confused that some data
records don't have entries in this columns -- that's simply because the
same data records won't have entries at the columns jmag and hmag. Keep
the table data window open because we will need it later. 

\tutstep[Some words about metadata] In the previous steps we told you
what to enter in the fields of the plotting window or when we added a
column. But whenever you retrieve data, you want to take a look at the
metadata hopefully provided in the same process. Within the VO,
standards to provide and access metadata are crucial. Let's have a look
at the metadata of our sample. In TOPCAT's main window go to
\menu{Views}\goto \menu{Column Info}. Here you not only find the column
names, but also descriptions, units and data formats. You can also edit
the metadata by simply double clicking into the according field, which
you should do right away for the column you just created.

\section {SAMP}
\tutstep[Data exchange between VO tools] One of the VO's creeds is that
no one big, monolithic client program will serve all the VO user's
needs.  To support a situation in which many (relatively) small tools
cooperate on behalf of the user, the VO defines SAMP (Simple
Application Messaging Protocol), which allows exchanging tables,
positions, and much more between different applications. 

We will use it to send the table data
from TOPCAT to Aladin. For this, start Aladin and in the Survey menu
click on \menu{2MASS}. Then return to the
TOPCAT main window. In the bottom right you see the \key{SAMP} status.
In the \key{Clients} field you should see three symbols: one for the
SAMP hub, one for TOPCAT and one for Aladin. This means that these
applications are ready to receive messages via the SAMP interface. We want
to use this to sent our Pleiades subset to Aladin. 

A little way above the SAMP status row you will find \key{Row Subset}.
Click there, and in the menu popping up select \menu{pleiades
candidates} (or whatever name you
set for the subset). Then go to \menu{Interop}\goto \menu{Send table 
to}\goto \menu{Aladin}. The subset will be loaded in Aladin now. For
further funcionality we need to activate SAMP Actions in TOPCAT. This we
do at \menu{Views}\goto \menu{Activation Actions}. In the new opened
window you can configure TOPCAT's SAMP Actions. Here you need to check
\emph{Send Sky Coordinates}. You may notice that TOPCAT already guessed
which table rows contain the coordinates. This is possible due to the
provided metadata (the buzzword here is \emph{UCDs}).

Now go to Aladin and you will see the objects displayed on the 2MASS
images. You can zoom in, and out with your mous wheel. Select some of the objects and see
that those objects are highlighted in TOPCAT's table data window.

Use this feature to at least look at some of the outliers in the
Pleiades' CMD.  Perhaps some of them are actually binary stars?

\subsection {Going on}

Can you determine the
parallax of the Pleiades according to Gaia?  To get some perspective on
this, check out Melis et al (2014).


\section {References}

\begin{description}

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

\item Melis, C., Reid, M.~J., Mioduszewski, A.~J., Stauffer, J.~R., \&
Bower, G.~C.\ 2014, Science, 345, 1029
\href{http://ads.ari.uni-heidelberg.de/abs/2014Sci...345.1029M}{2014Sci...345.1029M}.

\end{description}


\end {document}
