\documentclass[]{article}

\usepackage{graphicx}
%times,palatino,bookman, palatino, newcent

\usepackage{geometry}
 \geometry{ a4paper, total={210mm,297mm},
 left=25mm,
 right=25mm,
 top=20mm,
 bottom=20mm,
 }


\begin{document}

\title{Synple User's Guide}

\date{\today}
\author{C. Allende Prieto, I. Hubeny, T. Lanz, Y. M. Osorio}

\maketitle

{\tt Synple} is a Python interface to the spectral synthesis code Synspec
and a set of related utilities. Synple can compute emerging spectra from LTE Kurucz, 
MARCS, Phoenix or Tlusty model atmospheres, as well as NLTE Tlusty models. Appropriate 
default choices for the continuum and line opacities are provided, while the chemical 
abundances and micro-turbulence velocity are taken from the input model atmospheres, but
can be changed as needed.

\tableofcontents

\newpage

\section{Introduction}
\label{intro}

The computation of detailed stellar stellar spectra is a basic but important step required for the analysis of star light,  spectra of integrated stellar populations, or transiting planets. The calculations involve solving the equation of radiative transfer
\begin{equation}
\cos \theta \frac{d I_{\nu} (\theta)}{dz} = \eta_{\nu} - \kappa_{\nu}  I_{\nu} (\theta) + \int_0^{\pi} I_{\nu} (\theta') \phi (\theta') \sin \theta' d\theta',
\end{equation}
\noindent where $I_{\nu}$ is the specific intensity, and describes the radiation field (radiative energy per unit of frequency propagating at an angle $\theta$ from the vertical traversing a unit area per unit time), $\kappa$ is the opacity (fraction of energy absorbed per unit length), $\eta$ the emissivity (energy emited, same units as the intensity) and $\phi$ represents the scattering function (photons scattered from the direction $\theta$' into the direction $\theta$. 

Once $I_{\nu}$ ($\theta$) is known, it can be integrated to derive the stellar flux
\begin{equation}
H_{\nu} = \int_0^{\pi} I_{\nu} (\theta) \cos \theta \sin \theta d\theta
\label{flux}
\end{equation}
\noindent which can be finally convolved with various kernels that describe large-scale atmospheric turbulence, rotation, or the instrumental profile.

Prior to solving the equation of radiative transfer, one requires a physical model of the stellar atmosphere in order to compute $\eta$, $\kappa$ and $\phi$. This is the running of the thermodynamical quantities (e.g temperature and density) with height, as well as the chemical composition. This input {\it model atmosphere} is the sole required input to Synple.  Of course, computing a detailed spectrum requires fundamental physical data on the interaction of matter and radiation (photoionization cross-sections, atomic and molecular transition probabilities and damping constants, etc), but a generic collection of such data is bundled with Synspec.

Multiple codes for radiative transfer exist and are publicly available. However, most require deep knowledge of the related physics and are cumbersome to use. Synple provides an easy-to-use Python interface to Synspec (Hubeny \& Lanz 2017; Hubeny et al. 2021) for the fast computation of model stellar spectra with accuracy and flexibility. 

Note that the quantities returned by Synple are 
per unit (vacuum) wavelength, i.e. $H_{\lambda}$ and $I_{\lambda}$, 
rather than per unit frequency, $H_{\nu}$ and $I_{\nu}$, but the conversion 
is trivial by requiring that $I_{\nu} d\nu = I_{\lambda} d\lambda$
\begin{eqnarray}
  H_{\lambda} = \frac{\nu^2}{c} H_{\nu}, 
  I_{\lambda} = \frac{\nu^2}{c} I_{\nu},
\end{eqnarray}
and the returned wavelength arrays are given for standard air 
for $\lambda > 2000$ \AA\ and 
 vacuum otherwise.



\section{Installing}

Synple is hosted in github at https://github.com/callendeprieto/synple
and can be obtained using {\tt git} 
\\ {\tt git clone https://github.com/callendeprieto/synple synple} \\
\noindent or by downloading a zip file from the website.

Your Python (3.x) installation  will require the packages {\tt subprocess}, {\tt numpy}, and {\tt scipy}, usually obtained with {\tt pip} (e.g. {\tt pip3 install numpy}). You probably want to install ipython and matplotlib as well, since we will be using that in the examples below. 

The installation requires a FORTRAN compiler, and the GNU compiler is used by default
\\ {\tt cd synple/synspec ; make clean; make; cd ../..}.

The atomic and molecular line lists are sizable and need to be downloaded separately
\\ {\tt cd synple/linelists ; make clean; make; cd ../..} \\
\noindent where the automated download requires that {\tt wget} is available in your system, otherwise download the line lists manually from \\ {\tt ftp://carlos:allende@ftp.ll.iac.es/linelists} and copy them to the synple/linelists directory. For speed the linelists are converted to binary format by the same (make) script.

You can (optionally) download the Kurucz (2005) solar spectral atlas, which can be used for comparing the calculations done with Synple against real observations
\\ {\tt cd synple/atlases ; make clean; make; cd ../..}.

You need to make synple visible to Python by including the synple directory in your PYTHONPATH variable. Say you've placed the synple parent directory in your home, then you can add it in the linux shell by typing (or including in your .bashrc or .cshrc files)
\begin{table}[h]
\begin{tabular}{ll}
bash: & export PYTHONPATH="\$PYTHONPATH:\$HOME/synple"  \\
csh:  & setenv PYTHONPATH = "\$PYTHONPATH:\$HOME/synple" .
\end{tabular}
\end{table}


\section{Examples}

Once synple is installed, all you need is a model atmosphere to being using it. In this section we'll include a set of simple practical examples, mainly based on the three model atmospheres included in the synple/models directory: one is a solar Kurucz model ('ksun.mod'; Kurucz 1979 and later updates), one is a solar MARCS model ('msun.mod'; Gustafsson et al. 2008), and the third is a Phoenix model for Vega-like A-type star ('lte09600-4.00-0.0.PHOENIX-ACES-AGSS-COND-2011.ATMOS.fits') from Husser et al. (2013).


\subsection{Computing your first solar spectrum}
\label{6162}


\begin{figure}[t!]
\centering
\includegraphics[width=14cm]{Figure_1.ps}
\caption{Here's your first spectrum with synple. You have modeled the solar spectrum in the vicinity of the Ca I $\lambda$6162 line. The Ca I line is the strong line at the center, visibly damped by collisions with hydrogen atoms.
\label{first}
}
\end{figure}


For this exercise we'll use the Kurucz solar model included with synple. We're going to compute a piece of the spectrum around the Ca I $\lambda$6162 line. We start ipython and import the standard synthesis routine {\tt syn} from synple
\\
\\
\noindent {\tt 
\$ ipython \\
Python 3.6.8 (default, Jan 14 2019, 11:02:34) \\
Type 'copyright', 'credits' or 'license' for more information \\
IPython 7.4.0 -- An enhanced Interactive Python. Type '?' for help. \\
\\
In [1]: from synple import syn                                            \\      
}

\noindent then request the computation of the spectrum from the model atmosphere in the file {\it ksun.mod} between 6160 and 6164 \AA\
\\
\\
\noindent {\tt 
In [2]: wave, flux, cont = syn('ksun.mod', (6160,6164) )                     \\    
teff,logg,vmicro= 5777.0 4.437 2.0 \\
syn ellapsed time  48.8003294467926 seconds \\
}

\noindent We've got it! The routine {\tt syn} returns three numpy arrays with the wavelengths (wave), the fluxes (flux; $H_{\lambda}$), and the continuum flux (cont). If we wish to visualize the continuum-normalized spectrum, we can use matplotlib
\\
\\
\noindent {\tt 
In [3]: pylab                                               \\                   
Using matplotlib backend: TkAgg \\
Populating the interactive namespace from numpy and matplotlib \\
\\
In [4]: plot(wave,flux/cont)                                     \\   
}

\noindent and that's it! You should be looking at your first computed spectrum and it should look like the one in Fig. \ref{first}. In addition to the run with height of the thermodyanical quantities, the model atmosphere contains a detailed description of the chemical abundances and the micro-turbulence velocity (see below). These parameters are simply adopted from the model atmosphere, but can be changed if needed, as described in the next section.

\subsection{Altering micro-turbulence and chemical composition}
\label{abundances}

\begin{figure}[t!]
\centering
\includegraphics[width=7cm]{Figure_2a.ps}
\includegraphics[width=7cm]{Figure_2b.ps}
\caption{Repeating the calculation in Fig \ref{6162} (blue) but adding a second curve (orange) on the left panel reducing the micro-turbulence from 2 to 1 km s$^{-1}$, and on the right-hand panel increasen the Ca abundance by 0.2 dex.
\label{micro-abu}
}
\end{figure}


The model atmospheres we deal with are in hydrostatic equilibrium, and therefore pressure and gravity are in balance, so everything is at rest. This is unrealistic. Real stellar atmospheres have turbulence, shocks, convection, meridional circulation, etc. Thus, the computed line profiles are narrower than observed. One of the patches to address this problem is the so-called micro-turbulence velocity, which accounts for small-scale velocities of the absorbing particles. This includes small scale turbulence, and needs to be included in the computation of the linel absorption profile at the microscopic level, before solving the radiative transfer equation.

Synple includes micro-turbulence in the spectrum calculations automatically, if that's indicated in the model atmosphere file, but that value can be overridden by explicitly indicating it when calling the synthesis routine {\tt syn} using the parameter {\it vmicro}.

Let's repeat the example in \S \ref{6162} changing the micro-turbulence from the value used to construct the solar Kurucz model we used, 2 km s$^{-1}$, to a more reasonable value for a solar-like star of 1 km s$^{-1}$
\\
\\
\noindent {\tt 
In [5]: wave2, flux2, cont2 = syn('ksun.mod', (6160,6164), vmicro = 1. )   \\    
teff,logg,vmicro= 5777.0 4.437 1.0 \\
}

\noindent which can be easily compared with the previous calculation 
\\
\\
\noindent {\tt 
In [6]: plot(wave2,flux2/cont2)                          \\                       
}

\noindent as illustrated in the left-hand panel of Fig. \ref{micro-abu}. The weak, unsaturated, lines, and the core of the strong Ca I $\lambda$6162 line, are less broadened (brown curve) after reducing the micro-turbulence, while the damping wings of strong lines are insensitive to this parameter.

Similarly to the micro-turbulence, the chemical abundances can be changed from those used in the construction of the model atmosphere when computing the detailed spectrum. Since the most direct effect of the change of the abundance of an element (other than hydrogen) in the atmosphere is on the strength of its spectral lines, this is usually a good approximation for most elements and for reasonably small changes in abundances. But many elements, especially the most abundant ones, affect the thermodynamics of the atmosphere, and therefore for those elements this is a risky approximation to make. On the other hand, the approximation is very good for trace elements.

To supersede the abundances in the model atmosphere we can call {\tt syn} with the keyword {\it abu}. The abundances are expressed as the number density of nucleii of the elements relative to that of hydrogen
\begin{equation}
\epsilon (X) = \frac{N(X)}{N(H)}.
\end{equation}

Let's read the ones in the model atmosphere and then increase the calcium abundance by 50\% (0.2 dex) 
\\
\\
\noindent {\tt 
In [7]: from synple import read\_model \\
In [8]: atmostype, teff, logg, vmicro, abu, nd, atmos = read\_model('ksun.mod') \\
In [9]: abu[19] = abu[19] * 1.5 \\
In [10]: wave3, flux3, cont3 = syn('ksun.mod', (6160,6164), vmicro = 1. , abu=abu )   \\    
teff,logg,vmicro= 5777.0 4.437 1.0. \\ 
In [11]: clf() \\
In [12]: plot(wave2,flux2/cont2, wave3, flux3/cont3).
}
\\
\\
This calculation is shown in the right-hand panel of Fig. \ref{micro-abu}, and it reveals that there are three Ca I lines in the computed spectral segment. 


\subsection{Additional line broadening}
\label{fwhm}

\begin{figure}[t!]
\centering
\includegraphics[width=14cm]{Figure_3.ps}
\caption{Repeating the calculation in Fig \ref{6162} (blue) but adding the result of a convolution with a rotational profile for $v \sin i = 5$ km s$^{-1}$ (orange), a Gaussian kernel with a FWHM of 0.2 \AA\ (green), and both (brown).
\label{convolution}
}
\end{figure}

The spectral lines in a computed spectrum are naturally broadened due to the uncertainty principle, micro-turbulence (see Section \ref{abundances}), the thermal velocities of the absorbing atoms and molecules, and the collisions they suffer with surrounding free electrons and hydrogen atoms.  All these broadening factors are included in the calculations done as described in the previous exercise, but there are additional sources of uncertainty that may be significant for your particular application.

\begin{itemize}
\item \underline{macro-turbulence}: while the {\it micro} takes care of small-scale velocity fields by introducing broadening at the microscopic level, broadening the line profiles at each atmospheric layer, there are velocities on scales much larger than the photon mean free-path that need to be taken into account by convolution of the computed spectrum. This is usually taken into account by convolving with a Gaussian velocity kernel, or with a radian-tangencial profile (see Gray xxxx). Synple implements convolution with a Gaussian velocity field in the routine {\tt vgconv}.
\item \underline{rotation}: stellar rotation broadens the spectral profiles. To be exact this has to be taken into account numerically, by Doppler-shifting the intensity contributions from different angles ($\theta$) in Eq. \ref{flux}. Nevertheless the effect or rotation can be well approximated by a covolution of the flux computed for no rotation with a particular kernel (see Gray xxxx). This is implemented in Synple in the routine {\tt rotconv}.
\item \underline{instrumental profile}: Instruments distort the stellar spectrum by convolving it with the instrumental profile. If the resolving power is constant, this can be usually approximated as a macro-turbulence, with a Gaussian kernel with a constant width in velocity space. Sometimes is the resolution, the FWHM in wavelength of the response of the instrument to a monochromatic source, what is constant, and the instrumental profile can be handle in Synple with the routine {\tt lgconv}.
\end{itemize}

\begin{figure}[t!]
\centering
\includegraphics[width=14cm]{Figure_4.ps}
\caption{In addition to the original calculation in Fig. \ref{6162} (blue line), we show the result of the convolution with a rotational profile for $v \sin i = 5$ km s$^{-1}$ and a Gaussian kernel with a FWHM of 0.2 \AA\ using {\tt rotconv}{\tt lgconv} (green) and rotin (orange).
\label{rotin}
}
\end{figure}


The following example demonstrates how to convolve with a rotational profile ($vsini = 5. $ km s$^{-1}$), a Gaussian profile with a constant resolution FWHM = 0.2 \AA\, and both, the original calculation in \S \ref{6162}
\\
\\
\noindent {\tt 
In [13]: from synple import rotconv, lgconv \\
In [14]: wave2, flux2 = rotconv(wave, flux/cont,  5.) \\
In [15]: wave3, flux3 = lgconv(wave, flux/cont, 0.2) \\
In [16]: wave4, flux4 = lgconv(wave2, flux2,  0.2) \\
In [17]: clf() \\
In [18]: plot(wave, flux/cont, wave2,flux2, wave3, flux3, wave4, flux4).
}
\\
\\

\noindent Note that the spectral range of the output spectrum is truncated in wavelength, since it is computed only for the frequencies with information in the original calculation. 


These routines for convolution are directly implemented in Python. Synspec has a companion FORTRAN program that handles the convolution with the instrumental or rotational profiles: rotin. One can use this program by including the {\it fwhm} and {\it vrot} parameters when calling {\tt syn} as in the following example

\noindent {\tt
In [19]: wave2, flux2, cont2 = syn('ksun.mod', (6160,6164) , vrot = 5.0, fwhm = 0.2 ) \\
In [20]: clf() \\
In [21]: plot(wave, flux/cont, wave2, flux2/cont2, wave4, flux4)
}
\\
\noindent Note the different behaviour for rotin (orange curve in Fig. \ref{rotin}), which does not trim the edges of the computed spectrum, and {\tt lgconv}/{\tt rotconv} (green). Rotin does not include convolution with a Gaussian kernel with a constant width in velocity, implemented in {\tt vgconv}. 

\subsection{Multiple models}

One often faces the need to compute the spectra for multiple models. Since the sampling of frequencies is internally controlled within synspec, it becomes desirable to force the output fluxes to be on the same wavelength grid, and this can be done using the parameter {\it dw} in the routine {\tt syn}.

When using synple, the default value for the variable {\tt modeldir} points to the folder {\tt models} inside you {\tt synple} parent directory. If the model atmospheres are in your working directory, or as in the first examples below, the models are in the  {\tt models} folder, that's ok, but if you want to use models elsewhere you will need to change {\tt modeldir} to point to the right path (changing the source code in synple.py) or simply passing the complete filenames, including an absolute path.


\begin{figure}[t!]
\centering
\includegraphics[width=14cm]{Figure_5.ps}
\caption{We now use all the models in the 'modeldir' directory in one command, with multiple values of the micro, using {\tt multisyn}.
\label{rotin}
}
\end{figure}


If you have a bunch of models you want to compute spectra for, or multiple values of vrot, fwhm, or vmicro, you can wrap around the routine syn, or you can use the macro {\tt multisyn}, after setting the file names in a list like  in this example


\noindent {\tt
In [22]: from synple import multisyn \\
In [23]: import glob \\
In [24]: import os.path \\
In [25]: modeldir = "/home/callende/synple/models" \\
In [26]: models = glob.glob(os.path.join(modeldir,"*mod"))  \#get the models in a list \\
In [27]: wave5, flux5, cont5 = multisyn(models, (6160,6164), vmicro = [1.,2.,4.] ) \\
In [28]: clf() \\
In [29]: for i in range(len(models)): plot(wave5, flux5[i,:]/cont5[i,:])\\
\\
}
\\

\noindent and the wavelength array will now be common to all spectra, and the flux and cont arrays returned will be two-dimensional, with the first dimention running along the models in the input list.

\section{Identification of spectral features}
\label{tag}

Synple can be used to identify which transitions are causing any given spectral feature. Of course, to succeed you need to use a line list including the relevant transitions, with data of sufficient accuracy.

As we have seen, the usual output from the routine {\tt syn} is a tuple with three arrays: wavelengths, fluxes and continuum fluxes. When the parameter {\tt tag} is set to {\bf True} in {\tt syn}, the output changes including a 4-th element, a list with three additional arrays that give 
\begin{enumerate}
\item the wavelengths of the most relevant transitions, 
\item the ions or molecules responsible for those transitions, and
\item the estimated equivalent widths associated with them (in milliangstroms).
\end{enumerate}


\begin{figure}[t!]
\centering
\includegraphics[width=14cm]{Figure_6.ps}
\caption{The main transitions in the spectrum can be labeled activating the {\tt tag} keyword in {\tt syn}.
\label{tagging}
}
\end{figure}

For example, for the very first spectrum computed in section \ref{6162}, we could have used this feature

\noindent {\tt \\
In [1]: from synple import syn, tags\\
\\
In [2]: d = syn('ksun.mod', (6160,6164) , tag = True)\\
}
\\


\noindent to produce the output graphics shown in Figure \ref{tagging}. The routine {\tt tags} can be used to plot the output from syn for transitions expected to be stronger than an specified threshold in equivalent width, e.g.

\noindent {\tt \\
In [3]: tags(d, 1.)
}
\\

\noindent will tag several several additional features estimated to produce absorptions stronger than 1 
m\AA, and not included when the default minimum of 10 m\AA\ is used.

\section{Grid handling}

Synple includes a number of tools for creating grids of synthetic spectra. The format adopted is the same used for the FERRE grids, described in Section 4 of the FERRE manual available from

{\tt https://github.com/callendeprieto/ferre/blob/master/docs/ferre.pdf}
\\

Here is a quick overview of the various tools.

\begin{itemize}
\item head\_synth(synthfile): extracts the header of a grid
\item lambda\_synth(synthfile): extracts the wavelength array
\item read\_synth(synthfile,nd=False): reads the header, parameters and fluxes from a file
\item write\_synth(synthfile,d,hdr=None): writes a grid to file
\item fill\_synth(d,kernel='thin\_plate\_spline',neighbors=100): fills-in missing data using Radial Basis Functions (RBF) interpolation
\item rbf\_get(synthfile, kernel='thin\_plate\_spline'): finds the coefficients for RBF interpolation
\item rbf\_apply(synthfile,c,par): applies the RBF coefficients to interpolate
\item gsynth(synthfile,...): applies smoothing and reddening to an existing grid
\item polysyn(modelfiles, wrange, ...): sets up a directory tree for computing spectra for a grid using a job scheduler such as slurm
\item collect\_marcs(modeldir=modeldir, tteff=None, ...): collects MARCS model atmospheres for grid computation
\item collect\_kurucz(modeldir=modeldir, tteff=None, ...): collects Kurucz model atmospheres for grid computation
\item collect\_k2odfnew(modeldir=modeldir, ...): collects Kurucz ODFNEW model atmospheres for grid computation
\item mkgrid(synthfile=None, tteff=None, ...): collects the results from a calculation prepared using polysyn for a regular grid and stores the spectra in FERRE format
\item mkgrid\_irregular(synthfile=None, tteff=None, ...): collects the results from a calculation prepared using polysyn for an irregular grid and stores the spectra in FERRE format.
\end{itemize}

\section{Computing opacity tables}


\begin{figure}[t!]
\centering
\includegraphics[width=14cm]{Figure_7.ps}
\caption{Opacity in the range 6100--6110. \AA\ for four combinations of a pair of densities ($\log_{10} \rho = -32.236191, -29.933606$) and temperatures ($\log_{10} T = 8.059055, 8.51957$) and solar abundances.
\label{opacity-fig}
}
\end{figure}

Synple provides simplified access to the most basic features for opacity table calculations available with synspec. The main subroutines are

\begin{itemize}
\item polyopt(wrange=(9.e2,1.e5), dlw=2.1e-5, ...): sets up an opacity grid calculation
\item read\_opt(filename): reads an opacity table 
\item read\_copt(filename,nrho,nt): reads the continuum opacities from an opacity grid calculation.
\end{itemize}

For example, to compute a minimalist table covering 10 \AA\ (6100. -6110. \AA), 2 temperatures (3163 and 5012 K), and 2 densities (1e-14, 1e-13 gr cm$^{-3}$):

\noindent {\tt
In [1]: from synple import polyopt \\
In [2]: polyopt(wrange=(6100.,6110.),tlt=(2,3.5,0.2),tlrho=(2,-14.,1.0)) \\
}
\\

The code creates 1 folder named {\tt hyd0000001} (you would get more folders by 
including more chemical mixtures, but the default is to assume solar abundances) 
with a script {\it hyd0000001.job}. Executing the script should produce an output text file {\bf opt.data} with the opacity table.

To read and plot the table

\noindent {\tt
In [1]: from synple import read\_opt \\
In [2]: import matplotlib.pyplot as plt \\
In [3]: lrho,lt,lambda0,lopa,abu\_eos,abu\_opa = read\_opt('opt.data')\\
In [4]: plt.plot(lambda0,lopa[:,0,0]) \\
In [5]: plt.plot(lambda0,lopa[:,0,1]) \\
In [6]: plt.plot(lambda0,lopa[:,1,0]) \\
In [7]: plt.plot(lambda0,lopa[:,1,1]) \\
In [8]: plt.xlabel('wavelength (A)') \\
In [9]: plt.ylabel('log10 specific opacity (cm2/gr)') \\
In [10]: plt.show().
}
\\

\noindent which will produce the output shown in Figure \ref{opacity-fig}.


\begin{figure}[t!]
\centering
\includegraphics[width=14cm]{Figure_8.ps}
\caption{Example of the computation of emergent specific intensities I$_{\lambda}$ for various directions ($\mu = \cos \theta = 1$ the highest and $\mu = \cos \theta = 0.0001$ the lowest). The units are in erg cm$^{-2}$ s$^{-1}$ \AA$^{-1}$ steradian$^{-1}$.
\label{intensity-fig}
}
\end{figure}


\section{Computing emergent intensities $I_{\lambda}$}

It is very easy to tweak the basic routine {\it syn} (see Sect. \ref{6162}), 
or the parallel versions {\it polysyn} or {\it raysyn}, to output the 
specific intensity as a function of the angle from the vertical ($\theta$). 
One simply needs to set the keyword {\tt intensity} to true, as in the 
following example. When this is activated the output from {\tt syn} will 
change from a tuple with 3 arrays (4 if {\tt tag} is set, 
as explained in Sect. \ref{tag}) to a tuple with 5 arrays 
(6 if {\tt tag} is set), and 
the 4th array will be a 2D matrix with the emergent intensity for 
10 inclinations corresponding to 
$\mu \equiv = \cos \theta = 0.0001, 0.001, 0.01, 0.1, 0.25, 0.4, 0.55, 0.7, 0.85, and 1.0$, while the 5th array will correspond to the continuum intensity
for the same angles.
\\
\\
\noindent {\tt 
In [1]: from synple import syn
\\
In [2]: import matplotlib.pyplot as plt
\\
In [3]: wave, flux, con, inte, coninte = syn('ksun.mod', (6160,6164), intensity=True )                     \\    
/home/callende/synple/models/ksun.mod is a kurucz  model
\\
teff,logg,vmicro= 5777.0 4.437 2.0 \\
syn ellapsed time   16.27164101600647 seconds \\
\\
In [4]: for angle in range(10): plt.plot(wave,inte[:,angle])
\\
In [5]: plt.ylabel('\$I\_\{$\backslash$lambda\}\$ (erg/s/cm2/A/steradian)')
\\
In [6]: plt.xlabel('Wavelength (angstroms)')
\\
In [7]: plt.show()
\\
}

\noindent which will produce the graph shown in Fig. \ref{intensity-fig}. Note that this option is not compatible with the broadening parameters {\tt fwhm}, {\tt vrot} or {\tt vmacro}.


\section{References}

\begin{itemize}
\item Allende Prieto, C., Fern{\'a}ndez-Alvar, E., Schlesinger, K.~J., et al.\ 2014, A\&A, 568, A7 
\item Gustafsson, B., Edvardsson, B., Eriksson, K., et al.\ 2008, A\&A, 486, 951
\item Hubeny, I. \& Lanz, T.\ 2017, arXiv:1706.01859
\item Hubeny, I., Allende Prieto, C., Osorio, Y., et al.\ 2021, arXiv:2104.02829
\item Husser, T.-O., Wende-von Berg, S., Dreizler, S., et al.\ 2013, A\&A, 553, A6
\item Kurucz, R.~L.\ 1979, ApJS, 40, 1

\end{itemize}

\end{document}

