% Stellar Atmospheres
% Computer Lab 2
% Fall 2002
% 7 October 2002
% Michelle Mizuno-Wiedner

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

\setlength{\textheight}{23cm}
\setlength{\textwidth}{15cm}
\setlength{\topmargin}{-15mm}
\setlength{\oddsidemargin}{1cm}
\setlength{\parindent}{0cm}
\setlength{\parskip}{2mm}
\setlength{\evensidemargin}{-0.5cm}


\begin{document}


%--- CUSTOMIZATION COMMANDS ---%

%--- TITLE ---%

\begin{center}
  {\Large \bf
   Stellar Atmospheres, Ht 2002 \\[2mm]
   Lab 2: The solar iron abundance} \\[4mm]
   Lab report due: Tuesday, 29 October 2002
\end{center}

\renewcommand{\arraystretch}{1.5}
\begin{tabular}{|ll|}
  \hline
  \makebox[1cm][l]{\bf
Goal:}
  & \parbox[t]{13cm}{\sloppy
  Use SME to determine the solar iron abundance
  and the astrophysical $g\!f$ values for some iron lines.}
  \\
  \makebox[1cm][l]{\bf
Tip:}
  & \parbox[t]{13cm}{\sloppy
  Think about the questions in section~\ref{sec:report} before you do
  the exercise!}
  \\
  \hline
\end{tabular}


%----------------------
\section{Background}
%----------------------

SME (Spectroscopy Made Easy) \cite{sme} is a tool for generating
artificial spectra from atomic line lists, and for comparing these
spectra to real observations. SME uses the Interactive Data Language
IDL, which is commercial software for data analysis and visualization.
%, and it can directly read the line lists generated by VALD.

One thing for which SME is particularly useful is determining the
abundances of elements in stellar atmospheres. This is done by
adjusting a synthetic spectrum to match the observed spectrum of the
star in question. Of course, this can only be done properly if the the
spectral lines in the analysis are calculated using the correct atomic
line parameters.

The Vienna Atomic Line Database (VALD) \cite{vald} is a database of
atomic line lists from both theoretical and laboratory sources. The
line lists are ranked according to their quality for each individual
atomic parameter. Therefore, when you make a request to VALD, it will
return the best data available for each parameter.

There are two ways of requesting data from VALD: via an e-mail service
or a Web-based service. VALD will always respond via
e-mail. \textit{You need to register to use these services beforehand,
so please sign up well before beginning these computer exercises.}
More information about VALD, registration, and the different
procedures for data extraction is available through the Web
\cite{vald_www}.

In this computer lab, you will use SME to generate synthetic spectra
using atomic data from VALD. You will then be able to determine the
iron abundance on the Sun by comparing those spectra to observations
taken from the Kurucz Solar Atlas.


%----------------------
\section{First steps}
%----------------------

If you are working at a terminal other than sune, use secure shell to
log on to sune (by typing \ {\tt ssh~sune}).

First, access the VALD Web interface \cite{vald_extract} to extract a
line list for the wavelength interval 6172--6181~\AA. Use the
``extract stellar'' method with solar parameters (see table
below). Choose a microturbulence of 1~km~s$^{-1}$, and a detection
limit of five percent (0.05). The chemical composition defaults to
solar. To be able to input the data easily into SME, you should
request data in the VALD short format, with the default configuration.
Please note that it can take up to 30~minutes before you receive the
response from VALD containing your line list. Once you receive it,
save it to a file and remove all the text lines before the one that
contains the starting and ending wavelengths.

\begin{center}
\renewcommand{\arraystretch}{1.2}
\begin{tabular}{|l|l|}
\hline
\multicolumn{2}{|c|}{\bf Solar parameters} \\
\hline  \hline
\makebox[3cm][l]{Teff} & \makebox[3cm][l]{5770 K} \\
                 log g   &                4.44    \\
                 vmicro  &                1    km s$^{-1}$ \\
                 vmacro  &                2    km s$^{-1}$ \\
                 v sin i &                1.66 km s$^{-1}$ \\
