You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: EXOhSPEC_Data_Reduction_UserManual.tex
+94-46Lines changed: 94 additions & 46 deletions
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,7 @@
31
31
}
32
32
33
33
\title{User Manual for Data Reduction of the EXOhSPEC Instrument \\ Working version: V0.3.1}
34
-
\date{September, 2018}
34
+
\date{December, 2018}
35
35
\author{Ronny Errmann, Neil Cook\\ Physics, Astronomy and Maths, University of Hertfordshire}
36
36
37
37
\begin{document}
@@ -70,7 +70,7 @@ \section{Installation and dependencies}
70
70
71
71
\subsection{With Anaconda and python 2.7}
72
72
73
-
\noindent Anaconda can be downloaded from \url{https://www.continuum.io/downloads}. Please select the version for python 2.7. After download it can be installed by running
73
+
\noindent Anaconda can be downloaded from \url{https://www.anaconda.com/download/}. Please select the version for python 2.7. After download it can be installed by running
\noindent Once Anaconda is installed tow other modules are needed (tqdm, gatspy). If Anaconda is installed correctly then pip can be used to install this module
93
93
\begin{lstlisting}[style=base]
94
-
pip install tqdm gatspy
94
+
pip install tqdm gatspy pyfits
95
95
\end{lstlisting}
96
96
%gatspy for lomb scargle
97
97
@@ -148,39 +148,6 @@ \subsubsection{Finding further information}
148
148
149
149
150
150
151
-
\newpage
152
-
\section{Short introduction to reduction of CCD images}
153
-
154
-
The data stored in CCD images is affected by the physical parameters of the individual pixels and way the readout electronics work. Therefore each scientific frame needs to be corrected (pixel by pixel) with the formula:
The master Dark should have the same exposure time as the Science frame and the master Flat should be normalised in order to keep the flux levels. To create the master Dark and master Flat, the following steps are necessary:
The master Dark used for the creation of the master Flat should have the same exposure time as the Flat and needs to be corrected with the Bias. The master Bias in each of the formulas can be different.
166
-
167
-
In order to decrease the noise levels, each of the master file should be created by median combining several (corrected) images together. If the brightness of the individual flats vary, then the flats should be weighted by their median flux before combining them. Combining all steps leads to the formula
where $B_S$ is the master Bias, created by combining biases taken at a similar time as the science frame, $D_S$ is the master Dark, created of darks with the same exposure time as the science frame. In case the bias level and noise don't change during the night, then Equation~\ref{eq:reduction_full} changes to
\item Arc (5x, calibration lamp through the calibration fiber, alternating a short (e.g. 5\,s) and a long (e.g. 120\,s) exposure time). The filename should start with \textbf{arc}, \textbf{ThAr}, or \textbf{UNe} and the science fiber should be dark for this data.
236
203
% \item FlatArc (11x, white light source and calibration lamp), the filename should be \textbf{flatarc}, \textbf{sflatThAr}, \textbf{whli-UNe}, or similar.
237
204
\item Bias (11x) and/or Darks (11x, for the exposure time of the true Flat and Flat)% and FlatArc)
205
+
\item Filenames science images: the optimimum is to use ``\_'' for object name (as in reference file \verb|object_file|, see Chapter~\ref{Section:create_object_list_file}). Use ``-'' to seperate exposure time, number of series and other information.
238
206
\end{itemize}
239
207
240
208
\subsection{Steps to run the code on a new set of data}
@@ -274,7 +242,7 @@ \subsection{Possible parameters for the CCD processing}
274
242
\item[localbackground] : Applies background correction by fitting a 2d polynomalial against the current reduced image, excluding the area of the science and calibration traces. The fitted 2d-image is then subtracted from the (reduced) image.
275
243
\end{description}
276
244
277
-
\noindent The following parameters change the way, several CCD images are combined:
245
+
\noindent The following parameters change the way, several CCD images are combined. In the pipeline always the individual frames are corrected before frames are combined.
278
246
\begin{description}
279
247
\item[normalise] : Before combining the files the images are normalised by their median flux.
280
248
\item[combine\_sum] : Normally files are combined using a pixel by pixel median. With this keyword the files will summed up. This parameter will be overwritten by \verb|combine_mean| (This might collide with \verb|max_good_value|.)
@@ -334,7 +302,7 @@ \subsection{Assigning the observed data and calibration data to the pipeline}
334
302
\item Type of light for the calibration fiber
335
303
\item Exposure time in seconds
336
304
\item Observation time
337
-
\item Flag 'e', if the spectrum should be extracted. This can be modified in order to allow different processing of the images before extraction. The following options are possible:
305
+
\item Flag 'w', if the Arc spectrum should be extracted (important for single fiber spectrographs). Flag 'e', if the spectrum should be extracted. This can be modified in order to allow different processing of the images before extraction. The following options are possible:
338
306
\begin{description}
339
307
\item[e alone:] The processing as given in parameter \verb|extract_calibs_create_g| will be assigned.
340
308
\item[e \textless obj \textgreater :] The processing as given in parameter \\\verb|extract<obj>_calibs_create_g| will be assigned. If this parameter doesn't exist, then parameter \verb|extract_calibs_create_g| will be used.
@@ -343,19 +311,52 @@ \subsection{Assigning the observed data and calibration data to the pipeline}
343
311
\end{description}
344
312
\end{itemize}
345
313
314
+
\subsection{Necessary information to calculate the barycentric correction}
315
+
In order to calculate the barycentric correction the time of the observation (or Julian Date), the pointing on the sky, and the position of the observatory on earth need to be known. These information can be given in different ways.
316
+
317
+
\begin{itemize}
318
+
\item The mid-exposure date and time is derived from the image header using the keys given in the parameter \verb|raw_data_dateobs_keyword| and \verb|raw_data_exptim_keyword| (half of the exposure time). The pipeline can handle different standard formats (YYYY-MM-DDThh:mm:ss). If necessary, further formats can be added in the procedure \textit{get\_obsdate}.
319
+
\item The position of the observatory will be extracted from the following sources (using the first available source in the following list:
320
+
\begin{enumerate}\setlength\itemsep{0em}
321
+
\item Reading latitude, longitude, and elevation from the header, using the the header keys defined in the beginning of procedure \textit{get\_barycent\_cor}: site\_keys, altitude\_keys, latitude\_keys, longitude\_keys (the first available entry of each list will be used, if necessary these lists can be extended).
322
+
\item Using the site coordinates as given in the configuration file.
323
+
\end{enumerate}
324
+
\item The pointing of the telescope (RA and DEC) will be derived from the following sources (using the first available source in the following list:
325
+
\begin{enumerate}\setlength\itemsep{0em}
326
+
\item reading the object coordinates from a list of objects (see Chaper~\ref{Section:create_object_list_file}).
327
+
\item Reading the object coordinates and epoch from the image header, using the header keys defined in the beginning of procedure \textit{get\_barycent\_cor}: ra\_keys, dec\_keys, epoch\_keys (the first available entry of each list will be used, if necessary these lists can be extended).
328
+
\item If the object name contains sun or moon, then the coordinates of the sun/moon are calculated for the mid of the observing time.
329
+
\end{enumerate}
330
+
\end{itemize}
331
+
332
+
333
+
\subsubsection{Creating a list of objects}
334
+
\label{Section:create_object_list_file}
335
+
If the coordinates of the object are not stored in the fits header, then they can be given using a the file specified in parameter \verb|object_file|. The file must contain one line per object. For each object the following tab-separated values need to be given:
336
+
\begin{enumerate}\setlength\itemsep{0em}
337
+
\item Object name (the filename should start with the object name in order to be used)
338
+
\item RA (hh:mm:ss.ss)
339
+
\item DEC ($\pm$dd:mm:ss.ss)
340
+
\item PM RA (arcsec/year)
341
+
\item PM DEC (arcsec/year)
342
+
\item Epoch of the coordinates (only the number)
343
+
\item Enable/Disable flag (1 for enabled)
344
+
\end{enumerate}
345
+
346
+
346
347
\subsection{Format of the extracted files}
347
348
Different types of extracted files are created. They are described in the following subsections.
348
349
349
-
\subsubsection{raw-data filename}
350
+
\subsubsection*{raw-data filename}
350
351
\label{section:extraction_data_format}
351
352
The final fits file contains the original header and some additional information, for example the calibration steps which were applied and some information about the flux collected in the different apertures. The data in the file is stored in a 3D array in the form: data type, aperture, and pixel. The data types are similar to the ones created by the CERES pipeline and are the following:
352
353
\begin{enumerate}
353
354
\setcounter{enumi}{-1}
354
355
\item 2D array with the wavelength for each aperture and pixel.
355
356
\item Extracted spectrum without any modification.
356
-
\item(Measurement of the error the extracted spectrum)
357
-
\itemFlat corrected spectrum, calculated by dividing the extracted spectrum and the normalised flat spectrum.
358
-
\item(Error the flat corrected spectrum)
357
+
\item Measurement of the error the extracted spectrum (using the scatter of the residuals after fitting a 2d polynomalial to the background areas (noise in the dark/bias))
358
+
\itemBlaze corrected spectrum, calculated by dividing the extracted spectrum and the normalised flat spectrum.
359
+
\item Error of the flat corrected spectrum (residuals of a polynomial fitted to the blaze corrected spectrum).
359
360
\item Continuum normalised spectrum. The continuum is derived by fitting a polynomial to the flat corrected spectrum, using only areas of the spectrum where no lines are located.
360
361
\item Signal to noise ratio in the continuum, calculated from the residuals between continuum fit and measured continuum and the flux in the continuum.
361
362
\item Mask with good areas of the spectrum. The following values are used:
This file contains the extracted spectrum without any modification in the same form as the \textit{e2ds} files created by the HARPS pipeline. The wavelength solution is stored in the header.
373
374
374
-
\subsubsection{raw-data filename + \_lin}
375
+
\subsubsection*{raw-data filename + \_lin}
375
376
\label{Section:linearised_spectrum}
376
377
The extracted spectrum is linearised using a wavelength step as given in parameter \verb|wavelength_scale_resolution|. The wavelength spectrum is interpolated by using the weighted mean of the neighbouring data points with the wavelength difference as weights.
377
378
378
-
\subsubsection{raw-data filename + \_lin\_cont}
379
+
\subsubsection*{raw-data filename + \_lin\_cont}
379
380
This file contains data in the same form as described in Section~\ref{Section:linearised_spectrum}, only that the continuum corrected data was linearised.
\caption{Reduced CCD image of a ThAr exposure (log10 gray scale) with the marked traces of the identified calibration orders/apertures (red). The extraction width is given in dashed lines. The extraction width (determined from the Gaussian width of the order multiplied with the value in parameter \textbf{arcextraction\_width\_multiplier}) is given in dashed lines.
412
-
\label{figure_arapertures_in_master_arc}}
422
+
\label{figure_arcapertures_in_master_arc}}
413
423
\end{figure}
414
424
415
425
@@ -788,6 +798,44 @@ \section{Module dependencies if not using Anaconda}
788
798
789
799
% Other versions may work but these are the ones tested.
790
800
801
+
802
+
\newpage
803
+
\appendix
804
+
\section{Short introduction to reduction of CCD images}
805
+
806
+
The data stored in CCD images is affected by the physical parameters of the individual pixels and way the readout electronics work. Therefore each scientific frame needs to be corrected (pixel by pixel) with the formula:
The master Dark should have the same exposure time as the Science frame and the master Flat should be normalised in order to keep the flux levels. To create the master Dark and master Flat, the following steps are necessary:
The master Dark used for the creation of the master Flat should have the same exposure time as the Flat and needs to be corrected with the Bias. The master Bias in each of the formulas can be different.
818
+
819
+
In order to decrease the noise levels, each of the master file should be created by median combining several (corrected) images together. If the brightness of the individual flats vary, then the flats should be weighted by their median flux before combining them. Combining all steps leads to the formula
where $B_S$ is the master Bias, created by combining biases taken at a similar time as the science frame, $D_S$ is the master Dark, created of darks with the same exposure time as the science frame. In case the bias level and noise don't change during the night, then Equation~\ref{eq:reduction_full} changes to
Copy file name to clipboardExpand all lines: conf.txt
+19Lines changed: 19 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -188,6 +188,25 @@ standard_calibs_create = []
188
188
# when reading already processed images from the result path, this defines what calibrations should be done. If one file type should be handled different, then <filetype>_calibs_read can be used
189
189
calibs_read = [subframe]
190
190
191
+
## Getting oject site and object coordinates to perform barycentric correction. If the values are stored in the header, then the header values are used
# Define the object coordinates using a file with a list of objects.
205
+
# The file needs to contain the comma separated values: Object name, RA (hh:mm:ss.ss), DEC (+-dd:mm:ss.ss), PM RA ("/year), PM DEC ("year), Epoch of the coordinates (only the number), Enable/Disable flag (1 for enabled)
logger('Warn: stopped RV fit because of too big absolute value in xc_av: min(xc_av) = {0} , max(xc_av) = {1} , len(xc_av) = {2}'.format(min(xc_av),max(xc_av),len(xc_av)))
0 commit comments