% !TEX root = ../thesis-example.tex
%
\chapter{Data and Methods}
\label{sec:data}

In this chapter the selection criteria for the data is explained in section \ref{sec:data:data_selection}. Furthermore a detailed description of the algorithm is given in section \ref{sec:data:data_reduction}.

\section{Data selection}
\label{sec:data:data_selection}

This study uses a broad selection of Kepler/K2 and TESS lightcurves, which were downloaded from MAST. For Kepler and its continuation mission K2 short-cadence data was used. Unlike long-cadence data with a cadence of 30 minutes, this allows the resolution of shorter events too, as the duration of flares can vary between a few seconds to a few hours (\cite{flare_duration1}, ).
The initial dataset was taken from a list of well known flaring stars from \cite{kepler_411_study}, \cite{kepler_411_210_comparison}, \cite{doyle_2018}, \cite{doyle_2019}, \cite{au_mic_flaring_spi} and \cite{flare_occurance_periodicity}. Additionally the dataset of the M to F stars of \cite{althukair_starlist} which can be found at \href{https://github.com/akthukair/AFD}{https://github.com/akthukair/AFD} was parsed to the downloader GUI. Due to not all data being available as short cadence data from Kepler/K2, only a subset of this large sample was added.

\section{Data reduction algorithms}
\label{sec:data:data_reduction}


\section{Spectral type identification}
\label{sec:data:sptype_identification}

After the initial download and cross checking with SIMBAD, not all stars had a spectral type assigned. For these stars magnitudes in various different bands was known though. The stars which have their magnitudes known atleast in the B and V bands are found in table \ref{tab:unknown_sptypes_bv}, while the stars which had their magnitudes known only in the J, H and C bands are in table \ref{tab:unknown_sptypes_jhc}.
Using $B-V$ (as well as further magnitude differences, if available) have been compared to the table at \cite{spectral_type_color_table} (\href{https://www.stsci.edu/~inr/intrins.html}{https://www.stsci.edu/~inr/intrins.html}). This allowed for a rough classification of the stars in table \ref{tab:unknown_sptypes_bv}. Additionally, and to classify the stars in table \ref{tab:unknown_sptypes_jhc}, the effective temperature was taken into account from the TESS Input Catalogue (\cite{revised_tess_input_catalogue}) from Vizier (\cite{vizier}). The classification table for spectral types based on effective temperature has been taken from \cite{harvard_spectral_types_teff} (\href{https://lweb.cfa.harvard.edu/~pberlind/atlas/htmls/note.html}{https://lweb.cfa.harvard.edu/~pberlind/atlas/htmls/note.html}).\\
The final spectral type for the stars can be found in table \ref{tab:unknown_sptypes_final_output}. If the base spectral type calculated from the effective temperature and the magnitude differences in multiple different color bands is identical, it will use that spectral type as final. In the case of those differing, like for BD-08 995, which was found to be an early K type star (K0) by the intrinsic color method but is a G type star based on the effective temperature, the latter is prefered. For the four stars from table \ref{tab:unknown_sptypes_jhc} which did not provide magnitudes in the optical range, the spectral type based on the effective temperature is taken as final.

\begin{table}
    \caption{List of stars with no spectral type entry on SIMBAD, but available magnitudes in the B and V bands. Main Identifier according to SIMBADs "MAIN\_ID" property, as well as TESS Input Catalogue and Kepler Input Catalogue numbers.}
    \label{tab:unknown_sptypes_bv}
    \begin{tabular}{lll}
    \hline
    Main Identifier & TIC & KIC \\
    \hline\hline
    1RXS J064643.6-770027 & TIC 177255827 & - \\
    BD-08   995 & TIC 43472154 & - \\
    CPD-19   878 & TIC 93125144 & - \\
    PM J07058-5848 & TIC 279615427 & - \\
    TYC 1360-957-1 & TIC 247117382 & - \\
    TYC 4595-107-1 & TIC 394030788 & - \\
    \hline
    \end{tabular}
\end{table}


\begin{table}
    \caption{List of stars with no spectral type entry on SIMBAD, but available magnitudes in the J, H and C bands. Main Identifier according to SIMBADs "MAIN\_ID" property, as well as TESS Input Catalogue and Kepler Input Catalogue numbers.}
    \label{tab:unknown_sptypes_jhc}
    \begin{tabular}{lll}
    \hline
    Main Identifier & TIC & KIC \\
    \hline\hline
    2MASS J18524052+4156057 & - & KIC 6500181 \\
    2MASS J18534407+4208274 & - & KIC 6668646 \\
    2MASS J18535462+4135227 & - & KIC 6183672 \\
    2MASS J19335656+4010546 & - & KIC 5016904 \\
    \hline
    \end{tabular}
\end{table}

\begin{landscape}
\begin{table}
    \caption{Final estimated spectral types. Main Identifier shows the MAIN\_ID property for the star on SIMBAD. The column SIMBAD B-V contains the value of B-V with the respective magnitudes taken from SIMBAD. The columns TIC T\textsubscript{eff}, MASS and Radius contain the effective temperature, mass and radius for the star taken from the TESS Input Catalogue from Vizier. The column Spectral Type (B-V) contains the estimated spectral type based on \cite{spectral_type_color_table}, while the column Spectral Type (T\textsubscript{eff}) contains the spectral type based on the effective temperature from \cite{harvard_spectral_types_teff}. The last column contains the spectral type which is estimated and used in this study.}
    \label{tab:unknown_sptypes_final_output}
    \begin{tabular}{lccccccc}
    \hline
    Main Identifier & SIMBAD B-V & TIC T\textsubscript{eff} & TIC Mass & TIC Radius & Spectral Type (B-V) & Spectral Type (T\textsubscript{eff}) & Final Spectral Type \\
     & & / $K$ & / $M_\odot$ & / $R_\odot$ & & & \\
    \hline\hline
    1RXS J064643.6-770027 & 1.320000 & 4082 & 0.640 & 0.654 & K7.0 & K & K \\
    BD-08   995 & 0.820000 & 5316 & 0.920 & 0.905 & K0.0 & G & G \\
    CPD-19   878 & 1.087001 & 4852 & 0.790 & 0.893 & K5.0 & K & K \\
    PM J07058-5848 & 1.320001 & 4250 & - & 0.409 & K7.0 & K & K \\
    TYC 1360-957-1 & 0.970000 & 4870 & 0.790 & 0.636 & K3.0 & K & K \\
    TYC 4595-107-1 & 0.750000 & 5231 & 0.890 & 0.902 & G8.0 & G & G \\
    2MASS J18524052+4156057 & - & 3559 & 0.577 & 0.587 & - & K & K \\
    2MASS J18534407+4208274 & - & 3637 & 0.534 & 0.538 & - & K & K \\
    2MASS J18535462+4135227 & - & 3735 & 0.619 & 0.639 & - & K & K \\
    2MASS J19335656+4010546 & - & 3495 & 0.384 & 0.393 & - & M & M \\
    \hline
    \end{tabular}
\end{table}
\end{landscape}