\hline
\end{tabular}
\end{center}

\smallskip

To use SME on your system, you will need to install a few files in
your current working directory. The batch file called
\texttt{install\_sme} that will take care of this. Copy it from
\texttt{/u1/local/lab/stjarnatmos/Lab2/} into the
directory in which you will run SME. Then run it by typing
\texttt{./install\_sme} in the terminal window.


%----------------------
\section{Procedure}
%----------------------

You are now ready to compute a spectral synthesis with SME. Launch IDL
and SME automatically by typing the command \texttt{startsme}. At the
Observatory there are a limited number of IDL licences available.
Therefore, always quit SME and \texttt{exit} IDL when you are
finished; do not leave IDL running if you do not need it!

\begin{enumerate}

\item Begin by generating a synthetic spectrum with fixed
values. Choose the following settings: \\

\renewcommand{\arraystretch}{1.5}
\begin{tabular}{ll}
\textbf{Line Data}
  & \parbox[t]{8cm}{\sloppy
    Select the line list you got from VALD.}
\\
\textbf{Controls/Global parameters}
  & \parbox[t]{8cm}{\sloppy
    Enter the solar parameters above and use a metallicity of
    \mbox{[M/H] = 0}, a radial velocity of 0.43 km~s$^{-1}$, and
    set G6 to 2.5.}
\\
\textbf{Controls/Model atmosphere} \quad
  & \parbox[t]{8cm}{\sloppy
    Choose ``Single File'' and ``Find,'' then select
    /h3/piskunov/SYNTH/MODELS/sun.krz.}
\\
\textbf{Observations}
  & \parbox[t]{8cm}{\sloppy
    Choose ``Segment of Kurucz solar atlas.''}
\\
\textbf{Jobs}
  & \parbox[t]{8cm}{\sloppy
    Enter a name for this job, then hit RETURN. Make sure all
    parameters are set correctly by using {\bf Review Current SME
    Request}.}
\end{tabular}

\clearpage

Now you can compute the spectral synthesis by pressing {\bf Save
Request} and {\bf Submit SME batch job}. The process runs in the
background. You can check whether the computation is finished with
{\bf View SME Log File}.

When the computation is finished, go to the {\bf Examine} menu, choose
{\bf Read SME structure from disk}, and read in your output spectrum,
whose file name is the job name plus the file suffix
\texttt{.out}. Then do {\bf Plot Flux Profiles}. 

Take a careful look at the spectra, especially at the iron lines. You
can zoom in on parts of the plot by holding down the left mouse button
while you select a portion of the plot. Return to normal size by
hitting the \textbf{Unzoom} button. Note also that the plot is
color-coded to show continuum points, line points, and points that
should be ignored during any kind of fitting.


\item \label{it:fe}

As you will see, the synthetic spectrum that you produced with the
default parameters does not fit the observed iron lines on the Sun
very well. But SME also allows you to select certain free parameters,
for which it will determine the values that are most consistent with
the observed spectrum.  Try this option under \mbox{\bf Controls/Free
Parameters} and choose to solve for the iron abundance. Submit a new
SME request. You can see what adjustments SME made during the fitting
iterations by pressing \textbf{Examine} and \textbf{Print Free
Parameters}. You can then also \textbf{Print} this output to a file
called \texttt{sme\_scratch.txt}. Compare your solution to the
previous case. What happened, and why?

\item 

Repeat step~\ref{it:fe}, but this time ask SME to solve for both the
iron abundance \textit{and} the microturbulence \texttt{Vmic}
simultaneously. Again, compare your solution to the previous case and
explain what happened.

\item

Return to the original solar abundance value and a microturbulence of
1~km~s$^{-1}$. This time, fine tune the $g\!f$ values by selecting
individual iron lines from your spectrum and solving for their $g\!f$
values. Analyze the remaining discrepancies.

