====== N1 - Stellar spectra of different spectral types (DADOS) ====== /* This manual is currently under revision. Please use the german one instead. Sorry for any inconvenience this may cause. */ The aim of this observation is to obtain an overview of different spectral types. Thus, we will give you the coordinates and the apparent magnitude of four stars of different spectral type that are well visible during the night of your observation. Take spectra of these stars in order to classify them by means of the spectral lines and the shape of the continua. /* From the deviation of the absorption lines in the spectra from their rest wavelength, you can calculate the radial velocity of the star towards or away from us by using the Doppler effect. */ /*The aim of this observation is to obtain an overview of different spectral types. Thus, choose at least one star of each spectral type (O, B, A, F, G, K, M, special classes after consultation) that is well visible ($m_\mathrm{V} \le 9\,$mag). Take spectra of these stars in order to classify them by means of the spectral lines and the shape of the continua. To find suitable stars, use pages like [[http://simbad.u-strasbg.fr/simbad/|Simbad]] - a help page for the parameter query at Simbad can be found [[en:etc:simbad|here]].*/ ===== Observation ===== Nightly observations at the OST in Golm with the DADOS spectrograph are required. The scientific and technical background for this observation are presented in the seminary talks. A list with objects will be provided by us. **Note**: The following exposures are needed //for every// star: * the stellar spectra * calibration spectra with a discrete light source * calibration spectra with a continuous light source (flatfield) * darkframes for the exposures of the stellar spectra and the continuous light source The calibration exposures are needed to calculate the pixel scale (wavelength calibration) and to remove the instrument signatures and possible artifacts. ===== Data reduction ===== The scripts needed for the data reduction can be found on the [[en:praktikum:zugang|Laboratory computer]] in the directory ''~/scripts/n1_dados''. {{section>deng:praktikum:a12:python#English&noheader}} ==== Selection and inspection of the data ==== The first tasks are to login to the [[en:praktikum:zugang |Laboratory Computer]] and to copy the observational data (FITS files), including darkframes, and the additional calibration exposures from the directory ''~/data/'' to your own directory ''~/data_reduction/''. There are different tools to view the FITS files (two dimensional CCD images or data tables). //ds9// is easy to handle and can be started from the terminal via: ds9 filename.fit Tasks: * determine the range of CCD rows that contains the stellar spectrum * determine the range of CCD rows that can be used as background. Important: The background region must be outside the spectrum, but still within the used slit of the spectrograph. If the latter cannot be distinguished from the black background, compare with the images of the lamp spectra. ==== Wavelength calibration ==== === Basic principle === This script finds the maxima of the emission lines in the discrete calibration spectrum, marks them, and identifies their pixel number (i.e. position of the maximum). These numbers are correlated to the wavelengths of those emission lines to have the conversion scale between the pixel and the wavelength. === Parameter === The required script (''1_findcaliblines.py'') is written in Python. Edit the file using a text editor of your choice (i.e. //kate// or //emacs//) and adjust the path to the exposure of the discrete light source (the black lamp that emits the line spectrum) as well as the CCD rows that should be extracted. Two row ranges are requested. One that contains the calibration spectrum and hence should lie **within** the slit, while the second one is designated for a background region and therefore needs to lie **outside** the slit: # name of the file with the wavelength calibration spectrum calibFileName = "calib_wave.FIT" # region (rows on the image) containing the calibration spectrum specRegionStart = 495 specRegionEnd = 600 # background region (rows on the image), which needs to be outside of the slits bgRegionStart = 0 bgRegionEnd = 200 The calibration is designed such that lines of mercury and argon are identified. The strongest lines that can be expected are marked in the following plot. [{{ :ost:spektrograph:spectra:calib_lines_dados.jpg?direct&800 | Emission spectrom of our calibration lamp. The strongest mercury and argon lines are identified.}}] /* The five strong lines of mercury in the used wavelength range can be cross-correlated with the pixel positions of these lines. Our ST-8 camera usually covers a wide spectral range such that not only the strong Hg lines but also some weak Ar lines are visible in the obtained calibration spectra. While these lines can be also use for the wavelength calibration, this might be not possible or desirable in some cases. In these situations the range where the script is looking for lines can be restricted with the parameters ''xstart'' and ''xend''. */ === Execution of the script === Now run the script by executing: python 1_findcaliblines.py Afterwards the following window will be displayed on the screen, showing the mercury and argon emission line spectrum. All lines that were identified by the script are highlighted by a red circle. Now, all lines with known wavelengths need to be marked. For this task, the above example spectrum can be very useful. The script runs through a list of predefined lines. The wavelength of the current line is displayed in the upper part of the window. The line corresponding to this wavelength can now easily marked by clicking into the corresponding red circle with the left mouse button. This circle should now appear blue and the corresponding wavelength is written next to the line peak (see below). If a wavelength is displayed that does not correspond to any of the highlighted lines, this wavelength can be skipped with a right click. At least four lines need to be marked to facilitate a successful wavelength calibration. If all useful lines are marked, this procedure can be completed by pressing the ''Q key'' on the keyboard. [{{ :ost:spektrograph:dados:dados_select_line.png?direct&600 | Calibration plot without marked lines}}] [{{ :ost:spektrograph:dados:dados_select_line_2.png?direct&600 | Calibration plot with seven marked lines}}] ++++ Error output | It might happen that the following error message appears in the terminal: can't invoke "event" command: application has been destroyed while executing "event generate $w <>" (procedure "ttk::ThemeChanged" line 6) invoked from within "ttk::ThemeChanged" This message can be ignored, since it has no impact on the calibration result. ++++ Subsequently, the calibration curve will be plotted by the script (see below). If the calibration procedure is successful, the calibration curve will be nearly linear. [{{ :ost:spektrograph:dados:calibration_fit_dados.jpg?direct&400 |Calibration curve for our DADOS spectrograph }}] By default the following files are then created: * ''calibration_spectrum.dat'' - containing the correlated pixel to wavelength scale * ''calibration_selection.pdf'' - a plot showing the selected lines for the wavelength calibration (please add this plot to your report) * ''calibration_fit.pdf'' - a plot of the wavelength calibration (i.e. ''calibration_spectrum.dat'', please add this plot to your report) === Error handling === Check the plots for possible errors. Especially, if the ''calibration_fit.pdf'' does not appear to be linear, edit the script, and run it again. Errors sources could be: * wrongly marked lines * a non standard wavelength range or another calibration lamp. The wavelengths of additional calibration lines can be identified with the help of the [[http://physics.nist.gov/PhysRefData/ASD/index.html|NIST Database]]. Those wavelength need be added to the variable ''linelist'' in the script. ==== The stellar spectrum ==== === Basic principle === The next step after the determination of the calibration curve is the reduction of the stellar spectrum. First, the darkframe is subtracted from the spectrum, then the spectrum is divided by the flatfield, and, lastly, the wavelength calibration is performed. It also exist the possibility to mark spectral lines in the spectrum. === Parameters === This associated script is named ''2_extractspectrum.py''. The script has a number of parameters, similar to the previous scripts, along with some additional parameters. The parameter section usually looks similar to this: ### science spectrum file ### # file with stellar spectrum science = 'star.FIT' # directory of the darkframe for the stellar spectrum darkframe_dir = 'darks/??s/' # flatfield directory flatfield_dir = 'flats/' # directory of the darkframe for the flats flatdark_dir = 'darks/??s/' ### Data that should be extracted ### # region containing the science spectrum specRegionStart = 495 specRegionEnd = 590 # sky background region (inside the slit) bgSkyStart = 96 bgSkyEnd = 104 ### Plot range ### # set the variables to '?' for an automatic resizing lambdamin = '?' lambdamax = '?' #lambdamin = 3500. #lambdamax = 5000. Comments on these parameters:: * The variables ''specRegionStart'' and ''specRegionEnd'' define the range of CCD rows that will be extracted. These rows need to be chosen such that the stellar spectrum is completely covered. * The sky background needs to be subtracted. So, as before, a range of rows **within the slit** but **outside the spectrum** must be chosen. If possible, the number of rows should be the same for both, i.e. (specRegionStart - specRegionEnd) = (bgSkyStart - bgSkyEnd). * The options ''lambdamin'' and ''lambdamax'' can be used to restrict the plot range. If these variables contain a ''?'' the plot range will be determined automatically. ++++ Additional parameter | **Reduction method:** The variable ''mode'' allows to specify the reduction method. An average over all extracted CCD rows will be calculated, if the method //mean// is set. A median function will be applied, if //median// is selected. The latter method should be used as the default. ### Image reduction mode ### #mode = 'mean' mode = 'median' **Line identifications:** The line identifications can be switched on and off via the variable ''plotident'': ### Idents ### # plot idents yes or no plotident = 'yes' #plotident = 'no' The file with line identifications, which by default is simply denoted by ''absorption_lines'', is not required for a successful script run, i.e. the variable ''lineFile'' can be an empty string or point to an empty file: # file containing line identifications lineFile = "" # or lineFile = "directory/empty_file.dat" See below for an explanation how to adjust the line identification file for the individual stars. **File names:** It also exists the possibility to change the names of the output files as well as to adjust the names of the files from the first step of the data reduction that are now needed as input for the wavelength calibration. ++++ === Execution of the script === Now run the script: python 2_extractspectrum.py The following files are then created: * stern_spectrum.dat - with the tabulated spectrum * stern_spectrum.pdf - showing the plotted spectrum * flatfield.pdf - showing the plotted flatfield (please add this plot to your report) === Identification of spectral lines === Line identifications for known spectral lines can be plotted by means of a file containing these information. An example file (''absorption_lines'') can be found in the ''scripts'' directory. This file **contains some but not all important spectral lines** that are visible in the variety of stars, which we observe. **Therefore, it is required to search for additional spectral lines** and the corresponding transitions for example in the [[http://physics.nist.gov/PhysRefData/ASD/index.html|NIST Database]]. A how-to for this can be found [[en:praktikum:nist|here]]. Moreover, it is recommended to create an individual line-identification file for each of the observed stars. To identify lines in the stellar spectrum, copy the relevant lines into the separate file. The format of that file should look like (wavelength in Å | identifier): 3888.052 HI 3970.075 HI 4861.38 HI 6562.88 HI 5801.33 5811.98 CIV As can be seen from the last entry, also ions with multiplet transitions can be included. **Line identifications that can be not assigned to any spectral line need to be removed from the corresponding file.** The file can then be referenced in the Python script: # file containing line identifications lineFile = "directory/line_list_for_starname.dat" Rerun the script to obtain a plot with adjusted line identifications. /* ==== Radial velocity determination ==== Due to the Doppler effect the relative velocity of a star towards or away from us results in a wavelength shift. This shift can be measured with the help of the absorption lines that are found in the spectrum. Please, ask the supervisors to create fits files of you spectra, first. We need to plot the fully calibrated spectrum in MIDAS. $inmidas crea/graph plot stern_spectrum The following commands can be used to select a certain range in x (xlow < x < xhigh) or y (ylow < y < yhigh) in the plot to zoom in on one spectral line: set/gra xa=xlow,xhigh set/gra ya=ylow,yhigh While determining the spectral type you already identified several absorption lines. For those we want to measure the central wavelength. This can be done by fitting the line with a Gaussian function. center/gauss gcursor,2 ? absorption To do the fit of the function click left and right of the absorption line with the left mouse button, to quit press the right mouse button. In the terminal you will find the fit parameters like "CENTER" (central wavelength of the line core) or "FWHM" (Full Width at Half Maximum), which gives you the width of the Gaussian function. Re-do the measurement several times to be sure to set good limits for the Gaussian fit and to get a feeling of the error in the measurement. This should be done for at least five single absorption lines. Do you see a difference in the accuracy of the measurent of the central wavelength of different lines? Discuss the reason in the report. With the help of the Doppler formula you can then calculate the relative velocity of the star from the shift of the central wavelength of the absorption lines in respective to their rest wavelength given in the linelist (''absorption_lines''). */ /*Dazu klickt man die beiden Punkte an, an denen der linke und rechte Linienflügel ins Kontinuum übergehen. Die Fitparameter wie “CENTER” (Wellenlänge des Linienkerns in Å) oder “FWHM” (Full Width at Half Maximum, Halbwertsbreite in Å) werden in der Konsole angezeigt. Beenden mit Rechtsklick im Plotfenster.*/ ===== Report ===== A usual report is to be handed in. See a general overview about the required structure and content [[https://polaris.astro.physik.uni-potsdam.de/wiki/doku.php?id=en:praktikum:protocol|here]]. For this experiment, the theoretical overview in the report should describe the formation of stellar spectra, the different spectral types with their main characteristics and properties, and the concepts behind radial velocity measurements. In the methods section describe the observations and the data reduction, highlight points that deviate from general description in here and list all the parameters you set for the extraction. Further, include all the plots of the data reduction in the report (a few in the text, most of them in the appendix). The results part presents and describes the calibrated spectra of the stars. The analysis of the spectra contains the estimation of the spectral type for your target stars based on the characteristics that you have described in the theoretical background section. Finally, discuss your findings. Bring your results into a larger context and make a literature comparison when possible. This also includes that you identify potential problems with the data, the data reduction, or the analysis and possible solutions for them. Are their inconsistencies? Do you see specific and obvious features in the spectra you cannot explain? //**Note:** This {{en:labcourse:n1:abb85karttunen_en.pdf|figure}} [1] can be helpful to classify the spectra. You may also compare your spectra to the {{en:labcourse:n1:atlas.pdf|spectral atlas}} and look up the [[http://ned.ipac.caltech.edu/level5/Gray/frames.html | NIST web page]] to identify individual spectral features. Another guide to the classification of stellar spectra can be found [[https://www.handprint.com/ASTRO/specclass.html|here]].// [1] [[https://ui.adsabs.harvard.edu/abs/1959elas.book.....S/abstract|Struve, O. (1959): Elementary Astronomy (Oxford University Press, New York) p. 259]] [[en:praktikum:index|Overview: Laborytory Courses]]