Both sides previous revision Previous revision Next revision | Previous revision |
en:praktikum:sternspektren_baches [2024/09/19 10:16] – [Barycentric correction] rhainich | en:praktikum:sternspektren_baches [2025/04/02 09:10] (current) – [Reduce the data] rhainich |
---|
| |
Star_1/ | Star_1/ |
Darks/ | darks/ |
Flatdarks/ | flat_darks/ |
Flats/ | ThAr_darks/ |
| flats/ |
ThAr/ | ThAr/ |
Star_1/ | Star_1/ |
Star_2/ | Star_2/ |
Darks/ | darks/ |
Flatdarks/ | flat_darks/ |
... | ... |
| |
workon ost_photometry | workon ost_photometry |
| |
This is also necessary if you reconnect to a12, e.g. after a break, and want to continue the data analysis. | This is also necessary if you reconnect to columba, e.g. after a break, and want to continue the data analysis. |
| |
The OST photometry pipeline can then be installed in the terminal using //pip// as follows | The OST photometry pipeline can then be installed in the terminal using //pip// as follows |
The scripts for the data reduction can be found on the [[en:praktikum: zugang| lab course computer]] in the folder ''~/scripts/n1_baches''. Copy the script ''1_masterimages.py'' into the local directory where you want to analyze the star (e.g. ''Star_1''). This script will create among other files the masterdark and the masterflat needed in the following processing steps. Furthermore, this script stacks all star images, if more than one was taken during the observations. It also offers the possibility to bin the observed images, if this was not done during the observation. It also cuts not needed parts of the captured images. This simplifies the further analysis steps. Last but not least, you should specify in this script if the exposures have to be mirrored (see previous step), so that this can be corrected as well. The configuration area of the script looks like this: | The scripts for the data reduction can be found on the [[en:praktikum: zugang| lab course computer]] in the folder ''~/scripts/n1_baches''. Copy the script ''1_masterimages.py'' into the local directory where you want to analyze the star (e.g. ''Star_1''). This script will create among other files the masterdark and the masterflat needed in the following processing steps. Furthermore, this script stacks all star images, if more than one was taken during the observations. It also offers the possibility to bin the observed images, if this was not done during the observation. It also cuts not needed parts of the captured images. This simplifies the further analysis steps. Last but not least, you should specify in this script if the exposures have to be mirrored (see previous step), so that this can be corrected as well. The configuration area of the script looks like this: |
| |
############################################################################ | |
#### Configuration: modify the file in this section #### | <code Python> |
############################################################################ | ############################################################################ |
| #### Configuration: modify the file in this section #### |
| ############################################################################ |
| |
### | ### |
# Path to the directories with the images | # Path to the directories with the images |
# | # |
# Darks: | # Darks: |
path_darks = '?' | path_darks: str = '?' |
| |
# Flat darks: | # Flat darks: |
path_flat_darks = '?' | path_flat_darks: str = '?' |
| |
# Flats: | # Flats: |
path_flats = '?' | path_flats: str = '?' |
| |
| # Darks for wavelength calibration exposures: |
| path_wavelength_darks: str = '?' |
| |
| # Wavelength calibration exposures: |
| path_wavelength: str = '?' |
| |
| # Spectra: |
| path_spectra: str = '?' |
| |
# Thorium Argon exposures: | # Output directory for the reduced flats. The master files will be saved in |
path_thorium_argon = '?' | # the current directory. |
| out_path: str = 'output' |
| |
# Spectra: | ### |
path_spectra = '?' | # Flip images? Possibilities: True and False |
| # |
| flip_images: bool = False |
| |
# Output directory for the reduced flats. The master files will be saved in | ### |
# the current directory. | # Bin the images? Possibilities: True and False |
out_path = 'output' | # |
| bin_images: bool = False |
| |
### | # Binning factor |
# Flip images? Possibilities: True and False | binning_value: bool = 2 |
# | |
flip_images = False | |
| |
### | ### |
# Bin the images? Possibilities: True and False | # Trim images to remove non essential parts and thus simplify MIDAS handling |
# | # Possibilities: True and False; Default: True |
bin_images = False | # |
| trim_image: bool = True |
# Binning factor | </code> |
binning_value = 2 | |
| |
### | |
# Trim images to remove non essential parts and thus simplify MIDAS handling | |
# Possibilities: True and False; Default: True | |
# | |
trim_image = True | |
| |
In ''path_darks'', ''path_flat_darks'', ''path_flats'', ''path_thorium_argon'' and ''path_spectra'' the corresponding subfolders are to be entered, which were created in section //Preparations//. ''out_path'' is the directory where the script places intermediate results. The reduced files (**master_dark.fit**, **master_flat.fit**, **master_thar.fit**, **master_spectrum.fit**) are stored in the local directory so that they are more easily available for the following analysis steps. | In ''path_darks'', ''path_flat_darks'', ''path_flats'', ''path_wavelength_darks'', ''path_wavelength'', and ''path_spectra'' the corresponding subfolders are to be entered, which were created in section //Preparations//. The variable ''path_wavelength_darks'' can be set to **'?'** if no darks were taken for the ThAr exposures. ''out_path'' is the directory where the script places intermediate results. The reduced files (**master_dark.fit**, **master_flat.fit**, **master_wave.fit**, **master_spectrum.fit**) are stored in the local directory so that they are more easily available for the following analysis steps. |
| |
If you want to mirror the recordings you have to set ''flip_images'' to ''True''. If the images should also be binned, set ''bin_images'' to ''True''. The binning factor can be determined via the variable ''binning_value''. | If you want to mirror the recordings you have to set ''flip_images'' to ''True''. If the images should also be binned, set ''bin_images'' to ''True''. The binning factor can be determined via the variable ''binning_value''. |
| |
| Execute the script with: |
| |
| python 1_masterimages.py |
| |
**Important:** When the data reduction is finished, disable the virtual environment with | **Important:** When the data reduction is finished, disable the virtual environment with |
The identification of the individual orders, the identification of the emission lines in the ThAr spectrum, and the correlation between the pixel and the wavelength scale is performed by the //MIDAS// script ''calibrate/baches''. The call could look like: | The identification of the individual orders, the identification of the emission lines in the ThAr spectrum, and the correlation between the pixel and the wavelength scale is performed by the //MIDAS// script ''calibrate/baches''. The call could look like: |
| |
calibrate/baches master_flat.fit master_thar.fit 26 26 24 | calibrate/baches master_flat.fit master_wave.fit 26 26 24 |
| |
The five parameters have the following meaning: | The five parameters have the following meaning: |
=============================== | =============================== |
Flat field = master_flat.fit | Flat field = master_flat.fit |
Calibration lamp = master_thar.fit | Calibration lamp = master_wave.fit |
Calibration table = thar.fit | Calibration table = thar.fit |
Num. of orders = 0026 | Num. of orders = 0026 |
In this case, the script should be stopped by entering a ''2''. Afterwards the script can be restarted with a reduced number of orders, e.g.: | In this case, the script should be stopped by entering a ''2''. Afterwards the script can be restarted with a reduced number of orders, e.g.: |
| |
calibrate/baches master_flat.fit master_thar.fit 23 20 20 | calibrate/baches master_flat.fit master_wave.fit 23 20 20 |
| |
A solid method is to gradually reduce the number of orders until the script executed successfully. Afterwards, the flatfield with the identified orders will be displayed in an external window (see below). It should be checked whether the marks of the orders are horizontal and whether they coincide with the actual orders that are visible on the flatfield. The left figure shows a successful test run, whereas the middle figure depicts a failure. The right figure shows a flatfield image taken with the QHY268M, where it can happen that //MIDAS// does not finish drawing all identified orders. From the order numbers, however, it can be assessed if all orders were successfully identified or not. The numbers also depend on whether the images are binned. As we usually use 2x2 binning, the above values should suffice. In case we have used 1x1 binning for the spectra however, you might have to double the second and third value. | A solid method is to gradually reduce the number of orders until the script executed successfully. Afterwards, the flatfield with the identified orders will be displayed in an external window (see below). It should be checked whether the marks of the orders are horizontal and whether they coincide with the actual orders that are visible on the flatfield. The left figure shows a successful test run, whereas the middle figure depicts a failure. The right figure shows a flatfield image taken with the QHY268M, where it can happen that //MIDAS// does not finish drawing all identified orders. From the order numbers, however, it can be assessed if all orders were successfully identified or not. The numbers also depend on whether the images are binned. As we usually use 2x2 binning, the above values should suffice. In case we have used 1x1 binning for the spectra however, you might have to double the second and third value. |
observatory_longitude = '?' # values in degrees, east is positive | observatory_longitude = '?' # values in degrees, east is positive |
observatory_height_above_MSL = '?' # enter in meter | observatory_height_above_MSL = '?' # enter in meter |
| |
| Execute the script with: |
| |
| python 2_barycentric_velocity_correction.py |
| |
As a result you get the barycentric velocity correction in km/s. | As a result you get the barycentric velocity correction in km/s. |
| ''percentage_line_flux_must_be_below_continuum'' | This variable determines how deep lines must be in comparison to the continuum so that line identifications are displayed for the corresponding lines. The higher this value, the fewer line identifications are displayed, since only the stronger lines then fulfill this criterion. **Note:** If the radial velocity is wrong and a value greater than zero is set here, then the line identification often does not work. Therefore this variable should be set to zero if the radial velocity is unknown. | | | ''percentage_line_flux_must_be_below_continuum'' | This variable determines how deep lines must be in comparison to the continuum so that line identifications are displayed for the corresponding lines. The higher this value, the fewer line identifications are displayed, since only the stronger lines then fulfill this criterion. **Note:** If the radial velocity is wrong and a value greater than zero is set here, then the line identification often does not work. Therefore this variable should be set to zero if the radial velocity is unknown. | |
| |
| <code Python> |
############################################################################ | ############################################################################ |
#### Configuration: modify the file in this section #### | #### Configuration: modify the file in this section #### |
############################################################################ | ############################################################################ |
| |
# Name of file with individual orders | # Name of file with individual orders |
file_with_orders = "master_spectrum_wr.fit" | file_with_orders = "master_spectrum_wr.fit" |
| |
# Name of file with merged spectrum | # Name of file with merged spectrum |
file_with_merged_spectrum = "master_spectrum_wrm.fit" | file_with_merged_spectrum = "master_spectrum_wrm.fit" |
| |
# Name of the object | # Name of the object |
object_name = "?" | object_name = "?" |
| |
| |
### | ### |
# Radial velocity [km/s] | # Radial velocity [km/s] |
# The specification of the radial velocity is necessary for the | # The specification of the radial velocity is necessary for the |
# line identification to work correctly (see below). | # line identification to work correctly (see below). |
radial_velocity = 0. | radial_velocity = 0. |
| |
| |
### | ### |
# Line identifications | # Line identifications |
# | # |
# Ions for which line markers are to be drawn. | # Ions for which line markers are to be drawn. |
# Example: ["HI", "FeI", ...] | # Example: ["HI", "FeI", ...] |
ions = [] | ions = [] |
| |
# Add lines that are not in the default database | # Add lines that are not in the default database |
# Format: {"Element descriptor": [[wavelength, alignment parameter]]} | # Format: {"Element descriptor": [[wavelength, alignment parameter]]} |
# alignment parameter possibilities: "center", "left", "right" | # alignment parameter possibilities: "center", "left", "right" |
manual_lines = {"Example Element": [[0.,"center"]], "Example Element 2": [[0.,"left"]]} | manual_lines = {"Example Element": [[0.,"center"]], "Example Element 2": [[0.,"left"]]} |
| |
# Percent the line flux must be lower than the continuum | # Percent the line flux must be lower than the continuum |
percentage_line_flux_must_be_below_continuum = 3. | percentage_line_flux_must_be_below_continuum = 3. |
| </code> |
| |
| Execute the script with: |
| |
| python 3_printmasterplot.py |
| |
By default, the script creates two PDF files: ''spectrum_panels_MIDAS-merged_<objectname>.pdf'' and ''spectrum_total_MIDAS-merged_<objectname>.pdf''. The file with ''total'' in its name displays the spectrum in a single plot. Due to the large spectral range in this plot, details are often hard to see. Therefore, the second file (with ''panels'' in the name) shows the respective spectrum distributed over several "panels", which in turn makes the identification of individual lines much easier. | By default, the script creates two PDF files: ''spectrum_panels_MIDAS-merged_<objectname>.pdf'' and ''spectrum_total_MIDAS-merged_<objectname>.pdf''. The file with ''total'' in its name displays the spectrum in a single plot. Due to the large spectral range in this plot, details are often hard to see. Therefore, the second file (with ''panels'' in the name) shows the respective spectrum distributed over several "panels", which in turn makes the identification of individual lines much easier. |
[1] [[https://ui.adsabs.harvard.edu/abs/1959elas.book.....S/abstract|Struve, O. (1959): Elementary Astronomy (Oxford University Press, New York) p. 259]] | [1] [[https://ui.adsabs.harvard.edu/abs/1959elas.book.....S/abstract|Struve, O. (1959): Elementary Astronomy (Oxford University Press, New York) p. 259]] |
===== Report ===== | ===== Report ===== |
| A standard report must be written. General information on the structure and content of practical reports can be found [[https://polaris.astro.physik.uni-potsdam.de/wiki/doku.php?id=en:praktikum:protocol|here]]. |
| |
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]]. | The overview of the theoretical background of the practical course includes a description of the formation of stellar spectra, the different spectral types and their properties. |
| |
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. | The methods section describes the observing procedure and the subsequent data reduction. This includes a general description of the steps carried out, any deviations from the standard procedure and a list of all parameters set. Any graphics produced in the course of data reduction should be included in the report, but may be relegated to the appendix. |
| |
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 reduced spectra are presented and described in the results section of the report. |
| |
The results part presents and describes the spectra of the stars (a few selected significant orders of each star are sufficient to be shown here, the rest goes into the appendix). It also includes the measurement of the radial velocity of each star from the line shift (including an error estimate) and the barycentric velocity correction for one of them. Do not forget to list the individual lines that you use with their respective rest frame wavelength, line shift, etc. | The analysis includes the determination of the spectral type for each star, based on the properties listed in the theoretical background. |
| |
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 there inconsistencies? Do you see specific and obvious features in the spectra you cannot explain? | 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 there inconsistencies? Do you see specific and obvious features in the spectra you cannot explain? |
| |
/* | //**Note:** The plots of each order of the spectra can be large files, often too large for an email attachment. You can upload the report to the [[https://boxup.uni-potsdam.de/index.php/login|University Cloud Service (BoxUP)]] and send us the link or file path to the plots if you have saved them on the lab computer.// |
//**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]].// | |
*/ | |
| |
//**Note:** The plots of the individual orders are in large files which generally do not fit into an email appendix. You may upload your report to the [[https://boxup.uni-potsdam.de/index.php/login|University cloud system (BoxUP)]] or send us the path to it on our lab course computer. // | |
| |
/* | |
[1] [[https://ui.adsabs.harvard.edu/abs/1959elas.book.....S/abstract|Struve, O. (1959): Elementary Astronomy (Oxford University Press, New York) p. 259]] | |
*/ | |
| |
/* **OLD BELOW** | |
| |
It needs to describe the theoretical basics (spectral types & formation of stellar spectra & Radial velocity), identify distinctive spectral lines for each spectral type, and (shortly) describe and discuss the typical characteristics (i.e. the specific lines per spectral type) of each spectral type. Estimate the spectral type of the stars. Discuss your results and compare them to the known features for a certain spectral type from the literature. Address shortcomings in your results and discuss possible causes. **Please include all plots from the data reduction,** including the plot for the spectral resolution and the original images showing the 2d spectra, **in the appendix of your report**. For each star, the plot showing the spectra of the individual orders should be also attached to the report. Only the characteristic orders (individual panels from the masterplot) for each star should be included in the main part of the report. | |
| |
After identifying the spectral type, the radial velocity of the star towards us should be measured (including an error calculation) and discussed. Please, discuss also the different components of the radial velocity we measure and the expected accuracy in the radial velocity. **In the appendix of your report** you should include a table with the rest wavelength, the measured wavelength, the wavelength shift and the resulting radial velocity of at least five absorption lines as well as an averaged radial velocity together with an error. | |
| |
**Remark:** This [[http://ned.ipac.caltech.edu/level5/Gray/frames.html | web page]] can be helpful in the process of the identification and the classification of spectra and their characteristics. Furthermore, this {{en:labcourse:n1:spectral_identification.pdf|classification flowchart}} might be helpful. Here you can also find another {{en:labcourse:n1:atlas.pdf|spectral atlas}}, which helps to identify the spectral type. This {{en:labcourse:n1:abb85karttunen_en.pdf|figure}} taken from Fundamental Astronomy by Karttunen et al. can also be helpful to classify the spectra.*/ | |
| |
[[en:praktikum:index|Overview: Laboratory Courses]] | [[en:praktikum:index|Overview: Laboratory Courses]] |