\item

Note that you can improve your fits even further by telling SME how to
handle the different pixels in the observed spectrum. After reading
either an input (\texttt{.inp}) or output (\texttt{.out}) file from
disk, plot the flux profiles and put a checkmark in the \textbf{Edit
mask} option. You can then ask SME to ignore certain points by
selecting regions as ``bad'' pixels with the right mouse button (or
reinstate them as ``good'' with the left mouse button). The
\textbf{Switch to line/cont} button allows you to mark line and
continuum regions with the right and left mouse buttons,
respectively. Once you have edited the mask, try again to solve for
the line broadening and the $g\!f$ values for all strong lines. (Which
parameter controls the broadening?  Do you understand why?)




\end{enumerate}


\pagebreak[3]


\section{Written Report}
\label{sec:report}

Write a report in which you explain how the different atomic and
stellar parameters influence the spectrum. Describe your strategy for
determining the iron abundance and present your result. 

In addition to this, take a moment to consider the program SME itself,
which calculates the artificial spectrum by solving the radiative
transfer equation. What are the implicit assumptions? What does this
mean for your comparison of the artificial and observed spectrum?
Below are more questions to consider, but feel free to comment on any
other relevant points. \\


{\bf About the effects of atomic and stellar parameters on the shape
\\ of the spectral line}%
%
\footnote{Additional reading: Gray \cite{Gray}, chapter 13.}
%
\\[-6mm]
\begin{enumerate}
\item Which atomic and stellar parameters determine the width of the
      line core? 
\item Which parameters determine the strength of line wings at low
      ($<7000$~K) and high ($>10000$~K) effective temperatures?
\item What are micro- and macroturbulence? How do they affect line
      shapes? What is the relation between macroturbulence and surface
      gravity?
\item Describe the effect of stellar rotation on the shape and
      equivalent width of the spectral line.%
%
\footnote{Additional reading: Gray \cite{Gray}, chapter 17.}
%
\item Describe the effect of the instrumental profile on the shape and
      equivalent width of the spectral line.
\item \textit{Extra credit:}
      Use IDL or another such program to plot a doublet of identical
      Gaussians, separated by the FWHM. Then convolve them with (1) a
      rotational profile, and (2) another Gaussian that represents the
      instrumental profile. Compare the two results, and try to make a
      profile with three peaks. Why does this only work in one of the
      two cases?
\end{enumerate}



{\bf About determining the solar iron abundance}

\begin{enumerate}
\item What happened when you tried to solve simultaneously for the iron
      abundance and the microturbulence? Explain why.
\item The iron abundance cannot be solved simultaneously with the $g\!f$
      values. Discuss why. What other sets of parameters cannot be
      solved for simultaneously?
\end{enumerate}


\clearpage

\begin{thebibliography}{}
%
\bibitem{vald_www}
  http://www.astro.uu.se/{\boldmath$\sim$}vald/
\bibitem{vald_extract}
  http://www.astro.uu.se/htbin/vald/
\bibitem{Gray}
  D.~F.~Gray, {\sl The Observation and Analysis of Stellar
  Photospheres\/}, Cambridge University Press, 1992.
\bibitem{vald}
  N.~E.~Piskunov, F.~Kupka, T.~A.~Ryabchikova, W.~W.~Weiss,
  C.~S.~Jeffery, 1995, {\sl A\&AS} {\bf 112}, 525.
\bibitem{sme}
  J.~A.~Valenti \& N.~Piskunov, 1996, {\sl A\&AS} {\bf 118}, 595.
%
\end{thebibliography}

\vfill
{\footnotesize These computer exercises were written by Eric Stempels,
and transferred to \LaTeX\ and modified by Michelle Mizuno. They are
based on notes by Nikolai Piskunov.}

\end{document}
