update data and gui chapters
This commit is contained in:
@@ -8,12 +8,29 @@ In this chapter the selection criteria for the data is explained in section \ref
|
|||||||
\section{Data selection}
|
\section{Data selection}
|
||||||
\label{sec:data: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}, ).
|
This study uses a broad selection of Kepler/K2 and TESS lightcurves, which were downloaded from MAST with the help of the astroquery (\cite{astroquery}) python package. 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.
|
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}
|
\section{Data reduction algorithms}
|
||||||
\label{sec:data:data_reduction}
|
\label{sec:data:data_reduction}
|
||||||
|
|
||||||
|
This chapter explains the methods used in this study, split into the algorithms for flare detection and folding lightcurves. Everything, like the GUI discussed in chapter \ref{sec:gui}, was written in python 3 (\cite{10.5555/1593511}). It also makes extensive use of the python packages astropy (\cite{astropy:2018}), numpy (\cite{numpy}), scipy (\cite{scipy}), pandas (\cite{pandas}) and lightkurve (\cite{lightkurve}). The focus of this chapter lays in the description of the method used to create the final output, which is less customizable than the GUI, which exposes most parameters offered in the functions of the lightkurve API. Unless stated otherwise, the default parameters are used. Furthermore for the final output only PDCSAP\_FLUX is used, which is set as the default flux in the lightkurve $LightCurve$ objects after reading the fit file. The methods are the same for both $KeplerLightCurve$ and $TessLightCurve$ subclasses.
|
||||||
|
|
||||||
|
\subsection{Flare detection}
|
||||||
|
|
||||||
|
The first step is to normalize the lightcurve. This is done to apply the same thresholds to all files in later steps. An example of this is shown in figure \ref{fig:full_gui_normal_selection_normalize_options} in chapter \ref{sec:gui:data_display}. The normalization is done via the $normalize()$ function of the $LightCurve$ class of the lightkurve api. Afterwards the lightcurves are flattened by called $flatten()$ of the $LightCurve$ objects. The resulting object is then used as the base for the detection of flares. This removes all longterm trends like brightness changes due to spot modulation or similar, while retaining short term events like flares or transits. A similar approach was used by \cite{au_mic_flaring_spi}.\\
|
||||||
|
The next step is then to call $calculateFlareFitsForLightcurve()$ with the flattened lightcurve as well as the normalized lightcurve as parameters. It returns two lists of dictionaries with the data for the flare peak as well as a fit which is described in the following paragraphs.
|
||||||
|
It parses the flattened lightcurve with the scipy $find_peaks$ function. This function returns local maxima, which can be further filtered by their minimum height as well as the minimum distance of datapoints they need to be apart. The minimum distance between points is set to 1 with no minimum required height. Afterwards the found peaks are sorted by height, and the highest 100 are returned. This was found to be a good amount as the most flares per fits file found in this study were around 70 for CD-56 1032A and B.\\
|
||||||
|
Afterwards each individual peak is checked. For this purpose every datapoint of the normalized flattened lightcurve is subtracted by 1 to move the average from 1 to 0. Additionally the star and end point of the flare are estimated. This is done by checking the datapoints before and after the peak. If it finds that the flux delta is below 0.005 for three consecutive datapoints, it stops, and assumes that the last checked point is the start/end of the flare. In the case it finds an infinite or NaN value (which can happen if there are gaps in the lightcurve data), or it reaches 100 datapoints before/after it will stop. This was found to cover most flares detected and provides enough datapoints for the following steps.\\
|
||||||
|
Afterwards multiple checks are done. The first checking if the 1 datapoint before the peak, and 1 after the peak are above a threshold of 0.003, or if 2 datapoint after the peak after above the same threshold (which is a similar approach to \cite{kepler_411_study}). Afterwards it is checked if the datapoint at two indices before the peak is larger than the datapoint right before the registered peak. While this eliminates the positive detection of 2 flares in they case of them appearing very shortly after another, it was by visual inspection found to eliminate more false positives. Shortly after another appearing flares are still allowed, if the criteria are met, and theres atleast one more datapoint between the peaks. Then a fit of the flare is generated. The first half of the fit, till the peak, is that of a gaussian function, with the second half being an exponential decay (similar approach to \cite{au_mic_flaring_spi} and \cite{doyle_2018}). Then the residual sum of squares (RSS) between the fit and the flux of the flare, as well as the total sum of squares (TSS) are calculated. Afterwards R-squared is calculated, and if it is below 0.8, the flare is rejected as the flare would not have the typical form. In the last step, the location of the flare in the normalized and flattened lightcurve are compared. This step has been introduced, as in some rare cases the flattening algorithm can produce a large spike (values of 10 or higher when normalized).
|
||||||
|
|
||||||
|
\subsection{Lightcurve folding}
|
||||||
|
|
||||||
|
This section will mainly describe how the $getOptimizedFold()$ function works. It takes the normalized lightcurve as well as a fit type as parameters. The fit type can either be "sine" for a sine fit, "poly" for a polynomlial fit, or "linear" for a linear fit. The default value is "sine", but can be changed for each individual star in the GUI.
|
||||||
|
The function at first generates two periodograms with the lightkurve function $to\_periodogram$. The first one uses the lombscargle algorithm, while the second one uses the boxleastsquares algorithm. Afterwards the 4 highest peaks of each are taken and converted into periods (unit in days).
|
||||||
|
Then each period found by each algorithm is compared with the periods found by the other, and in the case of a match (absolute value of the difference between the values of the two algorithms is smaller than 5\% of the larger of the two periods) this is now used as the rotational period as well as spot modulation period. If it does not find a match, it uses the period corresponding to the highest peak in the lombscargle periodogram.
|
||||||
|
Afterwards it gets the epoch time to the first minimum in the lightcurve using numpys $argrelextrema$ function. In the following loop, which is repeated up to 30 times, it will fold the lightcurve (using the lightkurve $fold$ function) with the period set to the spot modulation, and the epoch set to the first minima in the lightcurve. Then a fit is calculated using the prefered fit method (with a polynomial fit fallback for sine fit prefered and vice versa). If the resulting fit should have two maxima, and they are further away from the edges than 10\% of the used period, the algorithm checks if there is a signal for half the used period in any of the two periodograms. If this is the case, it will now use this as the period for spot modulation. A new fold for the rotational period is then generated. Afterwards it checks the location of the minimum of the spot modulation folded lightcurve. If the minimum is within 1\% of half the phase it will stop. If not, it will shifts the epoch by the difference of the minimum to 0, which is the center of the folded lightcurves phase, and repeat the folding process.\\
|
||||||
|
The function then returns the rotational period, the spot modulation period, the periods found by both periodograms as well as the folded lightcurve, the corresponding phase and the fit and fit type ("sine", "poly" or "linear") as well as the epoch. If the spot modulation differs from the rotational period found, it will also return the folded lightcurve, phase, fit and fit type of the rotational period folded lightcurve. The last returned value is "isValid", which is set to false if the algorithm should not break out of the loop in less than 30 tries.
|
||||||
|
|
||||||
\section{Spectral type identification}
|
\section{Spectral type identification}
|
||||||
\label{sec:data:sptype_identification}
|
\label{sec:data:sptype_identification}
|
||||||
@@ -62,7 +79,7 @@ The final spectral type for the stars can be found in table \ref{tab:unknown_spt
|
|||||||
\begin{tabular}{lccccccc}
|
\begin{tabular}{lccccccc}
|
||||||
\hline
|
\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 \\
|
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$ & & & \\
|
& & [$K$] & [$M_\odot$] & [$R_\odot$ ]& & & \\
|
||||||
\hline\hline
|
\hline\hline
|
||||||
1RXS J064643.6-770027 & 1.320000 & 4082 & 0.640 & 0.654 & K7.0 & K & K \\
|
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 \\
|
BD-08 995 & 0.820000 & 5316 & 0.920 & 0.905 & K0.0 & G & G \\
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
In this chapter the usage of the developed GUI application is explained. It was developed to easily download new data, as well as try various algorithms for flare detection and the usage of various functions of the lightkurve python package (\cite{lightkurve}).
|
In this chapter the usage of the developed GUI application is explained. It was developed to easily download new data, as well as try various algorithms for flare detection and the usage of various functions of the lightkurve python package (\cite{lightkurve}).
|
||||||
|
|
||||||
\section{Data download}
|
\section{Data download}
|
||||||
|
\label{sec:gui:data_download}
|
||||||
|
|
||||||
During the first startup the GUI window (e.g. in figure \ref{fig:full_gui_normal_selection}) is nearly completely empty. An empty local database will be created with SQLite3 (\cite{sqlite}). To show lightcurves, first data needs to be downloaded. For that, the "Add" button has to be clicked. A new dialog window will show. It can be seen in figure \ref{fig:download_new_star_data_gui}. This GUI uses the astroquery (\cite{astroquery}) python package to fetch metadata and download fits files from MAST (Mikulski Archive for Space Telescopes).\\
|
During the first startup the GUI window (e.g. in figure \ref{fig:full_gui_normal_selection}) is nearly completely empty. An empty local database will be created with SQLite3 (\cite{sqlite}). To show lightcurves, first data needs to be downloaded. For that, the "Add" button has to be clicked. A new dialog window will show. It can be seen in figure \ref{fig:download_new_star_data_gui}. This GUI uses the astroquery (\cite{astroquery}) python package to fetch metadata and download fits files from MAST (Mikulski Archive for Space Telescopes).\\
|
||||||
The first step is to enter the identifier of the star(s). In case of multiple, they have to be seperated by a semicolon. Then the missions from which the data should be fetched can be selected. The supported missions are TESS and Kepler/K2. For Kepler and K2 short and/or long cadence can be selected. The differeces are described in section \ref{sec:intro:space_missions}. After the selection has been made, the fetch button needs to be pressed. The program will then request metadata matching the star identifier(s) and selected missions from the MAST archive. The found mission data is then displayed in the preview field. It can then be downloaded by pressing the "Ok" button. The program the proceeds to download the according fits-files. The filename and TESS sector or Kepler/K2 target table ID is appended to the previously fetched metadata and handed back to the main GUI.\\
|
The first step is to enter the identifier of the star(s). In case of multiple, they have to be seperated by a semicolon. Then the missions from which the data should be fetched can be selected. The supported missions are TESS and Kepler/K2. For Kepler and K2 short and/or long cadence can be selected. The differeces are described in section \ref{sec:intro:space_missions}. After the selection has been made, the fetch button needs to be pressed. The program will then request metadata matching the star identifier(s) and selected missions from the MAST archive. The found mission data is then displayed in the preview field. It can then be downloaded by pressing the "Ok" button. The program the proceeds to download the according fits-files. The filename and TESS sector or Kepler/K2 target table ID is appended to the previously fetched metadata and handed back to the main GUI.\\
|
||||||
@@ -16,6 +17,7 @@ There a request to Simbad is made to fetch additional metadata. First the altern
|
|||||||
\end{figure}
|
\end{figure}
|
||||||
|
|
||||||
\section{Data display and manipulation}
|
\section{Data display and manipulation}
|
||||||
|
\label{sec:gui:data_display}
|
||||||
|
|
||||||
Afterwards the list of stars seen in figure \ref{fig:full_gui_normal_selection} will be refreshed. It shows the via Simbad determined main identifier alphabetically sorted.\\
|
Afterwards the list of stars seen in figure \ref{fig:full_gui_normal_selection} will be refreshed. It shows the via Simbad determined main identifier alphabetically sorted.\\
|
||||||
When one of the stars in the list is selected, the program will show the additional saved informations. This includes all known IDs (in the Alt. IDs list), the spectral type, its rotational velocity and its distance. Additionally a fit type for the folded lightcurves which are described in section \ref{sec:data:data_reduction}. The default for this is "sine". The list to the right of the information section shows the available fit files. The formating for the list entries is "TESS - <sequence>" and "Kepler/K2 - <target table id>". The combine button allows to show multiple fit files at once if multiple are selected. Select one or combining multiple fit files, enables the plot options.\\
|
When one of the stars in the list is selected, the program will show the additional saved informations. This includes all known IDs (in the Alt. IDs list), the spectral type, its rotational velocity and its distance. Additionally a fit type for the folded lightcurves which are described in section \ref{sec:data:data_reduction}. The default for this is "sine". The list to the right of the information section shows the available fit files. The formating for the list entries is "TESS - <sequence>" and "Kepler/K2 - <target table id>". The combine button allows to show multiple fit files at once if multiple are selected. Select one or combining multiple fit files, enables the plot options.\\
|
||||||
@@ -87,5 +89,11 @@ Pressing the button "New FC" will start the processing of all fits files in the
|
|||||||
|
|
||||||
And in the case the period and spot modulation of the star differs, it will seperately safe the folded lightcurves and related data for the stars period as well.
|
And in the case the period and spot modulation of the star differs, it will seperately safe the folded lightcurves and related data for the stars period as well.
|
||||||
|
|
||||||
After this process is done, a new window will open. It allows to show multiple different statistics like flares per file, flares per star (total, or normalized to per 7 day period) or mean periods for each star. This window can be seen in figure \ref{fig:summary_statistics_window}.
|
After this process is done, a new window will open. It allows to show multiple different debugging statistics like flares per file, flares per star (total, or normalized to per 7 day period) or mean periods for each star. This window can be seen in figure \ref{fig:summary_statistics_window}.
|
||||||
The data can then be saved using the pandas (\cite{pandas}) "to\_pickle" functions and also loaded again using the "read\_pickle" function.
|
The data can then be saved by clicking "File" and then "Save As", which uses the pandas (\cite{pandas}) "to\_pickle" function. Similarly it can be loaded again using the "read\_pickle" function which is called either by "File" and then "Open" in the debugging statistics window, or by clicking "Open" in the main window next to "New FC".
|
||||||
|
|
||||||
|
\begin{figure}[pt!]
|
||||||
|
\includegraphics[width=\linewidth]{gui/statistics_summary_window.png}
|
||||||
|
\caption{Debugging statistics window. Has the option to filter data by sources and spectral type for Kepler/K2/TESS pdcsap flux data. It has the ability to show various statistics likes flares per fits file, flares per star (total or normalized to a period of 7 days), or the mean period detected.}
|
||||||
|
\label{fig:summary_statistics_window}
|
||||||
|
\end{figure}
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 35 KiB |
Reference in New Issue
Block a user